This is the simplest formula there is to buy stocks. Seriously its not hard, yet many fail to follow it.
On a weekly chart:
Identify higher highs with higher lows, buy when price pullbacks are mild (or not greater than 10%).
That is it. Of course millions of smart folks screw this up. This rule is the back bone of buying correctly in the stock market.
Taking profits or getting out the market. Well that's a little harder. Using stops is always considered smart.