LinearRegressionLine is a powerful VertexFX client side VTL indicator based from the trend-following family of indicators.
The Linear Regression technique is a statistical methodology to determine how closely a set of points are related to each other and whether a function can define these set of points. Each point can then be expressed as
y = Ax + B, where A is the Slope and B is the intercept.
This concept is applied in this indicator.
In the first step, we regression variables over the most recent LRL_PERIOD candles.
In the second step, we calculate the Slope and Intercept based on the regression variables.
In the final step, the Linear Regression Line is approximated and calculated for the latest candle using the calculated Slope and Intercept.
The idea behind this technique is that in trending markets, the prices are well-organized and can be predicted with better accuracy than in sideways markets where the randomness is higher and hence predictability is lower.
When the market is trending upwards or downwards, the accuracy of the Slope and Intercept is better, and hence the predicted value of the Linear Regression Line is more accurate. At the same time, the predicted Linear Regression Line follows the trend.
When the trend stalls, the variation in the line increases and it is very likely that the price breaches the line. This step repeats when a new trend is detected.
Hence the Linear Regression Line provides an excellent trend-following signal with minimal lag.
BUY - Enter BUY trade when the candle closes above the Linear Regression Line indicator. Avoid opening BUY trade if the candle opens gap-up above the Linear Regression Line indicator.
SELL - Enter SELL trade when the candle closes below the Linear Regression Line indicator. Avoid opening SELL trade if the candle opens gap-down below the Linear Regression Line indicator.