No GUI, no human interactions, fully automated operation

1,466 views
Skip to first unread message

Gregory Scott Burd

unread,
Nov 16, 2010, 8:53:58 AM11/16/10
to jbooktrader
Hello everyone.

I've been poking around this list's archives hoping to find a definitive answer to how to run IB TWS and JBookTrader "headless" (aka without a GUI, without human interaction).  I found a link to a shell (http://groups.google.com/group/jbooktrader/web/jbt.sh) which is no longer available (anyone have a copy?) and in the same post instructions for starting/stopping via cron. I'm looking for solutions to:

  • Running IB TWS or Gateway without user prompts for user/password etc.
  • Running JBookTrader with a strategy from the command line
  • When JBookTrader connects to TWS the user is prompted "Accept incoming connections attempt?", I'd like that to not happen (again, goal is zero human interactions, zero GUI)

Also, does anyone know if you can make more than one connection to IB's servers at the same time? Can I run multiple copies of IB TWS or IB Gateway at the same time?

thanks for the help!

-greg

skunktrader

unread,
Nov 16, 2010, 10:31:51 AM11/16/10
to JBookTrader


Gregory Scott Burd wrote:
> Hello everyone.
>
> I've been poking around this list's archives hoping to find a definitive
> answer to how to run IB TWS and JBookTrader "headless" (aka without a GUI,
> without human interaction). I found a link to a shell (
> http://groups.google.com/group/jbooktrader/web/jbt.sh) which is no longer
> available (anyone have a copy?) and in the same post instructions for
> starting/stopping via cron. I'm looking for solutions to:
>
>
> - Running IB TWS or Gateway without user prompts for user/password etc.
> - Running JBookTrader with a strategy from the command line
> - When JBookTrader connects to TWS the user is prompted "Accept incoming
> connections attempt?", I'd like that to not happen (again, goal is zero
> human interactions, zero GUI)
>

Edit -> Global Configuration -> API -> Enter 127.0.0.1 (or whatever)
in the Trusted IP Address list

>
> Also, does anyone know if you can make more than one connection to IB's
> servers at the same time? Can I run multiple copies of IB TWS or IB Gateway
> at the same time?

No. The first TWS/Gateway will disconnect as soon as the second
connects

nonlinear5

unread,
Nov 16, 2010, 10:35:13 AM11/16/10
to JBookTrader
Ok, here are some points from me:

1. JBT in its current state *is* fully automated. I start it up in the
morning, and let it trade all day long.

2. There is an "experimental" branch of JBT which contains the
"command line JBT" feature, among other things:
http://code.google.com/p/jbooktrader/source/browse/#svn/tags/jbooktrader-fg-0.3

3. If you use IB Gateway, you can log in once and let it run for weeks
(if not for months). I've successfully used it with JBT. The downside
is that it can't trade, but if your intent is to collect market data,
it works just fine.

4. If you want to trade and not restart TWS every day, you may want to
look at two software solutions: TWSStart and IBController. Both of
them reset the TWS "exit time", thus making it possible to start TWS
once and run it continuously.

5. You can configure TWS so that the "Accept incoming connections
attempt?" prompt doesn't pop up.



On Nov 16, 8:53 am, Gregory Scott Burd <gb...@ossus.com> wrote:
> Hello everyone.
>
> I've been poking around this list's archives hoping to find a definitive
> answer to how to run IB TWS and JBookTrader "headless" (aka without a GUI,
> without human interaction).  I found a link to a shell (http://groups.google.com/group/jbooktrader/web/jbt.sh) which is no longer
> available (anyone have a copy?) and in the same post instructions for
> starting/stopping via cron. I'm looking for solutions to:
>
>    - Running IB TWS or Gateway without user prompts for user/password etc.
>    - Running JBookTrader with a strategy from the command line
>    - When JBookTrader connects to TWS the user is prompted "Accept incoming

skunktrader

unread,
Nov 16, 2010, 10:36:03 AM11/16/10
to JBookTrader
Let me correct that. Only 1 instance of TWS/Gateway per login is
possible. You can run multiple copies of TWS/Gateway at the same time
provided each use a distict login / connect to a different account.

It is possible to request IB to configure 1 account with multiple
logins, but you will be charged monthly data fees for each login.

Astor

unread,
Nov 16, 2010, 10:45:21 AM11/16/10
to jbook...@googlegroups.com
>Edit -> Global Configuration -> API -> Enter 127.0.0.1 (or whatever)
>in the Trusted IP Address list
 
This will still require you to login to TWS before you can run JBT.
 
There is an open source program, I think it is called IBStart or something like that. I have not used the program myself, but read the description and it appears to be able to open the TWS automatically.



From: skunktrader <skunk...@gmail.com>
To: JBookTrader <jbook...@googlegroups.com>
Sent: Tue, November 16, 2010 9:31:51 AM
Subject: [JBookTrader] Re: No GUI, no human interactions, fully automated operation
--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To post to this group, send email to jbook...@googlegroups.com.
To unsubscribe from this group, send email to jbooktrader+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jbooktrader?hl=en.


Gregory Scott Burd

unread,
Nov 16, 2010, 12:07:27 PM11/16/10
to jbook...@googlegroups.com
Thanks Astor,

That pushed me in the right direction.  After a bit of hunting I found: http://code.google.com/p/ibpy/ """ IbPy is a third-party implementation of the API used for accessing the Interactive Brokers on-line trading system. IbPy implements functionality that the Python programmer can use to connect to IB, request stock ticker data, submit orders for stocks and futures, and more. """  That looks like the blueprints to building a Java version so we can finally eliminate the need for the IB TWS GUI.

thanks!

-greg

skunktrader

unread,
Nov 16, 2010, 1:09:49 PM11/16/10
to JBookTrader


Gregory Scott Burd wrote:
> Thanks Astor,
>
> That pushed me in the right direction. After a bit of hunting I found:
> http://code.google.com/p/ibpy/ """ IbPy is a third-party implementation of
> the API used for accessing the Interactive Brokers on-line trading system.
> IbPy implements functionality that the Python programmer can use to connect
> to IB, request stock ticker data, submit orders for stocks and futures, and
> more. """ That looks like the blueprints to building a Java version so we
> can finally eliminate the need for the IB TWS GUI.
>
> thanks!
>
> -greg

I believe IbPy is just a python implementation of the API which
connects to TWS or Gateway

I believe Astor was referring to IBController, which is a wrapper
around TWS/Gateway that automatically changes the automatic logoff
time so that TWS will stay up for days without a forced disconnect.
The authors of IBGateway hang around on this list
http://finance.groups.yahoo.com/group/TWSAPI/

skunktrader

unread,
Nov 16, 2010, 1:58:23 PM11/16/10
to JBookTrader


nonlinear5 wrote:
>
> 3. If you use IB Gateway, you can log in once and let it run for weeks
> (if not for months). I've successfully used it with JBT. The downside
> is that it can't trade, but if your intent is to collect market data,
> it works just fine.
>
You can place trades using the IBGateway

nonlinear5

unread,
Nov 16, 2010, 2:26:46 PM11/16/10
to JBookTrader
> You can place trades using the IBGateway

My understanding was that you'd need your own FIX engine
implementation, to be able to trade through IB Gateway. Has that
changed?

Astor

unread,
Nov 16, 2010, 2:46:24 PM11/16/10
to jbook...@googlegroups.com
No, IBGateway accepts API socket connection. It is meant as a lightweight alternative to TWS for those who do not need GUI.



From: nonlinear5 <eugene....@gmail.com>
To: JBookTrader <jbook...@googlegroups.com>
Sent: Tue, November 16, 2010 1:26:46 PM

Subject: [JBookTrader] Re: No GUI, no human interactions, fully automated operation

katercarlo

unread,
Nov 29, 2010, 11:24:40 AM11/29/10
to JBookTrader
I recently tested IBGateway together with JBookTrader and everything
seems to work fine.
It is now possible to replace TWS with IBGateway with the advantage of
less overhead, less memory usage
and (most important) no need for restarting TWS each day (or using a
third party program).
It is provided with the full installation file of the TWS (not with
the updates). You only have to edit the portnumber and the clientID in
the settings of IBGateway.

For me this is a better solution than using IBContropller or TWSstart.


On 16 Nov., 20:46, Astor <astorel...@yahoo.com> wrote:
> No, IBGateway accepts API socket connection. It is meant as a lightweight
> alternative to TWS for those who do not need GUI.
>
> ________________________________
> From: nonlinear5 <eugene.kono...@gmail.com>
> To: JBookTrader <jbook...@googlegroups.com>
> Sent: Tue, November 16, 2010 1:26:46 PM
> Subject: [JBookTrader] Re: No GUI, no human interactions, fully automated
> operation
>
> > You can place trades using the IBGateway
>
> My understanding was that you'd need your own FIX engine
> implementation, to be able to trade through IB Gateway. Has that
> changed?
>
> --
> You received this message because you are subscribed to the Google Groups
> "JBookTrader" group.
> To post to this group, send email to jbook...@googlegroups.com.
> To unsubscribe from this group, send email to
> jbooktrader...@googlegroups.com.

nonlinear5

unread,
Nov 29, 2010, 2:30:50 PM11/29/10
to JBookTrader
> I recently tested IBGateway together with JBookTrader and everything
> seems to work fine.

It's been a while since I used IBGateway, and at that time, there was
indeed an option to get market data, but the option to trade required
a running FIX engine. Since then, it looks like IBGateway matured, and
it does appear that it supports API trading as well. I ran it with JBT
the other day, and it seemed to work, except one instance when
IBGateway threw a pop up dialog saying that a "security could not be
found" or something of that sort. I do recall a document somewhere on
the IB website comparing the functionality of the API through TWS and
IBGateway, and I seem to remember there was something about error
handling. I'll try to dig up that document.

nonlinear5

unread,
Nov 29, 2010, 2:42:23 PM11/29/10
to JBookTrader
So. here is the comparison of connecting through TWS and IBGateway,
and it changed from the last time I looked at it. As it reads now,
there is no difference in functionality, except that IBGateway is GUI-
less:
http://interactivebrokers.com/en/p.php?f=programInterface&p=c&ib_entity=llc#access

So, yes, if IBGateway works well with JBT, it's certainly a better
option than running TWS with either TWSStart or IBController.

Gregory Scott Burd

unread,
Nov 29, 2010, 2:45:18 PM11/29/10
to jbooktrader
Thanks for trying it out! :) I'll try it myself later today if I have time.

Just FYI, I'm asking about the VPN interface to find out a) cost and
b) advantages/disadvantages of that route for my purposes. It may be
worth it to me to have my trading software connected over a VPN
directly to IB's servers without an intermediate Java GUI of any kind
on my side. This would make my home setup much simpler, less error
prone, and it would make automating a trade agent running "in the
cloud" much easier.

If anyone has information on their VPN service I'd be interested to
hear your thoughts,

-greg

Astor

unread,
Nov 29, 2010, 4:13:30 PM11/29/10
to jbook...@googlegroups.com

I have received exactly the same message for QQQQ trading in JArbitrager through TWS. So, it probably is a glitch in API, not IBGateway.


From: nonlinear5 <eugene....@gmail.com>
To: JBookTrader <jbook...@googlegroups.com>
Sent: Mon, November 29, 2010 1:30:50 PM

Subject: [JBookTrader] Re: No GUI, no human interactions, fully automated operation
--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To post to this group, send email to jbook...@googlegroups.com.
To unsubscribe from this group, send email to jbooktrader+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages