Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 4 Indicator | Linear Regression Line

Author: not specified.

MetaTrader Experts, Indicators, Scripts and Libraries

The mathematical formula expressing the linear regression looks the following way:
у = а + bx, where:
у - close price;
х - position of the current time period in the database;
а - 1/п (Ey - bEх);
b - (nExy - EхEу)/nEх2 - (Ex)2;
п - the number of time periods during the summation;
E - the sum for n periods.

The method of least squares is used for linear regressions in order to fit the line in the data set. The best line is found by minimizing the distance from the data points to this line.

7325

Best MetaTrader Indicators + Profitable Expert Advisors