Problems with drawing lines

 

Sometimes I have problems with drawing lines. In some Timeframes the lines are shiftes and I can't understand why.

Can anybody see something wrong.?

OpenTime0=TimeCurrent() - (TimeCurrent()%(PERIOD_D1 * 60)) +StartHour*60*60+(60*StartMinute);
CloseTime0=TimeCurrent() - (TimeCurrent()%(PERIOD_D1 * 60)) +EndHour*60*60+(60*EndMinute);

datetime OpenTime1, datetime CloseTime1
int shift_close1 = iBarShift(NULL,PERIOD_M1,CloseTime1);
int shift_open1 = iBarShift(NULL,PERIOD_M1,OpenTime1);
...
ObjectCreate("High1", OBJ_TREND, 0, OpenTime1 , high1, CloseTime1, high1 );

 
In the code you posted what is the value of OpenTime1 and CloseTime1? What use is shift_open1?
 

Thank you, perhaps I was dreaming when I posted this code...

For searching about my problem I found this code

https://www.mql5.com/en/code/10178

there the function "CurTime()" is used.

From where is this CurTime() function? What is the difference zu TimeCurrent()??


I have the problems with drawing lines in many different cases, so it is actually difficult to post the right source.

Could it be, that a missing bar makes problems or ...? Has anybody from you sometimes wrong painted lines.

 

Here I found another question:

Is it better to program the calculation of the pivot times this way

ArrayCopyRates(Day_Price,(Symbol()), 1440);
 
   YesterdayHigh  = Day_Price[1][3];
   YesterdayLow   = Day_Price[1][2];
   YesterdayClose = Day_Price[1][4];
...

Then using the prices like

iHigh(Symbol(),PERIOD_D1,1) 
and so on!
 
sunshineh:

Thank you, perhaps I was dreaming when I posted this code...

For searching about my problem I found this code

https://www.mql5.com/en/code/10178

there the function "CurTime()" is used.

From where is this CurTime() function? What is the difference zu TimeCurrent()??

CurTime() is Obsolete . . it shouldn't be used any more.
 
sunshineh:

I have the problems with drawing lines in many different cases, so it is actually difficult to post the right source.

Could it be, that a missing bar makes problems or ...? Has anybody from you sometimes wrong painted lines.

Paste your code into a script that when run illustrates the issue, describe the issue, illustrate it with a chart grab . . . then post the code here and we can help.
Reason: