Hi all,
Anyone can help me how to code the sell order (long exit) with the content as follows:
sell at market if price is 50 points higher than MA200 and the candle is red?
Thanks
George
There you go:
Bearish = close < open
Avg = average]200,0](close)
Cond = Bearish AND (close >= (Avg + 50 * PipSize))
IF Cond AND LongOnMarket THEN
SELL AT MARKET
ENDIF
ma200=average[200](close)
cond1=close-ma200>50
cond2=close<open
if cond1 and cond2 then
sell at market
endif
Roberto solution is better because of the pipsize adjustment 🙂