Dear all.
im fairly new to this but im trying to code an opening range breakout strategy. I use the South Africa Top 40 and the opening range is during the 08h30 and 09h00.
i use the following code to establish the opening range highs and lows:
if time<=090000 and time>083000 then
maxi= highest[6] (high)
graph maxi as “maxi”
mini= lowest [6] (low)
graph mini as “mini” //i graph only to check if the code is accute when compared to the graphs
ORANGE = Maxi-mini//opening range
LTL = maxi+Orange*fudge1/100//Long trade line (LTL) with a margin of safety factor defined as fudge1 for long trades
STL = mini-Orange*fudge2/100//Short trade line (STL) with a margin of safety factor defined as fudge2 for short trades
ENDIF
My problem is that when I look at the system indicators that i graph for LTL and STL it seems as if the code starts calculating these values from 08h15 as opposed to 08h30. I attach a screenshot indicating how the above code which is only supposed to start looking for highs and lows at the specified times starts to allocate high and low values at 08h15.
Has anyone else encountered this. I have gone through my code so many times, inserted checks to see what could cause it but to no avail. Any ideas?
regards,
Wicus