Find the maxium of the 4 15min bars of the previous day
- 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)
Forums › ProRealTime English forum › ProBuilder support › Find the maxium of the 4 15min bars of the previous day
Hey,
I want to find the maximum of the 15 minute bars from 16:30 to 17:15 of the previous day. For the current day I am using this code:
if OpenTime=171500 then
SessionHigh=Highest[4](high)
SessionLow=Lowest[4](low)
endif
How it is done for the same time period but for the previous day?
Thanks in advance for your kind help!
John
There you go:
1 2 3 4 5 6 |
if OpenTime=171500 then SessionHighPrev=SessionHigh SessionLowPrev=SessionLow
SessionHigh=Highest[4](high)
SessionLow=Lowest[4](low)
endif |
SessionHighPrev and SessionLowPrev will retain the previous day’s data.
It worked, thank you!
Hey again,
so I have this code:
Can you help me please?
John
There you go:
1 2 3 4 5 6 7 8 9 |
if OpenTime=090000 then SessionHighPrev=SessionHigh SessionLowPrev=SessionLow endif if OpenTime=171500 then SessionHigh=Highest[4](high) SessionLow=Lowest[4](low) endif return SessionHighPrev |