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

PartFilled and SL/TP

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

    PartFilled and SL/TP

    Suppose I am using the managed approach and my order is only 60% filled (PartFilled) and I catch the stop loss or take profit. What happnes to the rest of the 40%? Is it cancled? Is it remains alive? Does the SL and TP orders are sill alive?

    Thanks

    #2
    Hello kiss987,

    When an order is part filled, it will continue filling until filled.

    If you attempt to cancel the order while in a part filled state, this cancellation would need to be received before any more contracts are filled for the cancellation to be effective.

    Any stop loss and profit target placed with SetStopLoss and SetProfitTarget will still be working and the quantities will match the filled amount.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your reply.

      So on the mentioned scenario, once the partially filled position has reached SL/TP I want to flat the remaining order with its SL+TP. How can I detect that the position has reached SL/TP and then flat the remaining order?

      Comment


        #4
        Hello kiss987,

        I'm not understanding what you mean.

        The position is the number of contracts you are long or short.

        "once the partially filled position has reached SL/TP I want to flat the remaining order with its SL+TP"
        Can you clarify your inquiry?

        Are you trying to exit the trade immediately after you enter the trade? As in, once the entry order fills, how do i place a market order to exit the trade immediately?

        If you have already set a stop loss and profit target using SetStopLoss and SetProfitTarget, these will be submitted after your entry order part fills and then fills.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello
          I'll eplain myself using an eample:

          Suppose I entered a 10 lot long limit order with a SL and TP. Then, only 6 lots were filled and eventually closed at the TP. If I understand correctly, I have now a 4 lot order open (plus TP and SL). I want to cancel that 4 lot order (with its TP and SL) immediately when the 6 lot position is closed on TP.
          How can I do that?

          Comment


            #6
            Hello kiss987,

            Are you asking what happens if the stop loss or profit target fills while the entry is part filled?

            The entry will continue filling and a new stop loss and profit target will be submitted to protect the remaining quantity.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Suppose I entered my position using:
              IOrder myOrder = EnterLongLimit(myPrice);

              After a while this order was partially filled and after that closed on TP.
              How can I cancel the remaining part which was not filled?

              Comment


                #8
                Hi kiss987,

                You can call CancelOrder(myOrder) and this will cancel the remaining amount (as long as no further quantity has part filled).
                However, be aware that if the cancellation amount doesn't match the remaining amount and overfill error will occur.
                http://ninjatrader.com/support/helpG...ancelorder.htm
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Thank you

                  So how can I make sure that the cancellation amount match the remaining amount so an overfill error will not occur?

                  Comment


                    #10
                    Hello kiss987,

                    Thank you for your response.

                    CancelOrder() requires no quantity and would cancel the remaining quantity on the order.

                    Comment


                      #11
                      Hello,

                      After my order was partially filled and I catch the S.L, what are the OrderState of the remaining S.L and T,P (assuming I didn't cancel the remaining order)?

                      Thanks

                      Comment


                        #12
                        Hello kiss987,

                        Thank you for your post.

                        The Order States would be Working or Accepted. For information on the Order States please visit the following link: http://ninjatrader.com/support/helpG...efinitions.htm

                        Please let me know if you have any questions.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by The_Sec, Yesterday, 03:37 PM
                        1 response
                        11 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by vecnopus, Today, 06:15 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post vecnopus  
                        Started by Aviram Y, Today, 05:29 AM
                        0 responses
                        5 views
                        0 likes
                        Last Post Aviram Y  
                        Started by quantismo, 04-17-2024, 05:13 PM
                        3 responses
                        27 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by ScottWalsh, 04-16-2024, 04:29 PM
                        7 responses
                        36 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Working...
                        X