oshcap / trade-manager

Automatically exported from code.google.com/p/trade-manager
1 stars 0 forks source link

Problems retriving account information from TWS #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Start the program in live mode.
2. As soon as you click "Live" the following error message comes:
ERROR org.trade.broker.TWSBrokerModel  - BrokerModel symbol: N/A Req Id: -1 
Code: 321 Msg: Error validating request:-'cd' : cause - Only FA or STL 
customers can request managed accounts list.
3. On the account line, only the test account information is displayed even tho 
it is connected to TWS.

What is the expected output? What do you see instead?
 I see only test account information on the account line, I expect to see my real account information.

What version of the product are you using? On what operating system?
Version 2.8 on Windows 7

Please provide any additional information below.

Original issue reported on code.google.com by karl.kit...@gmail.com on 22 Nov 2012 at 1:43

GoogleCodeExporter commented 8 years ago
From my limited poking around the code, it seems that the reqManagedAccts() 
call is what throws the error. My account is (aparantly not) an Financial 
Advisor account, and this 321 error is returned.

Original comment by karl.kit...@gmail.com on 22 Nov 2012 at 2:54

GoogleCodeExporter commented 8 years ago
Ok error code 321 is a TWS API sent error. From the TWS Docs its says

http://www.interactivebrokers.com/php/apiUsersGuide/apiguide.htm

321 Server error when validating an API client request.

Can you try this again during business hours Friday as I suspect the TWS server 
was down for maintenance, they do this now and again.

Please contact me via e-mail if you still have the error and I can answer any 
questions and follow up on this if it need further investigation.

Thanks
Simon

Original comment by simon.allen on 22 Nov 2012 at 5:48

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Are you sure the error code is 321 and not 331 ??

331 Internal error. FA or STL does not have any managed accounts.

When you hit Live it should connect to TWS and retrieve the account info for 
the account TWS is logged into it will set this account to be the current 
default and if it does not exist in the DB it will be save (see Configuration 
tab and select Trade Account bottom left drop down) the Tradingday Tab should 
also update and show the current state (balances) of the account. This top line 
will update as changes occur to that account in TWS as you are not subscribed 
to the account until disconnect. TradeAccount info is available to running 
Strategies.

Simon

Original comment by simon.allen on 22 Nov 2012 at 5:59

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I'll test it tomorrow as well, and mail you any new findings.

Original comment by karl.kit...@gmail.com on 22 Nov 2012 at 7:44

GoogleCodeExporter commented 8 years ago
Added parse logic to reqManagedAccounts() call. The csv string returned will be 
parsed and accounts setup as appropriate. The first account in the string is 
considered the master and will be set to the default account.

Original comment by simon.allen on 26 Nov 2012 at 4:14