Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market entry order not filled in backtest on daily bars

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

    #16
    Hello Brandon,

    Thanks for your answer and the sample code with the Unmanaged Approach. This is very helpfull.

    I'm still trying to understand why the managed approach has issues with historical overfills in the Strategy Analyzer on some bars but not others.
    • What is the rule for when an historical overfill will occur with the managed approach?
    • How is the same situation handled in the unmanaged approach when the property ignore overfill = false?
    ​​​​​​​/Poseidon_sthlm

    Comment


      #17
      Hello poseidon_sthlm,

      Thanks for your notes.

      Unmanaged allows you to have full control over OCO and Overfilled orders, but removes the framework of the Managed Approach.

      This means that the Unmanaged approach does not follow the same rules that the Managed Approach has built into its framework.

      Overfills describe an occurrence where an order is filled or partially filled after the order was already marked for cancellation. The way these occurrences happen is subjective to the strategy logic and execution. Our help guide has the following explanations which may shed more light:

      Overfills is a serious issue that can occur when using complex entry conditions that bracket the market in both directions end up with both entries being filled instead of one being cancelled. Over-Fills can also occur when you place a trade quickly hoping to close a position while a prior order to close the same position already had an in-flight execution. The exact scenarios in which an over-fill can occur is highly dependent on the specific strategy programming. By default, NinjaTrader will protect against over-fills even though you are using the Unmanaged approach by halting the strategy, but should you decide to custom program your own over-fill handling it is up to you to either prevent over-fills from being a possibility in your code or by introducing logic to address over-fills should one occur.

      Critical considerations when using Unmanaged order methods: https://ninjatrader.com/support/help...d_approach.htm

      Overfill handling would be done with realtime processing. They are typically seen involving in flight executions where a cancel is submitted and the order is filled or part filled after the cancel was submitted. This makes them harder to encounter on Playback/Sim because there is so little time between an order/cancel submission and the amount of time it take stop simulate the order fill/cancellation. (The orders/cancels do not have as much latency where overfills may be encountered.)

      The recommended resolution is to try to create scenarios that had caused an Overfill in the Market Replay/Playback connection to reproduce the over fill to troubleshoot how you can manage the cancellation of your orders.

      Overfills caused by a pending in-flight execution may be harder to reproduce. For example, quickly attempting to close a position while a pending order at the broker already closes the position will not be as easy to reproduce locally. These sorts of scenarios should be minded while writing the strategy.​

      See this forum thread post for more information: https://forum.ninjatrader.com/forum/...1125790​

      Order Methods: https://ninjatrader.com/support/help...er_methods.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


        #18
        Hello Brandon,

        Thanks for your answer​.

        /Poseidon_sthlm


        Comment

        Latest Posts

        Collapse

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