Trade manager: how to retrieve Account object  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
User avatar
fbertram
Posts: 166
Joined: 16 Oct 2014
Location: Seattle, USA
Has thanked: 36 times
Been thanked: 76 times
Contact:

Trade manager: how to retrieve Account object

Postby fbertram » 14 Nov 2016

Dear MultiCharts fans,

I am in the process of porting my EasyLanguage code to .NET. Most of this transition was very easy - I'd even go as far as calling it enjoyable. Now I am running into a little problem, and I would appreciate any pointers:

How do I retrieve account information? Basically I am looking for the .NET equivalent of PowerLanguage's GetRTAccountEquity(GetAccountID)? Is there any detailed example on using the TradeManager?


Thanks a lot,
best regards

Felix

User avatar
fbertram
Posts: 166
Joined: 16 Oct 2014
Location: Seattle, USA
Has thanked: 36 times
Been thanked: 76 times
Contact:

Re: Trade manager: how to retrieve Account object  [SOLVED]

Postby fbertram » 14 Nov 2016

ok, found it:

Code: Select all

var accountEquity = 0.0;
if (Environment.IsAutoTradingMode)
{
TradeManager.ProcessEvents();
foreach(Account account in TradeManager.TradingData.Accounts.Items)
accountEquity += account.Equity != null ? (double)account.Equity : 0.0;
}
I wish the documentation was slightly more detailed...


Return to “MultiCharts .NET”