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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      556 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 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
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X