Can you fix this code! - page 2

 
RaptorUK:
So why did you ask for help with the first code if it isn't what you are using ? are you deliberately trying to waste people's time ?


Oops... I asked you,the code i am using is correct? i dont know which is 100% correct.

I apologise RaptorOK, as am newbie/learner i struggle to get logic.

I really apologise you,if i wasted your time.

Meanwhile you are the one supported lot before always.

 
sheriffonline: since today not working. may be my logic will be wrong.
    threeAM=0; while( TimeHour(Time[threeAM]) != THREEAM ) threeAM++;
    High0To3 = High[iHighest(NULL,0,MODE_HIGH, THREEAM-ZEROAM+1,threeAM)];
This starts at the beginning of a new day. There for the index threeAM is yesterday 0300 (assuming a H1 chart.) Therefor High0To3 is the highest high from yesterday 00:00 through 03:59.
This code is bogus if A) Not H1 Chart B) you wanted today, C) you want 0000 to 0300 (not through)
 
WHRoeder:
This starts at the beginning of a new day. There for the index threeAM is yesterday 0300 (assuming a H1 chart.) Therefor High0To3 is the highest high from yesterday 00:00 through 03:59.
This code is bogus if A) Not H1 Chart B) you wanted today, C) you want 0000 to 0300 (not through)

Yes. i found it. problom fixed after i changed nday!=TimeDay(TimeCurrent())

but the main issues are not getting exact high/low value for 00-03 as you stated. i got this code from very old post. let me find exact code to get high/low for given time.

Once again thanks to let me catch the exact issue.

 
sheriffonline:

Yes. i found it. problom fixed after i changed nday!=TimeDay(TimeCurrent())

but the main issues are not getting exact high/low value for 00-03 as you stated. i got this code from very old post. let me find exact code to get high/low for given time.

https://www.mql5.com/en/forum/146214
Reason: