Announcement

Collapse
No announcement yet.

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

    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    23 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    120 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X