The Moving Average Class – library MetaTrader 5

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

CSmooth class demo MQL5


๐Ÿ“ˆ ROBOTFX MetaTrader Expert Advisors and Indicators to maximize profits and minimize the risks