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 redart1021, Today, 01:14 PM
        2 responses
        8 views
        0 likes
        Last Post redart1021  
        Started by auto112112, Today, 12:36 PM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by UltraNIX, Today, 11:03 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Lopat, Today, 10:56 AM
        2 responses
        17 views
        0 likes
        Last Post Lopat
        by Lopat
         
        Started by ntdev, Today, 10:28 AM
        2 responses
        17 views
        0 likes
        Last Post ntdev
        by ntdev
         
        Working...
        X