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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by algospoke, Today, 06:40 PM
    0 responses
    1 view
    0 likes
    Last Post algospoke  
    Started by maybeimnotrader, Today, 05:46 PM
    0 responses
    6 views
    0 likes
    Last Post maybeimnotrader  
    Started by quantismo, Today, 05:13 PM
    0 responses
    6 views
    0 likes
    Last Post quantismo  
    Started by AttiM, 02-14-2024, 05:20 PM
    8 responses
    167 views
    0 likes
    Last Post jeronymite  
    Started by cre8able, Today, 04:22 PM
    0 responses
    8 views
    0 likes
    Last Post cre8able  
    Working...
    X