I am trying to remember how to code in vba and am having difficulties. I need to jog my memory.

I have a historical price range for a certain stock. I look for the points when the stock's price increases more than three standard deviations from the moving average, and mark that point; I then look for the first subsequent drop in the stock price, no matter how long this takes. Any suggestions on how to set up a loop or other formula that might let me mark the point where the stock drops?