Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 gemify, 11-11-2022, 11:52 AM
        6 responses
        803 views
        2 likes
        Last Post ultls
        by ultls
         
        Started by ScottWalsh, Today, 04:52 PM
        0 responses
        3 views
        0 likes
        Last Post ScottWalsh  
        Started by ScottWalsh, Today, 04:29 PM
        0 responses
        7 views
        0 likes
        Last Post ScottWalsh  
        Started by rtwave, 04-12-2024, 09:30 AM
        2 responses
        22 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by tsantospinto, 04-12-2024, 07:04 PM
        5 responses
        70 views
        0 likes
        Last Post tsantospinto  
        Working...
        X