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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        164 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        318 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        246 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        350 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X