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 cre8able, 02-11-2023, 05:43 PM
        3 responses
        232 views
        0 likes
        Last Post rhubear
        by rhubear
         
        Started by frslvr, 04-11-2024, 07:26 AM
        8 responses
        111 views
        1 like
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        10 responses
        44 views
        0 likes
        Last Post stafe
        by stafe
         
        Started by rocketman7, Today, 09:41 AM
        3 responses
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by traderqz, Today, 09:44 AM
        2 responses
        6 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X