Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|cite|improve this question
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 – user50407 Jan 29 '13 at 22:01

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

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.