Skip to content
All library documents

Linear Regression for Price Filtering and Smoothing

Article MQL5 code base

Summary

The document introduces linear regression as a way to model the relationship between an explanatory variable and an observed value. In its trading example, the independent variable is the number of bars and the dependent variable is price. It describes fitting a linear equation to the observations, though the displayed text omits the actual equation and coefficient formulas.

It presents an implementation intended to calculate regression values exactly for arbitrary data, with execution time described as nearly independent of the chosen period. The author suggests using the result for filtering, calculation, or smoothing, and mentions a color change as a possible signal. The text provides no formula details, code, chart, test results, or evidence for the signal’s performance, so it is best read as a brief description of an indicator implementation rather than a validated trading strategy.

Key ideas

  • Linear regression models one variable as a linear function of another.
  • The trading example relates bar count to price.
  • The described implementation claims exact calculations on arbitrary data with little dependence on the period length.
  • The indicator may be used for filtering, smoothing, or as a color-change signal.
  • The document omits formulas and performance evidence, limiting independent evaluation.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.