Synthetic VIX Indicator For MT5
Table Of Contents:
- Synthetic VIX Indicator For MT5
- Installing the Synthetic VIX Indicator For MT5
- Parameters of the Synthetic VIX Indicator For MT5
- Buffers of the Synthetic VIX Indicator For MT5
- Main Parts Of The Code
The Synthetic VIX Indicator For MT5 is based on the well know standard VIX indicator. The standard VIX indicator is limited to stock indices such as S&P 500, NASDAQ etc. The synthetic VIX has no limitations. It can be used on every trading instrument.
Installing the Synthetic VIX 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 Synthetic VIX.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 Synthetic VIX Indicator For MT5
The Synthetic VIX Indicator For MT5 has 1 parameters to configure.
input int inpVixPeriod = 20; // Synthetic VIX period
Buffers of the Synthetic VIX Indicator For MT5
The Synthetic VIX Indicator For MT5 provides 2 buffers.
SetIndexBuffer(0,val,INDICATOR_DATA); SetIndexBuffer(1,valc,INDICATOR_COLOR_INDEX);
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[]) { if(Bars(_Symbol,_Period) lt rates_total) return(prev_calculated); int i=(int)MathMax(prev_calculated-1,0); for(; i lt rates_total && !_StopFlag; i++) { int _start = MathMax(i-inpVixPeriod+1,0); double _highest = high[ArrayMaximum(high,_start,inpVixPeriod)]; val[i] = 100.0*(_highest-low[i])/_highest;; valc[i] = (i gt 0) ?(val[i] gt val[i-1]) ? 1 :(val[i] lt val[i-1]) ? 2 : valc[i-1]: 0; } return (i); }