Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss() reverses position?

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

    SetStopLoss() reverses position?

    I am having problems understanding how SetStopLoss() should work. My understading is that when the stop loss price is hit, it should exit the REMAINING position. Instead, it is exiting the FULL (original) position. Here's my scenario:

    SetStopLoss(CalculationMode.Ticks, 4) // Sets stop loss
    EnterLongLimit(4, High[
    1], "L"); // Buys 4 contracts

    When some profit is achieved, I exit half the position:

    ExitLong(2 ,"1h", "L"); // Sells 2 contracts

    I now have 2 contracts remaining, but when my stop loss is subsequently hit, it sells 4 contracts, netting me short 2 contracts when I expect to be flat. I have also tried this with SetTrailStop, using the "from entry" field, but it works the same way:
    SetTrailStop("L", CalculationMode.Ticks, 4, false);

    What am I doing wrong? Thanks.


    #2
    Hello RogBear,
    We are looking into the issue and will let you know the results once I have it.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thanks. I don't know if it matters, but I am experiencing this issue in market replay mode. I have not tried it live.

      Comment


        #4
        Hello RogBear,
        Development has reported that this is expected with Market orders.

        If you are using the Set() orders (like SetStopLoss()) then please do NOT use the Exit methods.

        Please refer to the internal order handling rules from here for more details http://www.ninjatrader.com/support/h...d_approach.htm

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Thanks for getting back with me. I think it would be great if "managed" orders had the intelligence to manage stop losses and scaling out of a trade, if that's not already on your list. Thanks.

          Comment


            #6
            To scale out of a position, you will need to scale in also.

            VT

            Comment


              #7
              Hello RogBear,
              I will forward your suggestion to development and let you know the tracker id once I get it.

              Please let me know if I can assist you any further.
              JoydeepNinjaTrader Customer Service

              Comment


                #8
                Hello,
                Development has assigned tracker id #1622 for your feature request.
                Please let me know if I can assist you any further.
                JoydeepNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                648 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                369 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                108 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                572 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                574 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X