how to show candle time correctly when change corner attribute
Not tested but this should fix it.
int y=0; ObjectDelete("BarTimer1"); ObjectCreate("BarTimer1", OBJ_LABEL, 0, 0, 0); ObjectSet ("BarTimer1", OBJPROP_BACK, back); ObjectSet ("BarTimer1", OBJPROP_CORNER, corner); ObjectSet ("BarTimer1", OBJPROP_XDISTANCE, xdis); if(corner==CORNER_LEFT_UPPER || corner==CORNER_LEFT_UPPER) y=ydis; else y=ydis + 34; ObjectSet ("BarTimer1", OBJPROP_YDISTANCE, y); ObjectDelete("BarTimer5"); ObjectCreate("BarTimer5", OBJ_LABEL, 0, 0, 0); ObjectSet ("BarTimer5", OBJPROP_BACK, back); ObjectSet ("BarTimer5", OBJPROP_CORNER, corner); ObjectSet ("BarTimer5", OBJPROP_XDISTANCE, xdis); ObjectSet ("BarTimer5", OBJPROP_YDISTANCE, ydis + 17); ObjectDelete("BarTimer15"); ObjectCreate("BarTimer15", OBJ_LABEL, 0, 0, 0); ObjectSet ("BarTimer15", OBJPROP_BACK, back); ObjectSet ("BarTimer15", OBJPROP_CORNER, corner); ObjectSet ("BarTimer15", OBJPROP_XDISTANCE, xdis); if(corner==CORNER_LEFT_UPPER || corner==CORNER_LEFT_UPPER) y=ydis+34; else y=ydis; ObjectSet ("BarTimer15", OBJPROP_YDISTANCE, y);
Incidentally, why are you deleting and re-creating the objects?
You should create them once in OnInit() and then just set the text in OnTimer().
Not tested but this should fix it.
Incidentally, why are you deleting and re-creating the objects?
You should create them once in OnInit() and then just set the text in OnTimer().
it worked for 3 corner correctly but it didn't work for right upper...
it worked for 3 corner correctly but it didn't work for right upper...
My mistake the 2 instances of
if(corner==CORNER_LEFT_UPPER || corner==CORNER_LEFT_UPPER)
obviously should be
if(corner==CORNER_LEFT_UPPER || corner==CORNER_RIGHT_UPPER)
My mistake the 2 instances of
obviously should be
Thanks a lot it worked correctly
I should read codes more carefully
hi every one
I used below code for showing candle time, it shows candle time in 3 time frame like M1 00:12
M5 03:12
M15 10:12
I set corner for it, when I select 0 or 1 it worked correctly and changed candle time at top of page in left or right corner
but when I select 2,3 it changed position to the button of page left or right corner but it didn't show candle's time like above format it shows like M15 10:12
M5 03:12
M1 00:12
it changed M1 and M15 place I want when it changes position to button of page doesn't change M1 and M15 place ..
can any one help me?
Best Regards
Neda