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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    30 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Working...
    X