Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MIT order not filling on range bars

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

    MIT order not filling on range bars

    I have a strategy which on a short places a EnterShortMIT order one tick below the previous closed bar. This works great 99% of the time but every now and then it drops below the previous bar and my MIT order is just sitting there waiting to get filled above the market. I'm currently running Calculate.OnbarClose so I figured this was the issue so I have tried to use Calculate.OnEachTick and Calculate.OnPriceChange but I have the same results. The same happens when using EnterLongMIT as well. I think I understand the issue just not how to fix it. With range bars its possible that the open of the next bar opens lower than the previous plus my 1 tick so the MIT order so it never get filled. Anyone have any suggestions? I should add I have also tried EnterShortStop orders and its gets an error quite a bit because the price rips below the stop price and it won't fill and stop the strategy from running. Again this is a result of the range bars I believe.

    Thanks
    Last edited by jeffom; 07-28-2022, 09:29 AM.

    #2
    Hello jeffom,

    Thanks for your post.

    Is the order not filling because it is being automatically canceled because the order's price was not reached?

    How is the MIT order being submitted? Are you using the order method syntax that allows you to set the isLiveUntilCancelled property to true or false?

    EnterLongMIT(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double stopPrice, string signalName)

    If you submit the order without setting the isLiveUntilCancelled property to true and the order is not re-submitted on the next bar, the order will automatically be canceled.

    To keep the order alive, you would need to use the order method syntax that allows you to specify the isLiveUntilCancelled property to true. Or, you could re-submit the order on each bar close.

    See this reference sample that demonstrates keeping orders alive: https://ninjatrader.com/support/help...ders_alive.htm

    Let me know if I may assist further.
    <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


      #3
      Thanks for the reply,. to answer your first question. The order is not executed because its unintentionally becomes a resting MITsell order that was entered above the market so it will just sits there waiting to filled it isn't getting canceled. The intention was for this order to fill when we break the low of the previous bar . I'm not using the syntax you suggested I'm doing this EnterShortMIT(Convert.ToInt32(DefaultQuantity), stopPrice, "Short"); I'm not looking to resubmit the order or even cancel it however. I just would like it to fill at my desired location 1 tick below the previous bar. Would fill resolution change this behavior ?
      Last edited by jeffom; 07-28-2022, 02:42 PM.

      Comment


        #4
        Hello jeffom,

        Thanks for your note.

        If the EnterShortMIT() method is submitted without setting the isLiveUntilCancelled property set to true, the order would be canceled after the bar that the order was submitted to closes.

        If you are resubmitting the order at a new price on each bar, the order could be moving.

        Have you added debugging prints to the script?

        Please add debugging print to the script that prints out the order object in the OnOrderUpdate() method and note the output of the prints for each tick update that occurs after the order becomes working. Prints will display in a New > NinjaScript Output window.

        You could observe the prints to see if the OrderState is TriggerPending or Accepted and compare the stop price to the current Ask price. You could also compare the last close price price with the working stop price

        Also, enable TraceOrders which will let us know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

        See this help guide page for more information about OnOrderUpdate(): https://ninjatrader.com/support/help...rderupdate.htm

        Below is a link to a forum post that demonstrates how to use prints to understand behavior.
        https://ninjatrader.com/support/foru...121#post791121

        Let me know if I may assist further.
        <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, Yesterday, 05:17 AM
        0 responses
        59 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 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