Measuring the acceleration of an indicator can be useful in detecting strong price movement. The market may be in bullish or bearish acceleration. In this post, I will show you how to evaluate the acceleration of a technical indicator. I will give you the source code of acceleration measuring runnable on the Prorealtime platform.

Why measure the price acceleration?
Measuring the price acceleration can help you to detect the beginning of a large movement. In this case, you will open an entry to benefit from the price variation and take a substantial gain.
How to measure the acceleration?
Measuring bullish or bearish market acceleration takes two steps. Firstly, you will need to evaluate the market direction and secondly, you will need to see if this direction is growing.
Price direction measuring
It’s very easy to measure price direction thanks to the linear regression slope on a period. The “LinearRegressionSlope” instruction on Prorealtime allows you to obtain this slope:
regSlop = LinearRegressionSlope[20](close)

The previous example’s linear regression slope is computed on price for 20 periods.
Price acceleration measuring
You can now easily measure price acceleration thanks to the difference between the slope variable’s actual value and her previous value. The result of this calculation is a kind of the second derivative. You can consider that as a “variation of variation” of price.
acceleration = regSlop[0] - regSlop[1]
If the acceleration variable is greater than zero, that would mean two things :
- Price increases more and more strongly. There is a bullish acceleration
- Price decreases less and less strongly. It is the end of the bearish trend
If the acceleration variable is less than zero, that would mean two things :
- Price decreases more and more strongly. There is a bearish acceleration
- Price increases less and less strongly. It is the end of the bullish trend
Price acceleration indicator
Here is 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

End of the trend detection
You can detect the end of the trend using the previous indicator. When the acceleration indicator crosses zero, there are two possible interpretations:
- If the acceleration indicator crosses over zero, the bearish trend ends.
- If the acceleration indicator crosses under zero, the bullish trend ends.
End of bullish trend example

End of bearish trend example

Measure the acceleration on other indicators
This method of acceleration measuring which we calculated on price can be transposed on any technical indicators. You 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.
Transform your automated trading with expert insights about the Prorealtime platform

Are you tired of spending countless hours analyzing the markets and trying to make profitable trades? Are you ready to take your trading to the next level with a winning trader bot? Look no further than the Seven Pillars to Build a Winning Trader Bot guide.
In addition, you will receive the source code of five automated trading strategies working on Prorealtime.
Very interesting ! And useful, thanks for sharing.
Hi Hal, you’re welcome, thanks for the comment 🙂