Identify time to calculate Highest High & Lowest Low
- This topic has 4 replies, 2 voices, and was last updated 1 year ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
Similar topics:
Forums › ProRealTime English forum › ProBuilder support › Identify time to calculate Highest High & Lowest Low
I’m facing issue to define the time of calculation in the code.
I am implementing a code that calculates the highest high and lowest low of a specific period (form 01:00 am to 16:30 pm)
1 2 3 4 5 6 7 8 |
startime = 010000 endtime = 163000 // calculate highest high and lowest low of the last 15 hours , start calculation at 4:30 pm if time = endtime then HighestHigh = highest[15](Close) LowestLow = lowest[15](close) ENDIF |
The code is working good without the IF condition, but when I add IF condition to specify the time of calculation it is not working.
Your support and feedback is highly appreciated
Your code to scan the last 15 hours needs to be used on a 1-hour chart, but in this case endtime is wrong because it ends on a 30-minute boundary.
Try this one:
1 2 3 4 5 6 7 8 9 10 11 12 |
starttime = 010000 endtime = 163000 once HI = 0 once LO = 999999 if opentime = starttime then HI = high LO = low endif if (opentime > starttime) and (opentime <= endtime( then HI = max(HI,high) LO = min(LO,low) endif |
Modification :
Your code to scan the last 15 hours needs to be used on a 1-hour chart, but in this case endtime is wrong because it ends on a 30-minute boundary.
Try this one:
123456789101112 starttime = 010000endtime = 163000once HI = 0once LO = 999999if opentime = starttime thenHI= highLO= lowendifif (opentime > starttime) and (opentime <= endtime( thenHI= max(HI,high)LO= min(LO,low)endif
Thank you for your solution , I tried it but is doesn’t work too , I used 1 hour time frame already
HighestHigh = highest[14](close)
LowestLow = lowest[14](close)
You DON’T have to use 1-hour TF, as I already said, because the TF must be on a 30-minute boundary,
Find exclusive trading pro-tools on