How would I access the current account balance from a strategy? I see there is an Account property that is accessible from the strategy, but it is a String and not an object. Any hints?
Thanks,
-Rob
Accessing Account balance from strategy. [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Accessing Account balance from strategy.
Hello Rob,
You need to use Account.Balance Property. Example:
You need to use Account.Balance Property. Example:
Code: Select all
TradeManager.ProcessEvents();
...
TradeManager.TradingData.Accounts.Items[0].Balance;
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Accessing Account balance from strategy. [SOLVED]
You need to check the amount of elements in the Accounts.Items collection first, then you can extract a value from this collection. The attached sample code will output profile name and balance to the Output tab of the PL .Net Editor.
- Attachments
-
- Test_GetAccountInfo.pln
- (1.94 KiB) Downloaded 787 times