Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

votes: 31
2012.01.16 12:20
2017.09.06 10:15

CStdDevOnArray class is designed for calculation of Standard Deviation (StdDev) on indicator buffers.


Init() method with the following parameters is called in the OnInit() function:

  • int aPeriod - indicator period;
  • ENUM_MA_METHOD aMethod - MA method.

Solve() method with the following parameters is called in the OnCalculate() function:

  • const int aRatesTotal is a rates_total variable from the OnCalculate() function parameters;
  • const int aPrevCalc - prev_calculated variable from the OnCalculate() function;
  • double & aData[] - Close data buffer for the indicator calculation;
  • double & aMA[] - intermediate buffer for the average value calculation;
  • double & aStdDev[] - the buffer with the indicator calculated value.

Test_StdDevOnArray.mq5 is a sample indicator showing CStdDevOnArray class application. IncStdDevOnArray file must be placed to MQL5\Include\IncOnArray of the terminal data folder (IncOnArray folder must be created).

CMAOnArray class from the IncMAOnArray file is needed for the proper work. It can be found here.

Standard Deviation is a value of the market volatility measurement. This indicator describes the range of price fluctuations relative to Moving Average.

Example of use of CStdDevOnArray

Translated from Russian by MetaQuotes Software Corp.
Original code:

LeMan Objective LeMan Objective

The indicator shows possible targets of price movement. It calculates the distance from the market entry price to the highs and lows displaying the quartiles deviation.

BykovTrend_HTF_Signal BykovTrend_HTF_Signal

BykovTrend_HTF_Signal shows a trend direction or a signal for performing a deal generated by BykovTrend indicator as a graphic object with colored trend indication or deal direction.

IncIchimokuOnArray IncIchimokuOnArray

The CIchimokuOnArray class is intended for calculation of Ichimoku (Ichimoku Kinko Hyo) values on indicator buffers.

IncBandsOnArray IncBandsOnArray

The CBandsOnArray is intended for calculation of the Bollinger Bands ® (BB) on an indicator buffer.