#property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Black #property indicator_color2 Green #property indicator_color3 Red //---- buffers double k[]; double g[]; double r[]; double m[]; double a[]; //int i; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- drawing settings SetIndexStyle(0,DRAW_NONE);//,0,2 SetIndexDrawBegin(0,0); SetIndexStyle(1,DRAW_HISTOGRAM);//,0,2 SetIndexDrawBegin(1,0); SetIndexLabel(1,NULL); SetIndexStyle(2,DRAW_HISTOGRAM);//,0,2 SetIndexDrawBegin(0,0); SetIndexLabel(2,NULL); short_name="kn("+14+","+14+")"; IndicatorShortName(short_name); SetIndexLabel(0,short_name); return(0); }//int init() //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); int i; if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; limit=Bars-counted_bars-1; for (i = limit;i>=0;i--) { if( iATR(NULL,0,14,i)!=0) { k[i]=iMomentum(NULL,0,14,0,i)/iATR(NULL,0,14,i); if (k[i+1]