Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get account PNL?

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

    How to get account PNL?

    Hello,

    I am working on semi-automated strategy using unmanaged approach. Some trades for same account same instrument could be placed manually, some through strategy. I would like to calculate daily PNL which would be combination of trades made by strategy and manual trades (placed through either FXCM mobile app or through NT8 simple order window while strategy is running). I can see Account object and all Executions, I guess I need to get through each of the Execution objects and get cumulative PNL from all the execution objects. Any samples or guidelines to get Account Realised PNL for real-time trading?

    I can get unrealized PNL by using
    PositionAccount.GetUnrealizedProfitLoss(
    PerformanceUnit.Currency);

    and it works fine for trades placed manually. But want to get Realized as well (same number that is shows in NT Accounts tab in column Realized PNL). Or is there a way to accomplish the same using FXCM APIs while running NinjaTrader 8 in parallel?

    Thanks

    #2
    Hello music_p13,

    Thank you for your post.

    You can pull the Realized PnL from AccountItem.RealizedProfitLoss: http://ninjatrader.com/support/helpG...gy_account.htm

    Comment


      #3
      Thanks it works:

      Account.GetAccountItem(AccountItem.RealizedProfitLoss, NinjaTrader.Cbi.Currency.UsDollar).Value

      It will give me a total Realized Profit Loss for all currencies together.

      And it I want to drill-down to see Realized PNL for specific currency, I guess I need to filter all execution objects for given account by that currency name/day, and then calculate PNL based on direction/order status (filled), Order Qty, AvgPrice?

      Comment


        #4
        Hello music_p13,

        Thank you for your response.

        Correct in that you would need to track values manually in your code if you need more detailed information such as the instrument, date, etc.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        6 responses
        27 views
        0 likes
        Last Post ScottWalsh  
        Started by frankthearm, Today, 09:08 AM
        10 responses
        35 views
        0 likes
        Last Post frankthearm  
        Started by GwFutures1988, Today, 02:48 PM
        0 responses
        3 views
        0 likes
        Last Post GwFutures1988  
        Started by mmenigma, Today, 02:22 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by NRITV, Today, 01:15 PM
        2 responses
        9 views
        0 likes
        Last Post NRITV
        by NRITV
         
        Working...
        X