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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    163 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    81 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    125 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    206 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    184 views
    0 likes
    Last Post CarlTrading  
    Working...
    X