//datetime var1=D'2008.08.05 23:00';
int shift=iBarShift(NULL,PERIOD_H1,var1);
double opening_price = iOpen(NULL,PERIOD_H1,shift);
...
Using TimeToStr function, i don't get the real iOpen on the chart, but, if i use the some specific time using: datetime var1=D'2008.08.05 18:00' i get the real one!
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello guys,
I tried to use this code.
int a =TimeCurrent();
a=a-(Minute()*60);
string var1=TimeToStr(a,TIME_DATE|TIME_MINUTES); // var1='2008.08.05 23:00'
//datetime var1=D'2008.08.05 23:00';
int shift=iBarShift(NULL,PERIOD_H1,var1);
double opening_price = iOpen(NULL,PERIOD_H1,shift);
...
Using TimeToStr function, i don't get the real iOpen on the chart, but, if i use the some specific time using: datetime var1=D'2008.08.05 18:00' i get the real one!
Can anyone help me with this.
Where is my mistake?
Many thanks in advance.