Im trying to teach myself programming through this site and its been very slow going. It would be great if I had something small to mess around with the variables while I'm learning to build something more complex . Could anyone help me out with some code for this?

1. When a price increase or decrease of X % occurs at the end of a trading day, trigger a buy or short on open of next day (bonus if I could look at buying at the very end of the same day)
2. Sell stock at end of following trading day