Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Partial Exit SetStopLoss bug?

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

    Partial Exit SetStopLoss bug?

    Hello ,

    managed order handling

    I have the following scenario :

    Entry in position with 2 lots.

    SetStopLoss(entrysignalname,CalculationMode.Price, stopprice,false);
    EnterLongLimit(BarsInProgress,true,2,entrylimit,en trysignalname);

    ....

    Later I do a partial exit with:

    ExitLong(1,"partial exit",entrysignalname);

    at this point my strategy has only 1 lot.

    ...
    Later when the Stop loss is hit, the stop loss order still executes 2 lots.

    This is wrong as the strategy contains only 1 lot.

    Questions:
    1. How can I amend the Stop loss order to reflect the partial exit (hence I need 1 lot stop loss)

    2. What is the procedure to ensure that the stop loss order reflects the proper quantity?

    best regards

    Andreas
    Discover top crypto trading apps like Binance for secure, low-fee trading. Access crypto, forex, and more with real-time tools. Avoid scams, start small, and grow profits.

    #2
    Hi Andreas,

    This is how it will work with a managed order system. If you want to scale out, you must first scale in with separate entry names. Then pair the exits with a specific entry signal name. Any other approach can lead to quantity mismatch.

    An alternative to this is to use the unmanaged approach, which allows you to submit, and change orders exactly how you want, but without any built in position management.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      OK,

      I expected something better from NinjaTrader

      By the way, why do you have the quantity parameter in the managed Exit??? functions.

      You do not need it and it will only create confusion.


      regards
      Andreas

      Comment


        #4
        Quantity is available there if you want to use it. We don't want to introduce more restrictions in those exit overloads.

        The unmanaged approach is designed exactly for situations like this. If you do not like Ninja's built in position and order management, you can create your own with an unmanaged strategy.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          It is not for me, for my own codebase I do use unmanaged frequently.

          It is a tiny project for a customer and I just find out now that what he wants is not do-able with the managed code. In the timeframe given there is no way I will start using unmanaged order handling.
          I have read your documentation, but not having this basic feature just escaped my view . I read some comments from earlier posts (beta NT7), and it seemed a bug that ninja was going to fix.

          regards

          Comment


            #6
            Thanks for the comments, Andreas. At this time, there will be no change to the exit overloads that disallow quantity.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

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