Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Channels and their slope angle using least squares method - MetaTrader 4 script | Forex indicator download - MT4/MT5 resources

author EAcpu | 3 reads | 0 comments |

Channel and the angle of its inclination using the least squares method - indicator for MetaTrader 4

Channel and the angle of its inclination using the least squares method - indicator for MetaTrader 4

A line y = a x + b can be drawn through a set of points, and the distance from each point to the line will be approximately balanced.

Draw high and low lines which use the high and low sets of the MyPeriod period respectively.

If the CalculateDeflection parameter is enabled, two additional lines are placed on the chart - HighDeflection and LowDeflection. They show possible price changes (mean squared error). Hidden line B shows the values ​​of the free variables in the equation of the straight line.

MLS-HL4 - Angle Indicator A calculated value, in points, representing the angle of inclination of the obtained line relative to the horizon.
The indicator shows the value of the initial price b and the rate of change of angle p relative to the tangent line. If p > 0, the curve turns to the left, so the angle tends to be positive. However, if p < 0, then curve one tries to turn right and makes the angle tend to be negative

The MLS.zip archive contains mathematical calculations using the least squares method.

Channel and the angle of its inclination using the least squares method - indicator for MetaTrader 4


Attachment download

📎MLS-HL4-Angle.mq4 (4.67 KB)

📎 MLSOnGraphics.mq4 (5.97 KB)

Source: MQL5 #8704

Verification code Refresh