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 sjsj2732, Yesterday, 04:31 AM
            0 responses
            32 views
            0 likes
            Last Post sjsj2732  
            Started by NullPointStrategies, 03-13-2026, 05:17 AM
            0 responses
            286 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            283 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            133 views
            1 like
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            91 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Working...
            X