Need some help - finf the closing time of the last bar

 

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

 

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

 
phy:

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.

Reason: