Coding help for linear regression / least square function

 

Hello everyone,

Thank you for helping. (i just started learning MQL5 few days ago)

I'm trying to find my way in the documentation, it is so big. Maybe you can help me with this.

I'm trying to make my own linreg(source, lenght) function. maybe you have some advices or you know if there is a least square function in MQL5 ?

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
//| Expert initialization function                                   | //| Expert deinitialization function                                 | //| Expert tick function                                             | //| test1                                                            |...
 
Happy: if there is a least square function in MQL5 ?
  1. In the language MQL5, no.

  2. Standard Library / Graphic Objects / Channel Objects / CChartObjectRegression - Reference on algorithmic/automated trading language for MetaTrader 5

  3. Or, make your own. Polynomial Regression Channel (PRC) == Center Of Gravity (COG)
              Fitting a parabola - MQL4 programming forum Not John Ehlers' Center of Gravity oscillator.
 
And you can search here for liner regression there exist already quite a lot of different solutions.