Time[0]; iTime(Symbol(), PERIOD_D1, 0); TimeCurrent(); TimeHour(TimeCurrent());
pick one
Hi qjol, thanks for the reply.
I've got Time[i] referring to the current time, my problem seems to be where I've specified an opening time, for Example, Sydney = "2:00", how do I call up that Sydney time as "Sydney *today*"... my indi seems to be referring to 2:00 yesterday, even though the Time[i] is past 2:00 today.
Trying to get the indi to refer to "sydney" most recent?
ho, you problem is in the logic of the code
the time in tokyo is an hour earlier from sydney
so, your if statement...
if(Time[i]>=StrToTime(sydney) && Time[i]<StrToTime(tokyo))
is always false
ho, you problem is in the logic of the code
the time in tokyo is an hour earlier from sydney
so, your if statement...
is always false
I've got the session times as external inputs:
extern string sydney = "2:00",
tokyo = "3:00",
frankfurt= "9:00",
london = "10:00",
newyork = "15:00";
So when Time[i] is 2:30 for example, it's true?
as you wish
if(TimeCurrent()>=StrToTime(sydney) && TimeCurrent()<StrToTime(tokyo))
or maybe
if(TimeLocal()>=StrToTime(sydney) && TimeLocal()<StrToTime(tokyo))
thanks qjol, I'll swtich Time[i] for TimeCurrent() and see how the indi performs today.
Thanks again for your help eh, a second or third time you've helped me out on mql4 forum.
as you wish
or maybe
Hi qjol,
It appears that the problem is in calling up:
iHigh(NULL,0,iBarShift(NULL,0,StrToTime(frankfurt)))
The price (frankfurt) is calling up yesterday's 9:00, not today's 9:00.
I'm wondering if there's a way for iBarShift to only look for "frankfurt" within the previous 8 hours or for it to look for the most "recent" occurrence of 9:00?

- 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 folks,
I've made a signal indi which works (sort of!), currently for the Australian Opening Range, my code is referring to the Opening Range price of *yesterday*...
Any ideas on how to get the code below to read the OR time/price *today*?