Count the historical crossovers of Moving Average Possible?
Posted: Apr 21 2013
Hi All,
Is there a way to count (look back) or calculate the amount of times that a moving average has crossed over itself?
So if I apply a 5 period moving average to a chart and a 20 period moving average, can I count the amount of times the 5 period moving average would-have/should-have crossed above or below the 20 period moving average?
I also was hoping to be able to have a variable that will allow me to set how far back i look. So as an example, i want to look back only for crossovers in the past 60 bars (approx 12 weeks).
Not sure if this is possible to do, but feedback appreciated.
The reason why i am trying to do this is to very roughly determine if a stock is trending is a sideways/messy range as opposed to trending. Theoretically, a high count of crossovers within a set period should crudely filter out the sideways ranging stock. In theory...
Thank you for your time and help!
Kindest Regards,
Kaj
Is there a way to count (look back) or calculate the amount of times that a moving average has crossed over itself?
So if I apply a 5 period moving average to a chart and a 20 period moving average, can I count the amount of times the 5 period moving average would-have/should-have crossed above or below the 20 period moving average?
I also was hoping to be able to have a variable that will allow me to set how far back i look. So as an example, i want to look back only for crossovers in the past 60 bars (approx 12 weeks).
Not sure if this is possible to do, but feedback appreciated.
The reason why i am trying to do this is to very roughly determine if a stock is trending is a sideways/messy range as opposed to trending. Theoretically, a high count of crossovers within a set period should crudely filter out the sideways ranging stock. In theory...
Thank you for your time and help!
Kindest Regards,
Kaj