Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Easy way to retrieve parent entry order for position?

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

    Easy way to retrieve parent entry order for position?

    Let's say I have an active/open position. Is there an easy way to retrieve the entry order object that created the position?

    Currently, I have to iterate over the orders and match on various criteria. Is there a more efficient way to do this?

    Thanks in advance!

    #2
    Hello MarkWise,

    A position can be made of several orders and not just one.

    Unfortunately, there are not any tools in the help guide to provide a collection of entry orders that make up a position.

    Instead, you would need to track these, likely using a List<Order> collection. Add the order in OnOrderUpdate to the list when order becomes working, remove the order from the list when the entry is filled. Remove the order when the exit order for that entry fills.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea.

      That's what I'm doing now. I just didn't know if NT had an exposed method for this. (I couldn't find one, so I asked.)

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      37 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      23 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      162 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      98 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      152 views
      2 likes
      Last Post CaptainJack  
      Working...
      X