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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X