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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 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