Chaikin Oscillator CHO Indicator For MT5
Table Of Contents:
- Chaikin Oscillator CHO Indicator For MT5
- Installing the Chaikin Oscillator CHO Indicator For MT5
- Parameters of the Chaikin Oscillator CHO Indicator For MT5
- Buffers of the Chaikin Oscillator CHO Indicator For MT5
- Main Parts Of The Code
The Chaikin Oscillator CHO Indicator For MT5 is based on the Accumulation Distribution indicator and the Exponential Moving Average. The EMA algorithm is aplied on the values of the AD indicator. To calculate the value of the Chaikin Oscillator the EMA with period 3 and the EMA with period 10 of the AD indicator is calculated. The difference between the EMA(3) and the EMA(10) is the value that is drawn on the histogram. Because volume is part of the AD indicator also the Chaikin Oscillator derives it values from volume and can therefore be a leading indicator.
Installing the Chaikin Oscillator CHO Indicator For MT5
After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file cho.mq5 into the folder MQL5\Indicators of your MT5 installation. After that please restart MT5 and then you will be able to see the indicator in the list of indicators.
Parameters of the Chaikin Oscillator CHO Indicator For MT5
The Chaikin Oscillator CHO Indicator For MT5 has 4 parameters to configure.
input int InpFastMA=3; // Fast MA period input int InpSlowMA=10; // Slow MA period input ENUM_MA_METHOD InpSmoothMethod=MODE_EMA; // MA method input ENUM_APPLIED_VOLUME InpVolumeType=VOLUME_TICK; // Volumes
Buffers of the Chaikin Oscillator CHO Indicator For MT5
The Chaikin Oscillator CHO Indicator For MT5 provides 4 buffers.
SetIndexBuffer(0,ExtCHOBuffer,INDICATOR_DATA); SetIndexBuffer(1,ExtFastEMABuffer,INDICATOR_CALCULATIONS); SetIndexBuffer(2,ExtSlowEMABuffer,INDICATOR_CALCULATIONS); SetIndexBuffer(3,ExtADBuffer,INDICATOR_CALCULATIONS);
Main Parts Of The Code
int OnCalculate(const int rates_total, const int prev_calculated, const datetime &Time[], const double &Open[], const double &High[], const double &Low[], const double &Close[], const long &TickVolume[], const long &Volume[], const int &Spread[]) { int i,limit; //--- check for rates total if(rates_total lt InpSlowMA) return(0); // not enough bars for calculation //--- preliminary calculations if(prev_calculated lt 1) { limit=1; //--- first values if(InpVolumeType==VOLUME_TICK) ExtADBuffer[0]=AD(High[0],Low[0],Close[0],TickVolume[0]); else ExtADBuffer[0]=AD(High[0],Low[0],Close[0],Volume[0]); ExtSlowEMABuffer[0]=ExtADBuffer[0]; ExtFastEMABuffer[0]=ExtADBuffer[0]; } else limit=prev_calculated-1; //--- calculate AD buffer if(InpVolumeType==VOLUME_TICK) { for(i=limit;i lt rates_total && !IsStopped();i++) ExtADBuffer[i]=ExtADBuffer[i-1]+AD(High[i],Low[i],Close[i],TickVolume[i]); } else { for(i=limit;i lt rates_total && !IsStopped();i++) ExtADBuffer[i]=ExtADBuffer[i-1]+AD(High[i],Low[i],Close[i],Volume[i]); } //--- calculate EMA on array ExtADBuffer AverageOnArray(InpSmoothMethod,rates_total,prev_calculated,0,InpSlowMA,ExtADBuffer,ExtSlowEMABuffer,weightslow); AverageOnArray(InpSmoothMethod,rates_total,prev_calculated,0,InpFastMA,ExtADBuffer,ExtFastEMABuffer,weightfast); //--- calculate chaikin oscillator for(i=limit;i lt rates_total && !IsStopped();i++) ExtCHOBuffer[i]=ExtFastEMABuffer[i]-ExtSlowEMABuffer[i]; //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+