Using a 5 min code starting at 11am – is there a way to code a trigger that buys when the high of 10-11am previous hour is achieved.
Many thanks for any help.
Like this (not tested):
if opentime = 100000 then
myhigh = high
endif
if time > 100000 and time <= 110000 then
myhigh = max(myhigh,high)
endif
if time >= 110000 then
buy 1 contract at myhigh stop
endif
Alternatively you can use MTF (not tested):
timeframe(1 hour)
if opentime = 100000 then
myhigh = high
endif
timeframe(5 minutes)
if time >= 110000 then
buy 1 contract at myhigh stop
endif