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 JonesJoker, 04-22-2024, 12:23 PM
            8 responses
            41 views
            0 likes
            Last Post JonesJoker  
            Started by timko, Today, 06:45 AM
            0 responses
            3 views
            0 likes
            Last Post timko
            by timko
             
            Started by Waxavi, 04-19-2024, 02:10 AM
            2 responses
            39 views
            0 likes
            Last Post poeds
            by poeds
             
            Started by chbruno, Yesterday, 04:10 PM
            1 response
            44 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Max238, Today, 01:28 AM
            1 response
            25 views
            0 likes
            Last Post CactusMan  
            Working...
            X