Trading Q&A by Zerodha - All your queries on trading and markets answered
I want code for backtest and my strategy is as below "buy signal when closing price croses above 50SMA line and sell signal when price fall below 50SMA line"
Algos, strategies, code
AlgoGeek
October 21, 2015, 12:42pm
2
As per the above condition
Buy Script:
CLOSE > SMA(CLOSE,50)
Sell Script:
CLOSE < SMA(CLOSE,50)