kayakkal_normalized_volatility.mq4
kayakkal_normalized_volatility.mq4 FOREX MetaTrader4 Indicators Download
kayakkal_normalized_volatility.mq4 download link will appear after 10 seconds.
kayakkal_normalized_volatility.mq4 Programming source code
#property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 DeepSkyBlue #property indicator_color2 Red #property indicator_color3 Green #property indicator_width1 2 // // // // // extern int AtrPeriod = 64; extern int ShortAveragePeriod = 50; extern int LongAveragePeriod = 200; // // // // // double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer(1,ExtMapBuffer2); SetIndexBuffer(2,ExtMapBuffer3); return(0); } int deinit() { return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); int i,limit; if (counted_bars<0) return(-1); if (counted_bars>0) counted_bars--; limit = MathMin(Bars-counted_bars,Bars-1); // // // // // for (i=limit; i>=0; i--) ExtMapBuffer1[i] = 100.0*iATR(NULL,0,AtrPeriod,i)/Close[i]; for (i=limit; i>=0; i--) { ExtMapBuffer2[i] = iMAOnArray(ExtMapBuffer1,0,ShortAveragePeriod,0,MODE_SMA,i); ExtMapBuffer3[i] = iMAOnArray(ExtMapBuffer1,0,LongAveragePeriod,0,MODE_SMA,i); } return(0); }