Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Discrepancy between backtesting and playback

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

    Discrepancy between backtesting and playback

    Hello,

    I had a custom strategy made by a coder. When I run a backtest on high order fill resolution of 1 tick vs playback, the trades made are different. In the attached picture, the backtest is on the right with the playback on the left. What accounts for this difference? I want the trades during playback/live data to run like they do during backtesting. How would I do this?
    Last edited by burmaz; 10-18-2020, 09:07 PM.

    #2
    Hello burmaz,

    Thank you for your post.

    Trades made when using real-time data or Playback cannot run the same as trades made using Historical data (backtesting). You should expect that a strategy running real-time (Live, Playback) will produce different results than the performance results generated during a backtest.

    When backtesting, the fill price of an order is based on the OHLC of a bar and the price of the order itself since that is the only information that is known during a backtest.

    When using real-time market data or Playback, the fill price is based on incoming market data and volume, and you may receive better or worse fill prices depending on where the bid or ask price is and what volume is available at this market price. During real-time live brokerage trading, orders are filled according to market dynamics.

    This is why you may see orders not fill in real-time that you may otherwise expect to see filled based on your backtesting results.

    Here is a NinjaTrader Help Guide link with information about discrepancies between realtime and historical data — https://ninjatrader.com/support/help...ime_vs_bac.htm

    Also, here is a Help Guide link with information about High Order Fill resolution - https://ninjatrader.com/support/help...FillResolution

    Please let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Irukandji, Today, 04:58 AM
    0 responses
    2 views
    0 likes
    Last Post Irukandji  
    Started by fitspressoburnfat, Today, 04:25 AM
    0 responses
    2 views
    0 likes
    Last Post fitspressoburnfat  
    Started by Skifree, Today, 03:41 AM
    1 response
    4 views
    0 likes
    Last Post Skifree
    by Skifree
     
    Started by usazencort, Today, 01:16 AM
    0 responses
    1 view
    0 likes
    Last Post usazencort  
    Started by kaywai, 09-01-2023, 08:44 PM
    5 responses
    604 views
    0 likes
    Last Post NinjaTrader_Jason  
    Working...
    X