Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Differance between market replay and backtesting.

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

    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

    #2
    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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    61 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    40 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    21 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    23 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    51 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X