MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Source code library - Expert Advisors, Indicators and Scripts

Screenshot
USDCHF, D1
Demo
Subscribe to signal
Trend Rhythm cross pairs REAL LIVE
34.38%, 2 577.96 USD
IncGUI_ColorInput Library
IncGUI_ColorInput
Author: Integer
How to Test a Trading Robot Before Buying How to Test a Trading Robot Before Buying Best of the Best DemoBest of the Best Demo Try product
Best of the Best Demo
Author: joo
To post a new code, please log in or register

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

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

2012.01.19 15:46
IncCHVOnArray

IncCHVOnArray [ru]

Integer

Downloads:
280
Views:
285
Rating:
votes: 2
Files:
\MQL5\Include\IncOnArray\\MQL5\Indicators\

Description:

The CCHOOnArray class is intended for calculation of the Chaikin Volatility indicator (CHV) on indicator buffers.

Usage:

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

  • int aVPeriod is a main period of the indicator;
  • int aSmPeriod is a period of smoothing of the range;
  • ENUM_MA_METHOD aMethod is a method of smoothing of the range.

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

  • const int aRatesTotal is the rates_total variable from the OnCalculate() function parameters;
  • const int aPrevCalc is the prev_calculated variable from the OnCalculate() function parameters;
  • double aDataHigh[] is the buffer with the High data for the indicator calculation;
  • double aDataLow[] is the buffer with the Low data for the indicator calculation;
  • double & aR[], is an intermediate auxiliary buffer;
  • double & aRS[] is an intermediate auxiliary buffer;
  • double & aCHV[] is the buffer with calculated values.

Additional methods:

  • string BarsRequired() returns the minimum number of bars required for the indicator calculation;
  • string Name() returns a string with the indicator name.

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.

Image:

An example of using the CCHVOnArray class

Translated from Russian by MetaQuotes Software Corp.
Original code: http://www.mql5.com/ru/code/671