# How can I find changes in momentum/direction of a line graph?

Let's say I have a line graph with a $1-\text{minute}$ moving average as pictured below.

I would like to use a script find the $X'd$ positions on the line. The $X's$ represent beginnings of changes in momentum/direction.

Is there an algorithm or mathematical formula(s) to accomplish this? Perhaps a combination of standard deviation and slope?

-
Are you trying to make some money on the stock market? The "change in momentum" theoretically happens at the tops of the peaks and the bottoms of the valleys. This is where the slope of the graph is momentarily zero before changing direction. You will need to be a little bit more precise about what you want to find. –  orlandpm Jan 29 '13 at 21:21
Ahh..."momentarily zero"..."peaks"..."valleys"......that is helpful. Thank you. –  Chad Johnson Jan 29 '13 at 21:33
I think if you are looking to apply this idea in finance you will soon run into problems regarding the smoothness of the data –  user50407 Jan 29 '13 at 21:53
Maybe I can only focus on "major" changes or use a neural network for fuzziness. –  Chad Johnson Jan 29 '13 at 21:55
Possibly, I don't know enough to say anything about that though. By the way, if you don't get a good answer here, it might be worth trying on quant.stackexchange.com. –  user50407 Jan 29 '13 at 22:01