I've tried "AccountItem.CashValue" but that simply gives the same account balance, regardless of trading activity. I've also tried "Account.AccountStatusUpdate += OnAccountStatusUpdate;" (as per the Help Guide), but those produce compile errors.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Current account balance
Collapse
X
-
Current account balance
How do I obtain the current account balance in my script?
I've tried "AccountItem.CashValue" but that simply gives the same account balance, regardless of trading activity. I've also tried "Account.AccountStatusUpdate += OnAccountStatusUpdate;" (as per the Help Guide), but those produce compile errors.
Tags: None
-
Hello spottysallrite,
A NinjaScript Strategy has a position and has profit and loss, but it does not have a separate cash value. That would be an account item.
If you do want to get the account cash value, using Account.Get(AccountItem.CashValue, Currency.UsDollar) would be correct.
If you would like assistance with compile errors, please provide the full error message, or a screenshot.
Do you have an OnAccountStatusUpdate method defined in the script?
Chelsea B.NinjaTrader Customer Service
-
I'm not following. Why would I want to have "OnAccountStatusUpdate()" defined in my script? Doesn't "Account.Get(AccountItem.CashValue, Currency.UsDollar)" provide the current balance?
Comment
-
Hello spottysallrite,
Because you are calling 'Account.AccountStatusUpdate += OnAccountStatusUpdate;' in your script.
If you do not have a method called OnAccountStatusUpdate defined, then there will be a compile error as that method name won't exist.
Yes, Account.Get() will get an account item like the Cash Value. Account.AccountItemUpdate would also update anytime an account item changes.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
50 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 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