Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnOrderUpdate states

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

    OnOrderUpdate states

    which state is the right one to catch and use for the assignment of order name.
    OrderState.Working
    OrderState.Submitted

    My initial thought is "working" so I know it was accepted without issues.

    ??

    #2
    Hello dadarara,

    Thank you for your note.

    When you refer to the order name, are you referring to the signal name or are you referring to assigning the order to an order object?

    The orders signal name is assigned when submitted, see enter long section of our helpguide,
    The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()


    Whereas the order object can be assigned in the OnOrderUpdate,


    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      I am asking about the order object assigned in OnOrderUpdate,

      if i use :

      if (order.Name == "myEntryOrder")
      entryOrder = order;

      it means that every state the OnOrderUpdate is called ( submitted, accepted etc...) is is assigned over and over again.
      I am actually asking if that has any negative aspects to it ?
      and maybe its better :

      if (order.Name == "myEntryOrder" && order.OrderState == OrderState.Working)
      entryOrder = order;

      and if so, is it better to use OrderState.Submitted ?

      Comment


        #4
        Hello dadarara,

        There is no issue assigning the entry order on each OnOrderUpdate, as long as you uniquely name your entries. Limiting its assignment only when state.submitted would not be suggested.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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