#property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Black #property indicator_color2 Green #property indicator_color3 Red #property indicator_width1 2 #property indicator_width2 2 #property indicator_width3 2 double ma[]; double up[]; double dn[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { SetIndexBuffer(0,ma); SetIndexBuffer(1,up); SetIndexBuffer(2,dn); SetIndexStyle(0,DRAW_LINE,EMPTY); SetIndexStyle(1,DRAW_LINE,EMPTY); SetIndexStyle(2,DRAW_LINE,EMPTY); 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