Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy to export account Unrealised PnL to excel

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

    Strategy to export account Unrealised PnL to excel

    Hello,

    Is there a way to create a strategy which can export into an excel file the unrealised PnL of an account which is running multiple strategies?

    So if the strategy was run on 5 min bars the strategy would export the account unrealised PnL for each of those bars during the trading session.

    Thanks,

    Neil

    #2
    As an update, I've figured out how to create a strategy to export trade performance to an excel file so I don't need assistance with that.

    I just don't know how to access time stamped account based unrealised PnL data...is that possible? I can access the position unrealized PnL through Position.GetUnrealizedProfitLoss(), is there an equivalent for the account rather than the position?

    Neil
    Last edited by burtoninlondon; 04-30-2024, 07:30 AM.

    Comment


      #3
      Hi NinjaTrader_BrandonH, thanks for your response.

      As a follow on question is it possible to access the historical unrealized PnL values? For example, is it possible to access the values for each 5 min candle during a previous trading session?

      Thanks,

      Neil

      Comment


        #4
        Hello burtoninlondon,

        That is not possible by default, the unrealized PnL values that you can get would all relate to realtime. To maintain those values historically you would need to create a custom Series<double> and then store the unrealized PnL to the series for each bar as the script processes in realtime. You could then have historical access to the PnL by referencing that series.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        72 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X