Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing Stop in Unmanaged Approach

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

    Trailing Stop in Unmanaged Approach

    How do you enter a trailing stop order in unmanaged approach? If broker supports trailing stop orders, is there a way to enter these orders directly?

    Thanks.

    #2
    Welcome to our forums yoman, unfortunately the broker native trailing stop order would not be supported within NT - we can support those types in managed / unmanaged :

    OrderType.Limit

    OrderType.Market

    OrderType.Stop

    OrderType.StopLimit

    Comment


      #3
      Trailing Stop in Unmanaged Approach

      Dear Sirs,
      being that I must use unmanaged approach to develop my strategy and being that I would need StopLoss, ProfitTarget and TrailStop, I substitute ProfitTarget and StopLoss with two oco orders.
      My question is: how can I write code lines that perform TrailStop function?
      Did someone already write in his strategy own TrailStop routine?
      Thanks

      Comment


        #4
        Hi mbogliardi, there have been threads on how to implement custom trailing stop code every few weeks. Basically, you will have to follow these steps:

        1) monitor your orders for fills
        2) when an order is filled, submit the stop and record the price you submit the stop
        3) with every tick that comes in, check to see if the new price has moved in your favor
        4) when the price has moved far enough in your favor, move/change the stop price
        5) when your stop or target has been hit, reset both orders to null
        AustinNinjaTrader Customer Service

        Comment


          #5
          First of all thanks for quick answer.
          But my strategy is based on 60 min bars.
          You say that every tick that comes I must adjust stop level.
          How can I do this?
          In my strategy I have the following statements:

          protected override void OnBarUpdate()
          protected override void OnOrderUpdate(IOrder order)
          protected override void OnExecution(IExecution execution)

          If I set "calculate on bar close = false", do the statements inside OnBarUpdate() udate every tick?

          Comment


            #6
            mbog,

            Yes, if COBC is set to false then OnBarUpdate is executed every tick.

            Please let me know if I can assist further.
            Adam P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            647 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X