How to backtest this strategy based on ATR Trail Stop Indicator

Hello, I wanted to backtest a strategy using the ATR Trailing Stop Indicator which is available on both Kite web and mobile (when used with ChartIQ).

Some of the conditions are as follows:

  • Enter a long position when ATR Trailing Stop indicator gives a buy signal. Enter a short position when the indicator gives a sell signal.
  • The time frame for backtesting is 30minute/Hourly/2H/4H/D (or larger timeframes) and it need not be intraday. The positions are carried overnight till the exit conditions are met.
  • Exit condition, is an indication for reversal of the position. The long positions are converted to short positions on vice versa.
  • The segment for which this backtesting is to be done is CDS and MCX.
  • Product type would be NRML and not MIS.

Questions

  1. Since currency derivatives and other commodity futures are not continuous data (except for crudeoil EOD prices), unable to even manually explore a longterm continuous data on charts. What could be the ideal place to find longterm prices of currency and commodities? Is there any index like charts or sources for continuous data for CDS and MCX contracts?
  2. Would a platform like Streak allow me to backtest this strategy which is not intraday? The positions are carried overnight or until an exit condition is met? And upon exit, the position is reversed.
  3. If backtesting is possible on a platform like @Streak, then would the deployment of the code be possible too? Since the positions could be held overnight, would streak allow the deployed code to be carried forward to the next day or until positions are held? Zerodha/Kite at the moment has no GTC order.

Looking forward to some help on this front.

Streak allows positional and swing strategies. But, Streak does not support ATR Trailing Stop Loss indicator currently. So, this cannot be implemented in Streak, currently.

Thanks for the response @Krishnendu . Would @Streak be adding support for the ATR Trailing Stop Indicator?

@Nishantr, I have already already added this to our list. This will be added in the future.

1 Like

Did you find any solution for backtesting your ATR based strategy? I am also looking to deploy a similar strategy on Nifty 50 with 1 hour time frame

1 Like

No. I haven’t found any platform where I can backtest the ATR Trailstop strategy as of today on currency and commodity futures.
Even manually I can’t do it on charts for hourly time frames as continuous futures data is available only for daily timeframe.

Okay, I did backtest on dailytime frame manually in excel as only 40 trades a year buy cant do same for hourly as number of trades will be much higher