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 anp23, 02-09-2024, 04:40 PM
        5 responses
        712 views
        0 likes
        Last Post backtester831  
        Started by Clevchin, Today, 12:57 PM
        0 responses
        1 view
        0 likes
        Last Post Clevchin  
        Started by kidpoker007, 05-30-2024, 01:43 PM
        12 responses
        136 views
        0 likes
        Last Post backtester831  
        Started by rtwave, 06-13-2024, 12:10 AM
        8 responses
        92 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by samish18, Today, 03:48 AM
        6 responses
        13 views
        0 likes
        Last Post samish18  
        Working...
        X