Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing order

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

    Trailing order

    Hello!

    Not sure why is so complicated to place a simple trailing order. I have spent lots of hours watching videos, testing setstoploss then settrailstop but without getting what I want.

    I just need an order that will move up or down (long or short) to follow the instrument and secure the profit (if any...). That's it! It's supposed to be the trailing order but it doesn't work (it does not trail).

    if (whatevercondition...)
    {
    SetTrailStop(CalculationMode.Percent, 0.04);
    EnterLong();
    }

    Has anyone out there accomplished this?

    Thanks!

    #2
    Hello TexFly,

    Thanks for your post.

    I tested your code on the live market this morning and recorded my observations: https://Paul-ninjaTrader.tinytake.co...MxNl83MDMxMzI0

    As the video shows, once the market order has entered the 4% trail stop is applied. The entry was at 63.22 the 4% trail stop should then be 63.22 * .96 = 60.69 which it was. As the trade moves into profitability, for each tick of profit, the trail stop moved as expected.

    Comment


      #3
      Thanks for testing, Paul. Should it work the same in market reply mode?

      Comment


        #4
        Hello TexFly,

        Thanks for your reply.

        Correct, it will work in Playback.

        Comment


          #5
          Ok, I can see it now working in a long position. However, when I place the same SetTrailStop on a short position the trailing order gets cancelled. Do I need to do anything different? I tried minus on the % but NT does't like it...

          Comment


            #6
            Hello TexFly,

            Thanks for your reply.

            Yes, the same thing works in either direction. There is no need to use a negative value. The Set methods (SetTrailStop, SetStopLoss and SetProfitTarget) all automatically determine the direction and place the orders appropriately. The exception would be if you were using CalculateMode.Price which in this case you are not.

            If you wish to post or send in your code I would be glad to do a quick review to see if there are any irregularities. If emailing, send to PlatformSupport[at]NinjaTrader[dot]Com, mark the subject atten: Paul and include a link to this thread.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            57 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            37 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            18 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            20 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            49 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X