#property indicator_chart_window //#property indicator_separate_window #property indicator_buffers 3 #property indicator_color3 Gold #property indicator_color1 Green #property indicator_color2 Red #property indicator_width1 2 #property indicator_width2 2 #property indicator_width3 1 double ma[]; double up[]; double dn[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { SetIndexBuffer(2,ma); SetIndexBuffer(0,up); SetIndexBuffer(1,dn); SetIndexStyle(2,DRAW_NONE); SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(int i=0; i