Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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?
    BertrandNinjaTrader Customer Service

    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
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by usazencort, Today, 01:16 AM
        0 responses
        1 view
        0 likes
        Last Post usazencort  
        Started by kaywai, 09-01-2023, 08:44 PM
        5 responses
        603 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by xiinteractive, 04-09-2024, 08:08 AM
        6 responses
        22 views
        0 likes
        Last Post xiinteractive  
        Started by Pattontje, Yesterday, 02:10 PM
        2 responses
        21 views
        0 likes
        Last Post Pattontje  
        Started by flybuzz, 04-21-2024, 04:07 PM
        17 responses
        230 views
        0 likes
        Last Post TradingLoss  
        Working...
        X