Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Keep needing to exit ...

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

    Keep needing to exit ...

    Hello,

    I have set profit target and stop loss. I enter using EnterLongLimit and ShortLimit.

    Due to calculations, I need to exit before PT or SL is hit.

    Do I use ExitLong / ExitShort? But I was advised not to mix them with profit target and stop loss.

    How should I be doing this?

    Many Thanks, Caesar.

    #2
    Hello Caesar,

    It is not advised to mix Set methods with order methods like ExitLong() orders.

    If you are using ExitLongStopMarket() as the stop loss, call CancelOrder() with the order object assigned from OnOrderUpdate(), detect the order is cancelled in OnOrderUpdate(), and then send the exit market order. This will ensure that both orders are not able to fill causing an unwanted position.
    https://ninjatrader.com/support/help...ancelorder.htm
    https://ninjatrader.com/support/help...rderupdate.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      So, detect the target order (add a "myLimitOrder" string to the target order has been filled in OnOrderUpdate, and then CancelOrder(myStopMar****rder)?

      But you advise against mixing Set PT/SL with Exit orders.

      So, what is the proper way to do what I want?

      Many Thanks, Caesar.

      Comment


        #4
        Hello Caesar,

        Right, SetStopLoss() would not be used. ExitLongStopMarket() would be used instead for the stop loss. So this way the set methods are not used and are not mixed with exit methods.

        Yes, you can give your exit orders names and detect this in OnOrderUpdate().

        ExitLongLimit(100.00, "myLimitOrder", "myEntry");

        In OnOrderUpdate():
        if (order.Name == "myLimitOrder")
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ah clarity, finally, Huge Thanks Chelsea!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          89 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          135 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          68 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          119 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          69 views
          0 likes
          Last Post PaulMohn  
          Working...
          X