Plotting of a trend line using linear regression is based on the least squares method. This method assumes that a straight line is plotted that passes through the price points so that the distance between the price points to the line is minimal. In an attempt to predict tomorrow prices, it is logical to assume that they will be located close to the values of today's prices. If there is an uptrend, the best guess would be that the price value will be close to the current one with a certain upward deviation. Regression analysis provides statistical confirmation of these assumptions.
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/7197
The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.Average Directional Movement Index (ADX)
The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.