Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to know if a Filled order is also closed?

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

    How to know if a Filled order is also closed?

    Meaning: I want to know from the Orders in the account.Orders collection which ATM 'Entry' orders that are Filled are also already closed in the passed.
    If I have an open Position, I don't know how to determine which order or orders belong to that position.
    Older orders which are Filled could be already closed out, and there might be more than one order for a position (so the averagefillprice doesn't match).

    PS: I'm using StartATMStrategy in an indicator, not a strategy.

    #2
    Hello wjadevries,

    The entry order created with account.CreateOrder() should be assigned to a variable.
    With that variable holding the entry order you can check the state of it.
    myEntry.OrderState.

    You can monitor the account.OrderUpdate event and look for the e.Order to match your entry order variable or check the e.Order.Name to match your entry name.
    Below is a link to the help guide.
    https://ninjatrader.com/support/help...rderupdate.htm

    The order's owner can also be casted as an atm strategy to see what template it was submitted with.
    Below is a link to an example script.
    https://ninjatrader.com/support/foru...21#post1085921
    Last edited by NinjaTrader_ChelseaB; 10-08-2020, 08:58 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    574 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    332 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X