Hi,
I know this sounds simple but what i am trying to achieve is to get the high of the first candle that crosses a moving average while monitoring price doesn’t go below a second moving average.
essentially i want to create a stop order at high of candle crossing moving average but cancels if price goes below second moving average.
snippet below of what i tried. not sure im on the right path though.
thanks for any help in advance
if low crosses under EMA1 then
entry = high
signal = 1
endif
if signal = 1 and close>EMA2 then
BUY 1 Contracts at signal STOP
endif
apologies second if should read as below
if signal = 1 and close>EMA2 then
BUY 1 Contracts at entry STOP
endif
That’s correct.
I suggest to add these lines BEFORE your above lines:
IF OnMarket THEN
Signal = 0
ENDIF