Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Handle partial fill methods

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

    Handle partial fill methods

    I am using EnterLong() or EnterLongLimit() to buy a stock with quantity = 100. If only 90 shares are filled (partial fill), I need to cancel the rest pending buy (10 shares) and at the same time, using ExitLongLimit() to sell these bought 90 share.

    myEntryOrder = EnterLongLimit(0, true, 100, myOrderPrice, "BUY 1001");
    ... CancelOrder(myEntryOrder);
    ExitLongLimit(0, true, 90, GetCurrentAsk(), "", "BUY 1001"); // this quantity = 90 is obtained from OnExecutionUpdate()


    A couple of questions:
    1) how to let my testing fill partially? I already tried this which is not working,Tools -> Options -> Trading -> Simulator -> Enforce partial fills


    2) Can the combination of CancelOrder() and ExitLongLimit() work here?
    Last edited by localappleseed; 09-16-2020, 10:01 AM.

    #2
    Hello, thanks for your post.

    Yes, if you call CancelOrder on a partially filled entry order the remainder of the order will be canceled.

    Please let me know if I can be of further assistance.

    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the answer.
      Could you please tell how I can enforce a partial fill in OnExecutionUpdate() or make OrderState.PartFilled true?

      Comment


        #4
        Hello, thanks for your reply.

        From the Control Center, go to Tools>Options>Trading>Enable "Enforce Partial Fills" That will cause partial fills to occur for testing on the Sim101 account. That can be useful for testing strategies that need to handle partial fills.

        Kind regards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by traderharley, Today, 08:46 AM
        0 responses
        2 views
        0 likes
        Last Post traderharley  
        Started by NinjaCustomer, Today, 08:22 AM
        0 responses
        5 views
        0 likes
        Last Post NinjaCustomer  
        Started by n8dogg59, Today, 07:58 AM
        2 responses
        9 views
        0 likes
        Last Post n8dogg59  
        Started by CoffeeOutlaw, Yesterday, 07:33 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by localappleseed, Yesterday, 08:16 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X