Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    Paul H.NinjaTrader Customer Service

    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.


        Paul H.NinjaTrader Customer Service

        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 The_Sec, Yesterday, 03:53 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by mmenigma, Yesterday, 03:25 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by kujista, Today, 05:44 AM
          0 responses
          7 views
          0 likes
          Last Post kujista
          by kujista
           
          Started by ZenCortexCLICK, Today, 04:58 AM
          0 responses
          9 views
          0 likes
          Last Post ZenCortexCLICK  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          172 responses
          2,282 views
          0 likes
          Last Post sidlercom80  
          Working...
          X