Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss for a Specific Order

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

    SetStopLoss for a Specific Order

    Hello Gurus

    This is a basic question, so bear with me.

    I submit 2 long entry orders, like below:

    If ((Closes[0][0] > SMA(10)[0])
    {
    EnterLong(1, "L2");
    EnterLong(1,"L3");

    }​

    I am able to set a generic stopLoss like this:
    SetStopLoss("CalculationMode.Ticks, 8); --This works for both L2 and L3


    I am looking for SetStopLoss only for L3. How do I achieve that?
    SetStopLoss(1, "CalculationMode.Ticks, 8, "L3");

    Tried many different way but it errors.

    Appreciate your help!

    Thanks


    #2
    Hello NRITV,

    You are very close. The help guide has the overload signature of each NinjaScript method.

    SetStopLoss(string fromEntrySignal, CalculationMode mode, double value, bool isSimulatedStop)
    Help guide: NinjaScript > Language Reference > Strategy > Order Methods > Managed Approach > SetStopLoss()

    Try:
    SetStopLoss("L3", CalculationMode.Ticks, 8, false);
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    43 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    48 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X