Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I'm puzzled by how NT 7 handles rollovers
Lets say I want to optimize my strategy using dates 3/1/2012 through 8/16/2012
This date range spans the ES0612 and ES0912 Contracts
So on June 6,7, 8, 9, 10, 11, 12, 13, and 14 -- Which contract does the strategy analyzer use to calculate results?
ES0612 or ES0912
Thanks in advance for your help
Can you help answer these questions from other members on NexusFi?
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.
Broker: Mirus (Broker), Continuum (Data), Dorman (Clearing)
Trading: Futures
Posts: 202 since Mar 2013
Thanks Given: 428
Thanks Received: 202
Fat Tails--
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.