Choppiness Index Indicator For MT5
Table Of Contents:
- Choppiness Index Indicator For MT5
- Installing the Choppiness Index Indicator For MT5
- Parameters of the Choppiness Index Indicator For MT5
- Buffers of the Choppiness Index Indicator For MT5
- Main Parts Of The Code
The Choppiness Index Indicator For MT5 was developed by E.W. Dreiss and is based on the fractal geometry in combination with the chaos theory. As a result this indicator draws an oscillator on an indicator subwindow that shows higher values if the market is without clear direction and shows choppy price action.
Installing the Choppiness Index 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 Choppiness index.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 Choppiness Index Indicator For MT5
The Choppiness Index Indicator For MT5 has 1 parameters to configure.
input int inpChoPeriod = 14; // Choppiness index period
Buffers of the Choppiness Index Indicator For MT5
The Choppiness Index Indicator For MT5 provides 1 buffers.
SetIndexBuffer(0,csi,INDICATOR_DATA);
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& tick_volume[], const long& volume[], const int& spread[]) { double _log = MathLog(inpChoPeriod)/100.00; for (int i=(int)MathMax(prev_calculated-1,0); i lt rates_total; i++) { double atrSum = 0.00; double maxHig = high[i]; double minLow = low[i]; for (int k = 0; k lt inpChoPeriod && (i-k-1) gt =0; k++) { atrSum += MathMax(high[i-k],close[i-k-1])-MathMin(low[i-k],close[i-k-1]); maxHig = MathMax(maxHig,MathMax(high[i-k],close[i-k-1])); minLow = MathMin(minLow,MathMin( low[i-k],close[i-k-1])); } csi[i] = (maxHig!=minLow) ? MathLog(atrSum/(maxHig-minLow))/_log : 0; } return(rates_total); }