Hi, I want to backtest the following strategy for intraday 5 min candle timeframe. please guide me how to go about it. Buy: When close price is above 30 SMA Close this buy trade when current price above 1% of the buy price. Stop loss for buy trade is 30SMA Sell: When close price is below 30 SMA. Close this Sell trade when current price is below 1% of the sell price. Stop loss for sell trade is 30SMA. Thanks in advance. Nilesh
hElLO tRaDeR,
Tradescript recognizes only candlestick conditions to give you trade alerts for entry and exit.
There is no function in Tradescript language to define backtest conditions based on specific times of the day or creating an exit alert based on a percentage to your trade entry price.
BUY SCRIPT:
CLOSE > SMA(CLOSE,30)
SELL SCRIPT:
CLOSE < SMA(CLOSE,30)
Is it possible to get the BankNifty Closing Price and compare it along with the 30SMA of the stock price