• 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

    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 Italianforex, Today, 06:20 AM
    0 responses
    2 views
    0 likes
    Last Post Italianforex  
    Started by NinjaCustomer, Today, 04:53 AM
    0 responses
    4 views
    0 likes
    Last Post NinjaCustomer  
    Started by Oferedry, Today, 01:56 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by NinjaCustomer, Today, 01:28 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by xbionicx, Today, 01:12 AM
    0 responses
    3 views
    0 likes
    Last Post xbionicx  
    Working...
    X