Hour()
are you an idiot or you pretend to be one?
1Mill:
are you an idiot or you pretend to be one?
are you an idiot or you pretend to be one?
u right i'm an idiot
TimeHour()
int iBarShift( string symbol, int timeframe, datetime time, bool exact=false)
- find the 9 o'clock bar then store its open
for(int hrBar=0; TimeHour(iTime(NULL, PERIOD_H1, hrBar)) != 9; hrBar++){} double open9AM=iOpen(NULL,PERIOD_H1, hrBar);
- iBarShift(strToDate("9:00")) is more complicated and won't work if its earlier than 9AM. (OP wants the last 9AM)
wow thanks WHRoeder, you solved the problem! You are a true programmer!

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I would like to scan the last 24 hourly bars and find the 9 o'clock bar then store its open. Is there a function that return only the hour for each bar something like iTime(NULL,0,i)? How else can I solve the problem of finding the 9 o'clock bar?
Many thanks