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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    120 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X