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

Historical Order Backfill Logic

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

    Historical Order Backfill Logic

    Could someone please tell me exactly what the historical order backfill logic is?

    I have read https://ninjatrader.com/support/help...fill_logic.htm and https://ninjatrader.com/support/help...ical_fill_.htm and neither one was adequate. The first page describes an algorithm that seems to rely on tick data as it describes bar formation, but I don't even have access to that so that can't be what is happening. The second page describes how three bars are created from high/low/open/close data but not how those bars are used to arrive at the final price. Are the bars that are created in the second explanation used sequentially in the first?

    I could really use some clarity. If possible, I'd like to have the have actual code to look at. Thanks in advance.

    #2
    Hello thisolduser,

    Thanks for your post.

    The Historical Order Backfill Logic is not open source and available to the public or to the Support Department so this is not something we are able to share with you.

    NinjaTrader uses advanced historical fill processing methods and techniques to get the most realistic results possible on historical backtests.

    All order fill simulations for historical data use the underlying data series. So you are using OHLC values of a bar to simulate where the order may have filled. This is not fully accurate, but gives you a rough idea for where the order was filled and is very efficient.​​

    Historical processing refers to when the strategy processes historical data. When a strategy is enabled, it processes historical data to identify which trades have been made by that strategy. This determines the strategy position (not to be confused with the actual account position.)

    The virtual bars are created based on the proximity of the Open price to the High and Low prices. This provides more realistic intra-bar fills compared to traditional backtesting algorithms which only use static OHLC values.

    Historical Fill Processing is different than processing strategy logic intrabar. NinjaTrader uses the underlying data series to create the order fill simulation, unless the strategy uses High Order Fill Resolution to simulate order fills on a smaller data series. It is meant to give you an idea on where the order would fill depending on the data series used to simulate the order fill. (Using 1 tick will give a more accurate order fill since the exact market price at the time will be known.)

    Historical processing for strategy logic is also forced to calculate on bar closes, unless Tick Replay is used. Tick Replay is also not compatible with High Order Fill Resolution, and the orders must be submitted to a smaller data series in the strategy's logic. So if you are using Tick Replay with the strategy, it would be useful to implement intrabar granularity for order fill simulations so your backtest fills look consistent with the order submission.

    High Order Fill Resolution submits orders to another data series. You can get more accurate fills this way, but this is not compatible with Tick Replay. If you want to use Tick Replay and have your orders filled against a single tick data series, that data series will need to be added to the script and the strategy will have to submit orders to the single tick data series.

    Developing for Tick Replay - https://ninjatrader.com/support/help...ick_replay.htm

    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,986 views
    0 likes
    Last Post rene69851  
    Started by Fitspressorest, Today, 01:38 PM
    0 responses
    2 views
    0 likes
    Last Post Fitspressorest  
    Started by Jonker, Today, 01:19 PM
    0 responses
    2 views
    0 likes
    Last Post Jonker
    by Jonker
     
    Started by futtrader, Today, 01:16 PM
    0 responses
    8 views
    0 likes
    Last Post futtrader  
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,792 views
    0 likes
    Last Post aligator  
    Working...
    X