#property indicator_chart_window //---- input parameters extern color col_00 = White; extern color col_04 = Red; extern color col_08 = Blue; extern color col_12 = Green; extern color col_16 = Yellow; extern color col_20 = Purple; extern int maxbars=100; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { } //+------------------------------------------------------------------+ void ibbd(string objn, datetime t1, double p1, datetime t2, double p2, color boxcolor) { if (ObjectFind(objn)>=0) { ObjectDelete(objn); } ObjectCreate(objn, OBJ_RECTANGLE, 0, t1, p1, t2, p2); ObjectSet(objn, OBJPROP_STYLE, STYLE_SOLID); ObjectSet(objn, OBJPROP_COLOR, boxcolor); ObjectSet(objn, OBJPROP_BACK, TRUE); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { color barcolor=col_00; for(int i = 0; i="00") { barcolor=col_00; } if (t0>="04") { barcolor=col_04; } if (t0>="08") { barcolor=col_08; } if (t0>="12") { barcolor=col_12; } if (t0>="16") { barcolor=col_16; } if (t0>="20") { barcolor=col_20; } datetime t1=iTime(Symbol(),Period(),i); datetime t2=iTime(Symbol(),Period(),i+1); double p1=iHigh(Symbol(),Period(),i); double p2=iLow(Symbol(),Period(),i); ibbd("bcol-"+DoubleToStr(i,0), t1, p1, t2, p2, barcolor); } return(0); } //+------------------------------------------------------------------+