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.

Attachment download
📎 linearregression.mq5 (10.92 KB)
Source: MQL5 #765
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •