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 1001111, Today, 09:45 AM
        0 responses
        1 view
        0 likes
        Last Post 1001111
        by 1001111
         
        Started by DTSSTS, 01-28-2024, 12:07 PM
        11 responses
        557 views
        0 likes
        Last Post bmo111
        by bmo111
         
        Started by Torontobluejays, Today, 08:43 AM
        0 responses
        1 view
        0 likes
        Last Post Torontobluejays  
        Started by sastrades, 01-31-2024, 10:19 PM
        12 responses
        193 views
        0 likes
        Last Post sastrades  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        8 responses
        866 views
        0 likes
        Last Post emuns
        by emuns
         
        Working...
        X