Hi Guys..
I'm trying to code an indicator to show Open of the current Day on the window and I want to see it changes when day changes.. I wrote this indicator (and I'm still not sure that its right ), but it seems it doesn't change when day changes. can someone help me to solve this problem. thanks.
I'm trying to code an indicator to show Open of the current Day on the window and I want to see it changes when day changes.. I wrote this indicator (and I'm still not sure that its right ), but it seems it doesn't change when day changes. can someone help me to solve this problem. thanks.
Inserted Code
#property indicator_chart_window extern datetime FirstTime=D'1:00'; double DayOpen=iOpen(NULL,0,iBarShift(NULL,0,FirstTime)); int init() { ObjectCreate("OP", OBJ_LABEL, 0, 0, 0, 0, 0); ObjectSet("OP", OBJPROP_CORNER, 0); ObjectSet("OP", OBJPROP_YDISTANCE, 15); ObjectSet("OP", OBJPROP_XDISTANCE, 200); ObjectSetText("OP", " ",5, "Arial", CLR_NONE); return(0); } int deinit() { ObjectDelete("OP"); return(0); } int start() { ObjectCreate("O", OBJ_LABEL, 0, 0, 0, 0, 0); ObjectSet("O", OBJPROP_CORNER, 0); ObjectSet("O", OBJPROP_YDISTANCE, 20); ObjectSet("O", OBJPROP_XDISTANCE, 5); ObjectSetText("O", "Open Price of The Day =",12, "Arial", clrAqua); ObjectSetText("OP", DoubleToStr(DayOpen, 4), 20, "Arial Bold", clrRed); return(0); }