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:
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.
Hey again,
so I have this code:
if OpenTime=171500 then
SessionHighPrev=SessionHigh
SessionLowPrev=SessionLow
SessionHigh=Highest[4](high)
SessionLow=Lowest[4](low)
endif
return SessionHighPrev
that 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
There you go:
if OpenTime=090000 then
SessionHighPrev=SessionHigh
SessionLowPrev=SessionLow
endif
if OpenTime=171500 then
SessionHigh=Highest[4](high)
SessionLow=Lowest[4](low)
endif
return SessionHighPrev