if (iTime( NULL, PERIOD_M30, 1) = H'01:30') .......
iTime returns a datetime integer, not a text string, so the comparison may not be valid
What you wrote could be properly restated as
if(TimeHour(iTime( NULL, PERIOD_M30, 1) ) == 1 && TimeMinute(iTime( NULL, PERIOD_M30, 1) ) == 30) .......
Now I see this page: https://docs.mql4.com/basis/types/datetime
Maybe
if (iTime( NULL, PERIOD_M30, 1) = D'01:30') .......
would work
if (iTime( NULL, PERIOD_M30, 1) = H'01:30') .......
iTime returns a datetime integer, not a text string, so the comparison may not be valid
What you wrote could be properly restated as
if(TimeHour(iTime( NULL, PERIOD_M30, 1) ) == 1 && TimeMinute(iTime( NULL, PERIOD_M30, 1) ) == 30) .......
Now I see this page: https://docs.mql4.com/basis/types/datetime
Maybe
if (iTime( NULL, PERIOD_M30, 1) = D'01:30') .......
would work
Thank You very much.
I'll Check it.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all
I'm trying to get the close time (or open time) of the last closed bar (in 30m graph)
I'm using the iTIME function and it doesnt work :
if (iTime( NULL, PERIOD_M30, 1) = H'01:30') .......
any other way to get this information ??
thank you