Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

When NT closes a position

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

    When NT closes a position

    In my strategy, I want to keep track of its profit/loss since the strategy was started. I can do this in the OnExecution tag using the execution.Price and execution.Quantity to compare with a local array I have of the entry price and quantity, which is subscripted by execution.Order.FromEntrySignal.

    However, when NinjaTrader closes a position, like when you have Exit On Close set to true, the execution object doesn't seem to have any connection to the FromEntrySignal that opened the order. execution.Order.Name is also not the same as the name I gave the order when it was placed. So I have no way to get the order's entry price or quantity.

    Is there a way to do this?

    Thanks!
    Bryan

    #2
    Hi Bryan, for the realtime strategy performance, couldn't you just use the RealtimeTradesCollection from the Performance class?

    Comment

    Latest Posts

    Collapse

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