top of page

Linear Regression Slope

Updated: Jun 24

What it is and how to use it


What is it?

The Linear Regression Slope is a statistical tool that measures the angle or slope of the linear regression line. In trading, the Linear Regression Slope helps identify the direction and strength of a trend. A positive slope indicates an uptrend, while a negative slope indicates a downtrend.


Who made it?

Linear regression dates back to the early 19th century, and was introduced by Carl Friedrich Gauss and later expanded by Sir Francis Galton.


How is it calculated?

The formula for the Linear Regression Slope (LRS) is:


LRS = (N sum(x y) - sum(x) sum(y)) / (N sum(x^2) - (sum(x))^2)


Where:

  • N is the number of periods.

  • x represents the time period.

  • y represents the price.

Code (ProRealTime)


How do you use it?

The Linear Regression Slope can be used in several ways:


Trend Identification:

Use the slope to determine the direction and strength of a trend. A positive slope indicates an uptrend, while a negative slope indicates a downtrend. The steeper the slope, the stronger the trend.


Signal Generation:

When the slope crosses above zero, it may signal the beginning of an uptrend, and below zero, it may signal the beginning of a downtrend.


Confirmation:

The slope can be used to confirm signals from other indicators. For example, if a moving average crossover indicates a buy signal, a positive slope can provide confirmation.


FAQ

Q: What are the best settings for Linear Regression Slope?

A: The default setting for Linear Regression Slope is typically 14 periods, but you can adjust it to fit your trading strategy and the asset you're analyzing.


Q: Is Linear Regression Slope good for day trading?

A: Yes, Linear Regression Slope can be useful for day trading. It helps you identify the direction and strength of the trend, providing potential entry and exit points.


Q: How does Linear Regression Slope compare to Moving Averages?

A: Both the Linear Regression Slope and Moving Averages are used to identify trends, but they do it differently. Linear Regression Slope shows the direction and steepness of the trend while Moving Averages smooth out price data over a set period.


Strategies using Linear Regression Slope

Comments


Commenting has been turned off.
bottom of page