#property link "http://www.forexfactory.com/showthread.php?t=590623" #property version "1.0" #property description "HOLO" #property strict #property indicator_chart_window double CurrentDayHigh = 0, CurrentDayLow = 0, HighestTodayOpen = 0, LowestTodayOpen = 0; int ShiftLowest = 0, ShiftHighest = 0; int OnInit() { return(INIT_SUCCEEDED); } int deinit() { ObjectDelete("HO"); ObjectDelete("LO"); return (0); } int start() { HighestTodayOpen = iOpen(Symbol(),PERIOD_H1,0); LowestTodayOpen = iOpen(Symbol(),PERIOD_H1,0); CurrentDayHigh = iHigh(Symbol(),PERIOD_D1,0); CurrentDayLow = iLow(Symbol(),PERIOD_D1,0); int i = 0; for (i=Hour(); i>=0; i--) { datetime currentH1Time = iTime(Symbol(),PERIOD_H1,i); double openH1Price = iOpen(Symbol(),PERIOD_H1,i); if(HighestTodayOpen < openH1Price) HighestTodayOpen = openH1Price; if(LowestTodayOpen > openH1Price) LowestTodayOpen = openH1Price; } ShiftLowest = iLowest(Symbol(),PERIOD_H1,MODE_LOW,Hour()); ShiftHighest = iHighest(Symbol(),PERIOD_H1,MODE_HIGH,Hour()); DrawRectangle("HO",iTime(Symbol(),PERIOD_H1,ShiftHighest),CurrentDayHigh,Time[0],HighestTodayOpen,clrBisque); DrawRectangle("LO",iTime(Symbol(),PERIOD_H1,ShiftLowest),CurrentDayLow,Time[0],LowestTodayOpen,clrBisque); return (0); } void DrawRectangle(string name, datetime pTime1, double pPrice1, datetime pTime2, double pPrice2, color Col) { if(ObjectFind(name) != 0) { ObjectCreate(name,OBJ_RECTANGLE,0,pTime1,pPrice1,pTime2,pPrice2); ObjectSet(name,OBJPROP_COLOR,Col); ObjectSet(name,OBJPROP_BACK,true); ObjectSetText(name,name); } else { ObjectDelete(name); ObjectCreate(name,OBJ_RECTANGLE,0,pTime1,pPrice1,pTime2,pPrice2); ObjectSet(name,OBJPROP_COLOR,Col); ObjectSet(name,OBJPROP_BACK,true); ObjectSetText(name,name); } }