Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss or SetProfitTarget Per Specific Unique Entry

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

    SetStopLoss or SetProfitTarget Per Specific Unique Entry

    Is it possible for me to Enter a trade and tie a particular stoploss (or profittarget) to it.

    e.g.

    EntryHandling is set to "UniqueEntries"
    Entries Per Direction is set to 2

    EnterShort(1,"Trade1"); e.g. ENTERS @ 5290
    SetStopLoss(CalculationMode.Price,5300); ** TIE THIS TO "Trade1" **

    EnterShort(1,"Trade2"); e.g. ENTERS @ 5280
    SetStopLoss(CalculationMode.Price,5290); ** TIE THIS TO "Trade2" **

    then later on

    move stop for "Trade1" to another price
    move stop for "Trade2" to another price

    etc etc.

    Is this "tie" of Stop Losses / Profit Targets to specific trades possible ?

    Many Thanks


    #2
    Hello markyb0y,
    Yes, you can do so using the below overload.
    Code:
    SetStopLoss(string fromEntrySignal, CalculationMode mode, double value, bool simulated)
    Please refer to our help guide to know more.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Absolutely brilliant!!

      unbelievably quick response.

      Many Thanks!!

      Comment


        #4
        pair up the Stop with the Entry

        Given :

        tradeidno=1;
        EnterShort(contractspertrade,tradeidno.ToString()) ;
        SetStopLoss(tradeidno.ToString(),CalculationMode.T icks,10,true);


        When I outpur the orders in OnOrderUpdate I get :

        The order name 1 stop price is currently 0 **** EnterShort ****
        The order name Stop loss stop price is currently 5542 ** SetStopLoss **

        If I add more stop losses it names them all "Stop loss"

        tradeidno++;

        The order name 2 stop price is currently 0
        The order name Stop loss stop price is currently 5548

        Order='NT-00001/Backtest' Name='Stop loss' State=Working Instrument='Z 09-12' Action=BuyToCover Limit price=0 Stop price=5542 Quantity=1 Strategy='BuildTradingPlan' Type=Stop Tif=Gtc Oco='NT-00000-467' Filled=0 Fill price=0 Token='e36ca3e3254e4a099cda7e8a0010fc36' Gtd='01/12/2099 00:00:00'
        Order='NT-00003/Backtest' Name='Stop loss' State=Working Instrument='Z 09-12' Action=BuyToCover Limit price=0 Stop price=5548 Quantity=1 Strategy='BuildTradingPlan' Type=Stop Tif=Gtc Oco='NT-00001-467' Filled=0 Fill price=0 Token='062f21940b5d43ceadd1d2a337786755' Gtd='01/12/2099 00:00:00'

        Is this correct?

        I need to be able to pair up the Stop with the Entry.

        How can this be done?

        Comment


          #5
          Hello markyb0y,
          Orders submitted by the SetStopLoss will be marked as "Stop Loss".

          Instead of looking for the order name please print out the values of the FromEntrySignal property to know from which entry order your stop was "tagged" with.

          Code:
          e.Order.FromEntrySignal
          JoydeepNinjaTrader Customer Service

          Comment


            #6
            Thanks Again for you speedy reply
            :-)

            Comment

            Latest Posts

            Collapse

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