Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Status after an OverFill detected

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

    Order Status after an OverFill detected

    I'm doing a procedure for OverFill situations under unamanaged, beginning with this little snippet, which goal is to know if there's an OverFill and change the Status to cancelled of that lEntryOrder.:

    Code:
    protected override void OnOrderUpdate(IOrder order)
    {
         if (lEntryOrder != null && lEntryOrder == order)					
    			{					
    				if(lEntryOrder.OverFill)				
    				{				
    					// OverFill ! do something			
    				}				
    			
                                   if (order.OrderState == OrderState.Cancelled)				
    				{				
    					lEntryOrder = null;			
    				}
                           }
    }
    Questions:

    1. Is it correct the snippet to detect an OverFill?

    2. Is it correct the snippet to change the OrderState to cancelled after the OverFill detection or the Order is automatically cancelled ?

    Thanks

    #2
    Hello pstrusi,

    Thank you for your patience.

    1. This would detect an OverFill.

    2. The order should be filled as the state or more accurately OverFill as the state. It would not be Cancelled.

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello pstrusi,

      Thank you for your patience.

      1. This would detect an OverFill.

      2. The order should be filled as the state or more accurately OverFill as the state. It would not be Cancelled.
      Regarding point 2, what I meant was for cases of Part.Filled, if there was a Partial Fill then the remaining order is cancelled automatically or should I cancel it in the script?

      Comment


        #4
        Hello pstrusi,

        NinjaTrader will attempt to cancel any orders left over. You may wish to check for the order and then cancel if it is not already.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        562 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        325 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X