¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Two TWS instances on one machine


 

I thought this would be easy, but it doesn't seem to work the way I
would expect.

What I'd like to do is run two TWS instances (each logged in to a
different) account. Each TWS would be set to listen on a different port.

Then, I'd like to connect to a specific TWS/port and get
account/execution/portfolio information. I'm able to do this when one
TWS is running, but when two are running, the information returned is
from the wrong account, even when the ports are different. In netstat,
I see both TWSs listening on their respective ports and I can connect
to each one.

Is this expected behavior?

I suppose I could run each TWS on a separate computer, but that seems
like overkill -- one TWS per computer.


 

--- In TWSAPI@..., "soundscribe_studios" <jgalt@...> wrote:

I thought this would be easy, but it doesn't seem to work the way I
would expect.

What I'd like to do is run two TWS instances (each logged in to a
different) account. Each TWS would be set to listen on a different port.

Then, I'd like to connect to a specific TWS/port and get
account/execution/portfolio information. I'm able to do this when one
TWS is running, but when two are running, the information returned is
from the wrong account, even when the ports are different. In netstat,
I see both TWSs listening on their respective ports and I can connect
to each one.

Is this expected behavior?

I suppose I could run each TWS on a separate computer, but that seems
like overkill -- one TWS per computer.
You must have some setup / config problem. I do exactly what you are describing every day with no problems.


 

----> I suppose I could run each TWS on a separate
computer, but that seems
like overkill -- one TWS per computer.-----
never heard something like this before, running 3 TWS
+ 3 paper trade accounts from single computer+ each of
them communicate with my app via API.

computers are cheap today anyway. i just build one on
celeron D under $200,using brand new parts from
tigerdirect :)

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around


 

Well, it's good to know it's supposed to work. I'll poke around some
more. Maybe I didn't cleanly shut everything down after changing the
ports.

Really don't want/need another computer. Already the noise from my
rack can be heard upstairs.


 

You might want to take a look at virtual computing with either Virtual PC or Virtual Server from Microsoft or one of the VMWare versions for virtual computing. You can make a very small footprint of a single machine environment and then clone it as needed to in effect set up multiple independent instances (either entirely isolated or differential environments). These can share a single data directory on ths host machine (using a shared folders type of setup) where you can put those data files together or aggregate the contents for further analysis.

Very inepensive way to go, single physical machine, multiple virtual machines, easy to back up the environment as necessary. Performance probably is sufficient in this environment collecting the data as long as you have a high-speed connection to the internet available.


----> I suppose I could run each TWS on a separate
computer, but that seems
like overkill -- one TWS per computer.-----
never heard something like this before, running 3 TWS
+ 3 paper trade accounts from single computer+ each of
them communicate with my app via API.

computers are cheap today anyway. i just build one on
celeron D under $200,using brand new parts from
tigerdirect :)



---------------------------------
Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2?/min with Yahoo! Messenger with Voice.

[Non-text portions of this message have been removed]