Rollover dates can falsify a backtest, if you enter a position prior to rollover and exit that trade after rollover. In real life you would have to exit the position which you had entered in the old front month and then reenter the position by entering a similar position in the new front month contract. NinjaTrader will not exit and reenter the position for you during a backtest. The accuracy of the backtest will depend on the data that you use.
Non-merge-backadjusted contracts: These are actually the underlying contracts that you trade. This is not artificially created data but it is all real data from the exchange. If the market is in contango (positive rollover offset), the backtest will show a windfall gain for a long position that you hold during rollover. You will not be able to realize this gain in real trading, as you have to roll your position and enter at a higher price than the price, at which you exited the position.
Merge-backadjusted contracts: The rollover gap is eliminated from the data and your backtest should show the correct result. The only thing the backtest will not take into account is the spread and the slippage that you paid, when rolling your position. Also the spread between the old and the new contract maybe slightly different than the offset (spread at the close prior to rollover day) used for backadjusting your data.
The merge-backadjusted contract is the only contract, which will not falsify backtests. The price that you pay for getting your trades listed correctly, is that the absolute prices shown for the prior contracts are false. For example, if you have an indicator, which uses round levels to identify support and resistance, it is obvious, that it would give you false resulsts on backadjusted data.
My recommendation is that merge-backadjusted data should be used, if you backtest over a period of 1 to 3 years, and if there is no specific reason not to use it. Over longer periods there may be better options.
If you do not like, you can also do your backtest on single month contract data and then manually correct the trades held during rollover. If you do not hold any trades over night, then you do not need any backadjustment either, as only the trades are affected that are active during the rollover of the position.
The following 4 users say Thank You to Fat Tails for this post:
I have a question about how to backtest a continuous contract. I'm going to use the ES ##-## contract as an example.
Please assume that I have downloaded all of the available ES XX-XX specific contract data, and that I have imported the ES XX-XX contract into NT7 (i.e., ES 03-07), and I have also imported the ES XX-XX data into the ES ##-## contract by renaming the ES XX-XX contract file name to ES ##-##.txt and then importing into NT7 (i.e., changed ES 03-07.txt to ES ##-##.txt)--and after finishing the ES ##-## import changed the file name back to ES XX-XX (i.e., ES ##-##.txt to ES 03-07.txt). From my understanding, this is the recommended approach to creating a continuous contract (which I am open to critique!).
If one wanted to then run an optimized test period for purposes of then running a walk forward analysis after the initial test, do you know how does NT7's Strategy Analyzer's Optimizer treat this continuous contract data during rollover? How can we know that the optimized results are an accurate backtest?
ES ##-## is a continuous contract as supplied by your data provider. You have to contact your data provider to find out how it has been put together. I do not know whether it can be backtested.
I do not understand all that complicated stuff about renaming contracts from XX to ##. This does not make sense. There is nothing that should be renamed or tweaked.
If you want to do a backtest, please use single-month contracts and select the merge policy "MergeBackAdjusted". NinjaTrader will then build the data series from backadjusted contracts as needed for a backtest.
The following 3 users say Thank You to Fat Tails for this post: