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.
    Paul H.NinjaTrader Customer Service

    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.
        Paul H.NinjaTrader Customer Service

        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.
            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            40 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Today, 08:51 AM
            2 responses
            16 views
            0 likes
            Last Post bill2023  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            167 responses
            2,260 views
            0 likes
            Last Post jeronymite  
            Started by warreng86, 11-10-2020, 02:04 PM
            7 responses
            1,362 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by Perr0Grande, Today, 08:16 PM
            0 responses
            5 views
            0 likes
            Last Post Perr0Grande  
            Working...
            X