Comment on Code your Technical Analysis strategy
Buy:
CLOSE > SMA (CLOSE, 10) AND REF (CLOSE, 1) < REF (SMA (CLOSE, 10), 1)
Sell:
CLOSE < SMA (CLOSE, 10) AND REF (CLOSE, 1) > REF (SMA (CLOSE, 10), 1)
What this does is will consider SMA on selected interval, not daily SMA.