0

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?

enter image description here

Amzoti
  • 56,093
  • 1
    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. – Paul Orland 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 –  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
  • 1
    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 http://quant.stackexchange.com/. –  Jan 29 '13 at 22:01
  • Thank you for the link, Michael! And good point about data smoothness. I had not considered that...I supposed I would have run into that sooner or later :-) – Chad Johnson Jan 29 '13 at 22:50

1 Answers1

1

It seems to me that you are looking for points with zero curvature.