Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Keep Stop loss separated

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

    Keep Stop loss separated

    Hello,

    I have a strategy when a set up is made by the candles then:
    Enterlong();
    SetStopLoss(CalculationMode.Price, Low[0] -2);
    While Price goes up if the set up appears again another order enterlong and setstoploss happens, and the same for 3rd, 4th, etc
    Everything ok until here.
    What I would like to have is stoploss separated, attached to the low of the enterlong candle,
    Now at every new order, the buy order goes up averaging the entry I guess
    and the same for stoploss 1 Sell STP gets 2 Sell STP, 3 Sell STP, etc
    I there any coding to not merge stoploss? I would like to keep them separated below the candle that created the entry.

    In other words, can I code in my strategy the ATM option: Keep selected ATM strategy template on order submission?

    Thanks
    Oscar
    Last edited by ficantaloa; 03-24-2020, 06:44 AM.

    #2
    Hello ficantaloa,

    Thanks for your post and welcome to the Ninjatrader forums!

    You can do this by using unique signal names for your entries and then using those same signal names in the SetStopLoss().

    Please see, "Order Entry Methods" on this page: https://ninjatrader.com/support/help...d_approach.htm

    Comment


      #3
      Thanks for your quick answer.
      I implemeted what you suggest and partialy Works.
      If (set up XYZ happens)
      SetStopLoss("Long1", CalculationMode.Price, Low[0] - 2,true);
      EnterLong("Long1");

      With that, all stopsloss are still merged but they moved to the low of last entry, before the stayed merged at an average Price I guess.
      Any idea what's missing to get them separated under their low?
      Thanks
      Last edited by ficantaloa; 03-24-2020, 11:20 AM.

      Comment


        #4
        Hello ficantaloa,

        Thanks for your reply.

        Yes, you would need to use unique signal names for each. Each order signal name must be different to use a different stop.

        For example is your strategy only places one order per bar you could so something like:

        If (set up XYZ happens)
        SetStopLoss("Long1"+CurrentBar, CalculationMode.Price, Low[0] - 2,true); // create the stop loss signal name using "Long1" and the current bar number
        EnterLong("Long1"+CurrentBar); // Create the entry of Long1 and the current bar number.


        Comment


          #5
          Thanks mate, that's amazing, after a few weeks testing it Works perfectly well!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          44 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          65 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X