Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do I know when a stoploss was executed?

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

    How do I know when a stoploss was executed?

    Hello
    I have two questions.
    I have implemented a strategy which builds up a position in the market with maximal 5 entries in the same direction. I have set stoploss in the initialize procedure:
    SetStopLoss(CalculationMode.Percent,.02);

    If I understand right as I can see from tracking the trades, the stop loss is set individually for each entry and therefore executed per entry.

    Question 1:
    Is there a way I can see whether a stop loss is executed? I want to know, because if this happens I do not execute within next days another buy order (produced by my signal).

    Question 2:
    Can I set a stop loss which is relative to the entry price of the whole position? Meaning that if I have for example a position size of 5, the stop loss of 2% is set relative to the average entry price?

    thanks for your feedback
    Andre

    #2
    Hello,

    1- Have you try using OnExecution() or IExecution and doing a check within it:


    2- Maybe you could track the fill prices via IOrder:


    for each order, then do an average of them. Then you could use a % in your SetStopLoss:
    DenNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    52 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    275 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X