Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

too many OnOrderUpdate events

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

    too many OnOrderUpdate events


    I'm setting a stop loss thats triggering OnOrderUpdate 3 times.

    Code:
    if (order.Name == stopLossName)
    dbMsg("set stop loss to " + Math.Round(stopPrice, 2).ToString());
    should I filter out the unwanted ones? if so what's the best way?

    #2
    Why don't you print the OrderState as well?

    I bet you each call to OnOrderUpdate will have a different state.

    Comment


      #3
      Hello fingers,

      OnOrderUpdate is called each time an order managed by a strategy changes state.

      The Help Guide page below lists all the states an order can have:


      I agree with bltdavid's suggestion of "filtering the unwanted ones" by using a check for OrderState. It's up to you which order state you want the information from.

      If you have any further questions, please let us know.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      47 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Working...
      X