Hello everyone!
I hope you are well 🙂
I wanted to know if someone has a code to get the angle of a moving average, for example the 30 one.
I already found an inclination code that I arrange to me but I’d like to get the angle in order to get the power of the movement.
Someone has an idea?
Thanks!
It has already been discussed, it’s a common request since it should give an information about the trend slope. But the inclination of a moving average is nothing more than its percentage gain or loss since X periods. But you can get an error rate of the linear regression on a moving average like this:
return R2[20](average[20])
If the correlation is high, the moving average tends to be more similar to a straight trend line.
Similar topics:
Calculating the Angle / Linear Regression of a line
Indicator for inclination of moving average
Slope of an MA indicator:
Moving Average Slope
which is a simple momentum / rate of change of a moving average.