Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

determining when a trail stop is executed

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

    determining when a trail stop is executed

    Is there a way to get a notification or some other method to determine if a trail stop has just been executed so that other actions may be taken such as stopping trading for a number of bars?

    #2
    Hello,

    Yes, this is possible - to better assist you, can you tell me which trail stop method you're using? Is this from an ATM Strategy, SetTrailStop(), or do you programmatically change the price of a stop order using another approach?
    MatthewNinjaTrader Product Management

    Comment


      #3
      This would be a SetTrailStop in the Initialize method.

      Thanks,

      Comment


        #4
        Hello seahn,

        Thanks for your note.

        Yes, it is possible to capture the trail being filled in OnOrderUpdate.

        For example:

        protected override void OnOrderUpdate(IOrder order)
        {
        if (order.Name == "Trail Stop" && order.OrderState == OrderState.Filled)
        // do something
        }

        Below is a link to the help guide on IOrder.
        http://www.ninjatrader.com/support/h...nt7/iorder.htm

        Please let me know if this does not resolve your inquiry.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Would this work in backtest as well, realizing OnOrderUpdate would be called at the start of the next bar?

          Comment


            #6
            Hello seahn,

            Thanks for your reply.

            Yes, this will work in backtesting as well.

            When backtesting the OnOrderUpdate will fire intrabar after OnBarUpdate has finished.
            This will most likely be before the next call to OnBarUpdate.


            Please do not hesitate to contact us for any other NinjaTrader inquiries you may have.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            156 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            90 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            138 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            130 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            107 views
            0 likes
            Last Post CarlTrading  
            Working...
            X