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.
No accounts in TradeManager.TradingData.Accounts [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: No accounts in TradeManager.TradingData.Accounts
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
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
Re: No accounts in TradeManager.TradingData.Accounts
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.
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.
- 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]
Please refer to the links from this post.