The CCHOOnArray class is intended for calculation of the Chaikin Volatility indicator (CHV) on indicator buffers.
The Init() method with the following parameters is called in the OnInit() function of the indicator:
The Solve() method with the following parameters is called in the OnCalculate() function:
The Test_CHVOnArray.mq5 file is an indicator demonstrating how to use the CCHVOnArray class. The IncCHVOnArray file must be located in the MQL5\Include\IncOnArray directory of the terminal data folder (the IncOnArray folder must be created).
Chaikin's volatility indicator calculates the spread between the maximum and minimum prices. It judges the value of volatility basing on the amplitude between the maximum and the minimum. Unlike Average True Range, Chaikin's indicator doesn't take gaps into account.
Translated from Russian by MetaQuotes Software Corp.
Original code: http://www.mql5.com/ru/code/671