How can you trade multiple accounts on a single PC using IB's TWS?

Discussion in 'Automated Trading' started by a34567, Apr 4, 2007.

  1. a34567

    a34567

    I am not suggesting that VB is the best language for the trading system. I use VB because I have legacy code in VB. And VB has everything I need for my trading system. I don't want to spend time to migrate it to other language. Anyway, the most challenge thing in auto-trade system is the trading strategy, not programming.

    I just checked my program for ClientID. I use "0" when I call TWS_connect(). I use the same ClientID for different application program, but so far I have no problem. Thank you for pointing this out, I may need to use different ClientID. I will be looking into this issue.

    JS
     
    #11     Apr 24, 2007
  2. Incidentally, although a34567 has already answered, because he is connecting to different instances of TWS he can use the same client ID for all connections without interference.
     
    #12     Apr 24, 2007
  3. a34567

    a34567

    One more thing. My system is fully a automated system. I can have it keep trading for days when I am on vacation. During that time, it will keep reporting to me (my cell phone) for the executions and errors using SMS/Text Message and I can control the system right from my cell phone when it is needed.

    I still have the security problem when controling my system via cell phone. When access my trading computer from a computer, I can use VPN (with a security token). But when access my system using cell phone, what can I do? I am using encoded messages. Do you guys have a better idea?
     
    #13     Apr 24, 2007
  4. You obviously need to have some kind of hole into your network to get access to your trading system from your cell. There's not much way around it.

    As long as you configure your firewall as tightly as possible it should be fine. You could tunnel your command protocol over HTTP and use SSL. Best not to have your trading servers in the DMZ though.

    Alternatively, get a PDA to use as a VPN client etc.
     
    #14     Apr 24, 2007
  5. Thanks for pointing that out. Client ID "0" (zero) is "magic" in the fact that it provides a universal view of the trading activity from any Client ID related to the IB account number.
    The only downside is that manually placed trades via the TWS Java app are also in the "mix". So, as long as you are not using the manual TWS, then using ClientID=0 is fine. Otherwise, you will not be able to DISTINGUISH between manual (TWS) and automated trades (TWS-API).
     
    #15     Apr 24, 2007
  6. OK...uh, this is pretty impressive....do you have a SMS server embedded in your VB app ? Otherwise, how else could you communication via SMS ?
    Please, I don't want to sound sarcastic, but I think you've got some features here that even Hedge Funds with unlimited resources do not have.....
    perhaps you should be consulting to them ?
     
    #16     Apr 24, 2007
  7. a34567

    a34567

    To syswizard:

    Sorry for the confusion. Let me explain it again:

    1. My system sends alerts (executions, errors, ...) to my cell phone using SMS

    2. When I need to access my system, I do it using http. I can use my phone or PC to get on internet and then connect to my web server. A special web page will be displayed and from there I can perform most of the trading system administration. If thing go terribly wrong, I will use Remote Desktop to check my system. SMS is not used to control my trading system.
     
    #17     Apr 24, 2007