• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Differance between market replay and backtesting.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • christophe
    started a topic Differance between market replay and backtesting.

    Differance between market replay and backtesting.

    Hi There,

    I have a little snippet of code for each of my strategy to start trading from 1 day before rollover until 1 day before the next rollover.
    This is too make sure I do not enter a trade too close to rollover time.

    Having this rule is causing differences in my back testing. Because the backtest seems to only trade the live contact on the rollover date.
    When testing a specific contact my back test contain one day less of trade than market replay.
    Eg : CL 01-17.
    Market replay from 16-01-2017 to 15-02-2017: Trades between: 17-01-2017 and 13-02-2017
    Back test from 16-01-2017 to 15-02-2017: Trades between : 19-01-2017 and 13-02-2017

    Using market replay is fine but takes time.

    Is their a snippet of code or a setting that I could use to disable the auto roll over in back test? (changing the rollover date wouldn't be good solution as it would then screw my market replay)

    Cheers,

    Chris

  • NinjaTrader_Jim
    replied
    Hello christophe,

    Thanks for your post.

    There will be some fundamental differences between how data is processed and how order fills are simulated between historical data and realtime data. Market Replay will mimic realtime data when backtesting uses traditional historical data. Backtests will also be forced to use CalcuilateOnBarClose = true;These discrepancies can have an effect on how the strategy behaves and when orders submit, so this would be an important item to also note.

    Historical data will be stitched together depending on your Merge Policy set in the Options menu of the Control Center. (Tools > Options > Data.) Changing when the contracts merge would have to be done by modifying the contract month's rollover date and there is not a code snippet that can I can offer to change this merging.

    Further reference on the discrepancies between historical and realtime data is publicly available and can be found here - https://ninjatrader.com/support/help...ime_vs_bac.htm

    Please let me know if I can be of further assistance.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by tgn55, Today, 08:34 AM
0 responses
1 view
0 likes
Last Post tgn55
by tgn55
 
Started by TazoTodua, Today, 06:00 AM
0 responses
7 views
0 likes
Last Post TazoTodua  
Started by gbux11, Today, 02:36 AM
0 responses
8 views
0 likes
Last Post gbux11
by gbux11
 
Started by fx.practic, Today, 01:47 AM
0 responses
14 views
0 likes
Last Post fx.practic  
Started by ckabjp, Yesterday, 09:40 PM
0 responses
0 views
0 likes
Last Post ckabjp
by ckabjp
 
Working...
X