Linear Regression Angle MT4
Linear Regression Angle is a directional movement oscillator which defines a trend at the moment of its birth, and additionally defines trend weakening. The indicator calculates the angle of the linear regression channel and displays it in a separate window in the form of histogram. The signal line is a simple average of the angle. The second line is the angle offset by a specified number of bars.
The angle is the difference between the right and left edges of regression (in points), divided by its period.
The angle value above zero indicates an uptrend. The higher the value, the stronger the trend. A value below zero indicates a downtrend. The lower the value, the stronger the downtrend.
- Stable trend recognition from its emergence up to the completion.
- Defining areas where the trend is weakening, and areas where the directional movement is resumed.
- It works on any instrument.
- It works on all timeframes.
- No repaints, no recalculation.
- LinearRegressionPeriod - linear regression calculation period. The longer the period, the more stable but more lagging it is. Cannot be less than 3.
- SmoothPeriod - smoothing period when plotting the average angle. Cannot be less than 3.
- ShiftPeriod - a shift in the number of bars to draw the third line - an angle with an offset. Cannot be less than 1.
Linear Regression Angle can be used in several ways.
- As a trend indication: if the histogram is positive, the trend is growing, a negative value is a sign of a downtrend.
- To assess the trend strength: when the histogram is positive and above its signal line value - the uptrend is gaining momentum. If the histogram is below the signal line, but is greater than zero, the uptrend is weakening. When the histogram is negative and its value is below the signal line - the downtrend is gaining momentum. If the histogram is above the signal line, but is below zero, the downward trend is weakening.
- For signal generation: trend following buy/sell when the histogram crosses the zero level; buying against the downtrend at the intersection of the signal line from the bottom up in the negative zone, also in this case this is a signal to close a short position; selling against the uptrend at the intersection of the signal line from top to bottom with the uptrend, also in this is a signal to close a long position.
- Trend direction and strength can also be determined based on the ratio of the angle and the offset angle.
The smaller the Regression Period value, the more often the indicator will produce trend change signals.
The smaller the smoothing period SmoothPeriod, the more often the indicator will generate trend weakening signals.
It is recommended to set SmoothPeriod < Regression Period.
The following signals are displayed on the chart:
Up Arrow and Down Arrow - histogram crossing the zero level from the bottom up and from top down. The signal should be interpreted as beginning of an up/down trend.
Icons "Buy" and "Sell" are formed when the histogram crosses the signal line, they are trend weakening signals, they can also be used as counter trend buy and sell signals.
A green or red check mark is formed when the histogram crosses the offset angle line. These are also trend weakening signals and they can be used as counter trend buy and sell signals.