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 burtoninlondon, Today, 12:38 AM
    0 responses
    5 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    12 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    13 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,982 views
    3 likes
    Last Post jhudas88  
    Working...
    X