Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strange StopLoss

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

    Strange StopLoss

    Hello,

    I a strategy, defined a stoploss of 2% for short position in Initialize method
    Code:
    SetStopLoss("Short",CalculationMode.Percent, 0.02, false);
    This is working well except for one trade where stoploss is reached but the lost goes to 7% ...

    I attached screenshot of that trade

    Is someone could explain me why position was not cut around 2 % ?

    Thanks in advance
    Attached Files

    #2
    Hi LaughingDwarf,

    It's not clear from the screenshot what should be happening. Your description says you are specifying a short position but the trade looks long.

    For debugging your strategy, use plenty of Print() statements and TraceOrders output to track strategy order submission. Please see here for help using these debugging tools:


    There is a dedicated sample to exposing order details submitted with Set statements. You can see this sample here:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,
      Thank you for pointing me that this is a long position and not a short one. And since i put in place a stop at 8% in case of long trade, then it means that stoploss are working perfectly.
      Sorry not to have pay enough attention prior to posting this message.

      Thank you!

      Comment


        #4
        Glad to hear it's working the way you expect. Thanks for the follow- up here, LaughingDwarf.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        50 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        16 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        22 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X