Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to calculate daily PnL of all trades in an account

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

    How to calculate daily PnL of all trades in an account

    Hi,

    What is the best way to calculate the daily pnl on an account if I have a strategy running at the same time I am placing discretionary trades and need to track the performance of both activities?

    For example: If I start the day trading discretionarily, then start the strategy, I would like the strategy to be able to calculate the pnl from the trades I made prior to starting the strategy.

    Does AccountItem.GrossRealizedProfitLoss provide this data, or is there another method for calculating all trade data for the current trading day?

    Thanks in advance

    #2
    Hello Newbie-NT-Scriptor,

    Thanks for your post.

    You could consider using <Account>.Get() to get the AccountItem.RealizedProfitLoss value which returns the Realized PnL value of an account. Or, you could consider getting the AccountItem.GrossRealizedProfitLoss value of an account.

    The difference between the account Gross Realized and Realized is that the Realized will have commissions and fees deducted.

    The difference between the strategy realized and account realized, is the strategy realized will only have completed trades made by the strategy, for the entire lifetime of the strategy (for as many days as it has placed orders) while the account realized has all trades on all instruments and is reset to 0 every day.​

    See the help guide documentation below for more information.

    Account: https://ninjatrader.com/support/help...ount_class.htm
    <Account>.Get(): https://ninjatrader.com/support/helpGuides/nt8/get.htm
    AccountItem: https://ninjatrader.com/support/help...ccountitem.htm
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rhyminkevin, Today, 04:58 PM
    3 responses
    47 views
    0 likes
    Last Post Anfedport  
    Started by iceman2018, Today, 05:07 PM
    0 responses
    5 views
    0 likes
    Last Post iceman2018  
    Started by lightsun47, Today, 03:51 PM
    0 responses
    7 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    14 views
    0 likes
    Last Post 00nevest  
    Started by futtrader, 04-21-2024, 01:50 AM
    4 responses
    50 views
    0 likes
    Last Post futtrader  
    Working...
    X