Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 yertle, Yesterday, 12:24 PM
        1 response
        10 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by Mr Bread, Today, 04:25 AM
        2 responses
        9 views
        0 likes
        Last Post Mr Bread  
        Started by kandise, Today, 09:41 AM
        0 responses
        2 views
        0 likes
        Last Post kandise
        by kandise
         
        Started by Mubeen Haider, Today, 09:41 AM
        0 responses
        5 views
        0 likes
        Last Post Mubeen Haider  
        Started by nicbizz, Today, 09:02 AM
        0 responses
        7 views
        0 likes
        Last Post nicbizz
        by nicbizz
         
        Working...
        X