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 lucasmelo152, 06-28-2021, 12:51 PM
        8 responses
        2,123 views
        0 likes
        Last Post Ymcapital  
        Started by Creamers, 04-27-2024, 05:32 AM
        11 responses
        68 views
        0 likes
        Last Post Creamers  
        Started by NM_eFe, 04-30-2024, 06:14 AM
        5 responses
        32 views
        0 likes
        Last Post NM_eFe
        by NM_eFe
         
        Started by Jonker, 04-27-2024, 01:19 PM
        2 responses
        20 views
        0 likes
        Last Post Jonker
        by Jonker
         
        Started by Max Baxter, 03-07-2019, 09:20 PM
        8 responses
        267 views
        0 likes
        Last Post Ymcapital  
        Working...
        X