Measuring the acceleration of an indicator is very easy to do. The market may be in bullish acceleration or bearish acceleration.

Measuring bullish or bearish market acceleration takes two steps. Firstly, you will need to compute the market direction and secondly, you will be able to see if this direction is growing.
Measuring price direction
It’s very easy to measure price direction thanks to the linear regression slope on a period. The “LinearRegressionSlope” instruction proposed by Prorealcode allows you to obtain this slope.
regSlop = LinearRegressionSlope[20](close)

In the previous example, the linear regression slope is computed on price on 20 periods.
Measuring price acceleration
You can now easily measure price acceleration thanks to the difference between the slope variable’s actual value and her previous value.
acceleration = regSlop[0] - regSlop[1]
The result of this calculation is a kind of the second derivative. You can consider that as a “variation of variation” of price.
If the acceleration variable is greater than zero, that would mean two things :
- price increase more and more strongly, that is a bullish acceleration
- price decrease less and less strongly, that is an end of the bearish trend
If the acceleration variable is less than zero, that would mean two things :
- price decrease more and more strongly, that is a bearish acceleration
- price increase less and less strongly, that is an end of the bullish trend
Price acceleration indicator
Here the acceleration measuring indicator that I use :
regSlop = LinearRegressionSlope[20](close) acceleration = (regSlop[0] - regSlop[1]) * 1000000 averageAcceleration = Average[3](acceleration) ZERO = 0 RETURN averageAcceleration AS "Acceleration", ZERO AS "0"
Bullish acceleration example

Bearish acceleration example

Detect the End of Trend thanks to acceleration measuring
You can detect the end of the trend when the acceleration indicator crosses zero :
- If the acceleration indicator crosses over zero that mine the end of the bearish trend.
- If the acceleration indicator crosses under zero that mine the end of the bullish trend.
End of bullish trend example

End of bearish trend example

Measure acceleration on other indicators
This method of acceleration measuring which we calculated on price can be transposed on any technical indicators. You just need to replace “close” with your preferred indicator in the « LinearRegressionSlope[period](close) » instruction.
If you want to learn more about automated trading, please see our automated trading learning section.
If you are any questions, please ask me in a comment and if this article pleased you I would be grateful to see you share it.
Download for free the “SEVEN PILLARS TO BUILD A WINNER PROREALTIME BOT”
The “SEVEN PILLARS TO BUILD A WINNER PROREALTIME BOT” is a PDF containing 63 pages allowing you to improve the success of your automated trading system.
Very interesting ! And useful, thanks for sharing.
Hi Hal, you’re welcome, thanks for the comment 🙂