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

OrderState & OnExecution

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

    OrderState & OnExecution

    Hello

    Which OrderStates pass through OnExecution? Do Accepted and Working pass through there?

    I would like to say, "When AdjustedStop has an OrderState of Accepted, Cancel InitialStop"

    Would that go through OnExecution or OnBarUpdate, or under a different method?

    #2
    Hello jg123,

    Thank you for your note.

    OnExecution() is only called when an execution has occurred e.g. a fill
    In this case you would be able to get the Filled and PartFill OrderStates from OnExecution().

    If you want the other OrderStates, you would want to use OnOrderUpdate() when the OrderState has been changed.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Cal,
      According to the OnORderUpdate() help guide:
      The OnOrderUpdate() method is called everytime an order managed by a strategy changes state. An order will change state when a change in order quantity, price or state (working to filled) occurs

      how do you "catch" an order once its status changed to accepted?

      Thanks

      Comment


        #4
        Dafna,

        You can check using this statement -

        if(order.OrderState == OrderState.Accepted)
        {
        Print("Order was accepted");
        }

        http://www.ninjatrader.com/support/h...tml?iorder.htm
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Perr0Grande, Today, 08:16 PM
        0 responses
        2 views
        0 likes
        Last Post Perr0Grande  
        Started by elderan, Today, 08:03 PM
        0 responses
        5 views
        0 likes
        Last Post elderan
        by elderan
         
        Started by algospoke, Today, 06:40 PM
        0 responses
        10 views
        0 likes
        Last Post algospoke  
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        11 views
        0 likes
        Last Post maybeimnotrader  
        Started by quantismo, Today, 05:13 PM
        0 responses
        7 views
        0 likes
        Last Post quantismo  
        Working...
        X