Linear Regression Line – indicator MetaTrader 4

Author: not specified.


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.


πŸ“ˆ ROBOTFX MetaTrader Expert Advisors and Indicators to maximize profits and minimize the risks