#property indicator_chart_window #property indicator_buffers 2 #property indicator_plots 1 #property indicator_type1 DRAW_COLOR_LINE //#property indicator_color1 clrBlue,clrRed #property indicator_width1 4 double Buffer[]; double BufferColor[]; input color InpColor1 = clrBlue; input color InpColor2 = clrRed; void OnInit() { SetIndexBuffer(0,Buffer,INDICATOR_DATA); SetIndexBuffer(1,BufferColor,INDICATOR_COLOR_INDEX); PlotIndexSetInteger(0,PLOT_LINE_COLOR,0,InpColor1); PlotIndexSetInteger(0,PLOT_LINE_COLOR,1,InpColor2); return; } int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[]) { for(int bar=0; barBuffer[rates_total-1]) BufferColor[bar]=0; else BufferColor[bar]=1; } return(rates_total); }