This is an interesting question, and one I was intending at some
point to explore.
Based on a cursory review of the methods and calls, there is no way
to retrieve an account number.
But on a little deeper look I believe I have a solution for you.
Apparentley the TWS platform remembers the socket port you called
with the account you called.
In other words you must log onto to each account from a different
socket port with seperate instance of TWS, and then from within your
program you can call the connection from a seperate instance of the
Active X componenet for each account.
An array of controls would do the job...
TWS1(0).Connect "", 7496
TWS1(1).Connect "", 7497
or perhaps just renaming the controls
TWS1.Connect "", 7496
TWS2.Connect "", 7497
I am an array kind of guy so I would go the array route...
Lastley, perhaps you dont even need the second instance and can call
direct..
TWS1.Connect "", 7496
TWS1.Connect "", 7497
But this looks like your asking for trouble and corupted data...IMHO
Either Way....
From there, you can then refrence your calls and segregate returns
based on the source of the call
TWS1(0).reqMktData(da dee da)
TWS1(1).reqMktData(da dee da)
Thats how I see it.
Again, I havn't explored this in detail and perhaps I am wrong.
Give that a shot and then report back here what you find so we can
all benefit from your experience.
Scott
Owner TWSAPI
toggle quoted message
Show quoted text
--- In twsapi@y..., bee_jay_61 <no_reply@y...> wrote:
--- In twsapi@y..., multicen2002 <no_reply@y...> wrote:
I have 2 accounts.
Anyone know how to get account number >>?
An example vb code line will do just fine.
ThanX
I am not sure, but isn?t the account number display in the window
caption of the "Account"-Window?
If so, than I would read the Window Caption.