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

Setting initail Stop Loss

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

    Setting initail Stop Loss

    Can I get some help with setting an initial stop loss for entries, and to set a trailing stop also please.

    I want to set a stop at the low -1 tick for longs and the high +1 for shorts.

    I want to trail a stop if the market moves in the direction of the trade e.g. Long trade...set trailing stop at the 3rd last low. Short trade... set a trailing stop at the 3rd last high.

    The area I'm having trouble is the values between the brackets SetStopLoss(). I'm not clear on the correct values to place here.

    Thanks in advance,

    Rob

    #2
    Likely something like -

    SetStopLoss(CalculationMode.Price, Low[0] - TickSize);

    See the following as well for additional guidance - http://www.ninjatrader-support.com/v...ead.php?t=3222
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks for your reply and help Ray.

      Can you expand on your reply a little please.

      How does the program determine if...

      {
      SetStopLoss(CalculationMode.Price, Low[
      0] -1);
      }

      is for the longs or shorts?

      Do I need to name the long entires something like "Enter Long" and the short entries "Enter Short" so that the program knows what stop goes with what entry? And if so how does that change the code?


      Also does this code need to go in a particular area and be assigned a particular class?

      Comment


        #4
        If you wish to differentiate between longs and shorts then you will need to name them and submit a SetStopLoss() that is tied to that particular name.


        So for your SetStopLoss you would do something like:
        Code:
        SetStopLoss("Longs", CalculationMode.Price, Low[0] - 1 * TickSize, false);
        Please also check out these reference samples: http://www.ninjatrader-support.com/v...ead.php?t=3225
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by FishTrade, 05-13-2024, 11:11 PM
        3 responses
        12 views
        0 likes
        Last Post FishTrade  
        Started by Graci117, Yesterday, 09:02 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by ETFVoyageur, Yesterday, 07:55 PM
        0 responses
        9 views
        0 likes
        Last Post ETFVoyageur  
        Started by janio973, Yesterday, 07:24 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by aligator, 01-06-2022, 12:14 PM
        4 responses
        252 views
        0 likes
        Last Post john_44573  
        Working...
        X