Comment on Code your Technical Analysis strategy
Buy alert:
REF (CLOSE, 1) > REF (SMA (CLOSE, 21), 1) AND REF (CLOSE, 2) < REF (SMA (CLOSE, 21), 2) AND CLOSE > REF (CLOSE, 1)
Buy exit:
This won’t be possible unless we define how many candles after, the low should be breached, which is not possible to predict.
Sell alert:
REF (CLOSE, 1) < REF (SMA (CLOSE, 21), 1) AND REF (CLOSE, 2) > REF (SMA (CLOSE, 21), 2) AND CLOSE < REF (CLOSE, 1)
Sell exit:
This won’t be possible unless we define how many candles after, the high should be breached, which is not possible to predict.