Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing Stop using Strategy Wizard

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

    Trailing Stop using Strategy Wizard

    Hello,
    I'm a newbie in this and need help with making work a trailing stop set-up using the strategy develpment wizard.

    I tried to make a simple strategy with the Wizard using an indicator and exit when the trailing stop is reached: fast EMA crossover above slow EMA for long entry and exit when the trailing stop is hit. I run it from chart. The strategy enters the trade OK (long) but it does not exit when the trailing stop is hit.


    Can u please tell me what I did wrong when setting up the strategy? Do I have to set a separate exit set of conditions in the Wizard, even if I set the trailing stop in wizard? Or is just a silly typo somewhere and didn't catch it......

    Attached are the files for the respective strategy. I attached 2 cases, with the standard EMA indicator and with a custom indicator, although the strategy is the same. Perhaps someone can show me what's wrong, and even better, correct it and send it back.

    Thanks,
    Dan
    Attached Files

    #2
    BBzDan, are there any errors in the logs (right-most tab of Control Center)? Have you tried using CalculationMode.Ticks with a value of 5?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thx Austin for prompt reply.

      Ticks and percent work, price doesn't. The log says:
      "Trailing stop for strategy "Bla..Bla..Bla.." cannot be calculated with CalculationMode.Price. Please use one of the other modes." Any idea why???

      Another little problem with the Wizard: when changing the type of input in User Defined Inputs from integer to double or the other way and then go through all set-up, click finish and get it compiled, the type does not changes in the code for all the inputs I changed, and I get a compiling error that it cannot convert. For example, if I have a trailing stop for long entries and one for short, change them from double to int or the other way, only one gets compiled right way, the other remains as it was before.

      This can also be seen in the code, one Min. value is of correct type, the other one remains as it was before. I do change all 3 columns: Type, Default and Min in "User Defined Inputs". If I edit the code
      and put a decimal to Min. value (or erase them, respectively), then it's OK, but I do not want to unlock the code. Any suggestions?

      Here is an example:

      [Description("")]
      [Category(
      "Parameters")]
      publicdouble TrailingStopL
      {
      get { return trailingStopL; }
      set { trailingStopL = Math.Max(0, value); }
      }
      [Description(
      "")]
      [Category(
      "Parameters")]
      publicdouble TrailingStopS
      {
      get { return trailingStopS; }
      set { trailingStopS = Math.Max(0.0, value);


      Thx,
      Dan

      Comment


        #4
        BBzDan, this is expected for the trailstop, it should be entered in relative terms for the 'to trail by' value.

        I'll see if I can reproduce your wizard issue here - so you start out with int's as user inputs and the strategy compiles well, then you change those to double's and only some are changed in the underlying code?

        Comment


          #5
          Yes, this is it. Try the 2 files I attached earlier, v simple strategies, just to learn how to use the wizard. Change the trail stops from double to int, and/or the other way, see what happens.

          Thx,
          Dan

          Comment


            #6
            Dan, thanks for reporting in - I could reproduce this issue and we're looking into it.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            651 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            577 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X