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 mmenigma, 01-23-2024, 09:37 AM
        1 response
        85 views
        0 likes
        Last Post Nin8aTrender  
        Started by wbayne333, 02-22-2021, 01:18 PM
        6 responses
        408 views
        0 likes
        Last Post Nin8aTrender  
        Started by gtheaded, 07-03-2020, 03:47 PM
        3 responses
        367 views
        0 likes
        Last Post Nin8aTrender  
        Started by theminster, Today, 03:12 PM
        0 responses
        10 views
        0 likes
        Last Post theminster  
        Started by AyeSir, Today, 03:01 PM
        0 responses
        11 views
        0 likes
        Last Post AyeSir
        by AyeSir
         
        Working...
        X