Find the maxium of the 4 15min bars of the previous day
Forums › ProRealTime English forum › ProBuilder support › 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 robertogozzi.
Viewing 5 posts - 1 through 5 (of 5 total)
-
-
10/13/2023 at 8:37 PM #222408
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)
endifHow it is done for the same time period but for the previous day?
Thanks in advance for your kind help!
John
10/14/2023 at 4:44 AM #222413There you go:
123456if OpenTime=171500 thenSessionHighPrev=SessionHighSessionLowPrev=SessionLowSessionHigh=Highest[4](high)SessionLow=Lowest[4](low)endifSessionHighPrev and SessionLowPrev will retain the previous day’s data.
1 user thanked author for this post.
10/14/2023 at 8:47 AM #222421It worked, thank you!
10/14/2023 at 8:59 AM #222422Hey again,
so I have this code:
if OpenTime=171500 thenSessionHighPrev=SessionHighSessionLowPrev=SessionLowSessionHigh=Highest[4](high)SessionLow=Lowest[4](low)endifreturn SessionHighPrevthat updates the line on the chart at 17:15.But I want the line to be updated on the chart at a different time, lets say at 09:00 in the morning. Note that I still want the line to be calculated at 17:15.I tried to put return inside an if statement but prorealcode doesn’t accept that.Can you help me please?
John
10/14/2023 at 12:28 PM #222434There you go:
123456789if OpenTime=090000 thenSessionHighPrev=SessionHighSessionLowPrev=SessionLowendifif OpenTime=171500 thenSessionHigh=Highest[4](high)SessionLow=Lowest[4](low)endifreturn SessionHighPrev1 user thanked author for this post.
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)