Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Get Total PLN
Collapse
X
-
Get Total PLN
Friends, I am scratching my head. I know that if you have your settings correct, NinjaTrader 8, does a real decent job of keeping you abreast of your running totals, of unrealized PNL, realized PNL, minus commission for your trades. My question is by passing the Strategy Wizard, and direct coding, I am seeking the input to use in the get() method to create a variables, using the output, contained in the account data tabs. In other words, I would rather go over the mountain, using your calculations , than going around it by rewriting, what you Guys, have already done. Besides I think you guys are pretty good code writers.Tags: None
-
Hello JLSwin,
Thanks for your post.
To pull the account PNL in a strategy you can use: Account.Get(AccountItem.RealizedProfitLoss, Currency.UsDollar)
Here is a link to the list of all items you can pull: https://ninjatrader.com/support/help...ccountitem.htm
Here is a simple example:
Print ("Account pnl = "+ Account.Get(AccountItem.RealizedProfitLoss, Currency.UsDollar));
-
Thanks for the quick reply,
You must think highly of me having the Guru himself responding. Your response leads me to another question, if I was to run this in onAccountupdate, where in the pecking order should it be placed, before onBarupdate or after.
Thanks in advance for your response.
John
Comment
-
Hello JLSwin,
Thanks for your reply.
Using the code I referenced in Post#2 you would not need anything else and that code can be run in OnBarUpdate().
There is no OnAccountUpdate() so I think you are meaning OnAccountItemUpdate()? If so the OnAccountItemUpdate() code wise can be placed before or after OnBarUpdate().
References:
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
44 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
65 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment