Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

Metatrader 5 Libraries | The Moving Average Class | Source Code Included

RobotFX curates the best open-source MetaTrader code to inspire your trading automation.

Uses the idea of ​​the classical moving average smoothing. The class can be used when you want to smooth out any array of type double without using the standard indicator.

The class sample requires the following:

  • Fill in the array double in_mas[];
  • Set the values of the variables int in_period (smoothing period), int in_dim (array size);
  • Perform the procedure ini() to initialize the arrays;
  • Perform the procedure void zap_mas2(), which forms a smoothed array double out_mas[].

An example of using the class is available in the indicator line.mq5

Reduce lag and improve accuracy with the NonLagMA Expert Advisor for MT4/MT5. Discover it.

CSmooth class demo MQL5

Build better strategies with RobotFX professional tools – check them out.

2210

Best MetaTrader Indicators + Profitable Expert Advisors