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

LinearRegression - indicator for MetaTrader 5

author EAcpu | 3 reads | 0 comments |

LinearRegression - indicator for MetaTrader 5

When applied to financial markets, the method is often used to identify moments when prices deviate extremely from "standard" levels.

Creating trend lines using linear regression is based on the least squares method. This method assumes that a straight line is created through the price points so that the distance between the price points and the straight line is as short as possible. When trying to predict tomorrow's prices, it is reasonable to assume that they will be close to today's price values. If there is an upward trend, the best guess is that the price value will be close to the current price, but with some upward deviation. Regression analysis provided statistical confirmation of these hypotheses.

The indicator was first implemented in MQL4 and published in the code base of mql4.com on October 9, 2007.

LinearRegression - indicator for MetaTrader 5


Attachment download

📎 linearregression.mq5 (10.92 KB)

Source: MQL5 #765

Verification code Refresh