Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing stop not working

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

    Trailing stop not working

    Hi
    I add SetTrailStop("", CalculationMode.Ticks, TrailStop, false);

    in the initialize section of my strategy. I after that try to optimize the TrailStop integer (I double checked and have properly added the integer in the Properties and in the Variables).

    However whenever an entry is made there is no sign of a Trailstop or whatsoever.

    What is more disturbing is that when I remove the custom Variable "TrailStop" and try to hardcode e.g. 15 ticks, the result is exactly the same.

    Am I missing something?

    Any input will be very much appreciated.

    #2
    nikolaalx, do you mean you do not see a trailing action - or do you mean you do not see any stop loss at all applied to your positions? If the trail would not be activated > then I would expect it to act as regular stop loss. Or do you perhaps try to mix SetTrailStop with SetStopLoss on the same position here in your script?

    Comment


      #3
      I am not mixing it up with teh SetStopLoss

      I commented out all other profit/loss settings in the Initialize section.

      Here is the exact code:


      Add(Aroon(AroonPeriod));
      SetTrailStop("", CalculationMode.Ticks, TrailStop, false);

      // SetProfitTarget("", CalculationMode.Percent, ProfitTaker);
      // SetStopLoss("", CalculationMode.Percent, StopLoss, false);


      I do not see any stops at all, neither trail stops (on events that are profitable and that should have triggered the stop).

      Even when I hardcode 1 tick, there are no triggers.

      Comment


        #4
        Which instrument and chart type / period do you test this on? I've attached a little example to compare against, this for example triggers as expected on my ES 5 min chart. Can you please give this a test on your setup?
        Attached Files

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        87 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        106 views
        0 likes
        Last Post CarlTrading  
        Working...
        X