No accounts in TradeManager.TradingData.Accounts  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
zysmn
Posts: 68
Joined: 27 Feb 2014
Has thanked: 7 times
Been thanked: 4 times

No accounts in TradeManager.TradingData.Accounts

Postby zysmn » 04 Apr 2014

Hello, need your help again.
1. I try to use access to the accounts data listed in "Order and position window".There are two account. But when I try to request TradeManager.TradingData.Accounts.Items.Length in StartCalc method, it returns 0 items. Why it can be or I'm probably doing something wrong?
In CalcBar method all work properly.
2. Why when I call in CalcBar TradeManager.TradingData.Accounts.Items[1].Balance returns 0 instead real balance?
3. What does it mean symbol "?" in description "public double? Balance { get; private set; }" in WiKi?

Thank you.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: No accounts in TradeManager.TradingData.Accounts

Postby Henry MultiСharts » 04 Apr 2014

Hello zysmn,

1. Loading data and calculating the study are asynchronous. When the strategy is calculated the TradeManager data is still not loaded. You need to subscribe to account events (TradeManager.TradingData.Accounts.Added etc) and use them for checking that the TradeManager data is loaded.
2. We were unable to replicate that. That is possible that once you resolve point 1 - this one will be resolved automatically.
3. Please refer to Nullable Types @ MSDN

zysmn
Posts: 68
Joined: 27 Feb 2014
Has thanked: 7 times
Been thanked: 4 times

Re: No accounts in TradeManager.TradingData.Accounts

Postby zysmn » 07 Apr 2014

Thanks for the hint, I will try to use events.
I found Test_TradeManager_4 & Test_TradeManager_5 script on the forum. Could you give me references to the other Test_TradeManager examples scripts? Search does not produce a correct response.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: No accounts in TradeManager.TradingData.Accounts  [SOLVED]

Postby Henry MultiСharts » 15 Apr 2014

Please refer to the links from this post.

zysmn
Posts: 68
Joined: 27 Feb 2014
Has thanked: 7 times
Been thanked: 4 times

Re: No accounts in TradeManager.TradingData.Accounts

Postby zysmn » 16 Apr 2014

ok, thanks


Return to “MultiCharts .NET”