IBGateway

69 views
Skip to first unread message

Eugene Kononov

unread,
Aug 19, 2008, 6:29:15 PM8/19/08
to JBookTrader
This thread is to discuss IBGateway software and how JBT can be used with it.

Here are the instructions:

1. Download and run http://www.interactivebrokers.com/download/gwclient.jar

2. When the application pops up, click "Edit Settings", change "LocalApiPort" to the same value as in the one used in JBT (Configure|Preferences|TWS Connection), and click "Save Edits".

3. In the "market data" login using your TWS real account credentials.

4. Start JBT, and run one or more strategies in the "forward test" mode.

5. Confirm that market data appears in JBT and that IBGateWay has three "green" statuses, as in the image attached.




ibgateway.PNG

nonlinear5

unread,
Aug 19, 2008, 6:41:30 PM8/19/08
to JBookTrader
IBGateway is a good discovery (thanks to HF Dave and Marcin). There
may be several reasons why it may be a better alternative to TWS when
running JBT:

1. Market data could flow at a faster and more steady rate because TWS
is bypassed.
2. There may be some improvements in the data delivery logic which
could improve the consistency in our multi-user tests
3. There is no danger of accidentally tripping something in the real
account (because IBGateway can't be used for order routing unless you
have a FIX account)
4. There are no extra fees or charges for using IBGateway to get
market data, and no modifications to JBT are needed to make it work
with IBGateway.

One everyone gets comfortable with IBGateway, I am thinking of setting
up a multi-user test to see if it gives us an improvement over TWS.

Ted

unread,
Aug 19, 2008, 8:16:52 PM8/19/08
to JBookTrader
I had unzip the gwclient.jar in the C:/gwclient file in my computer.
How can I run it please
Ted

On Aug 19, 6:29 pm, "Eugene Kononov" <eugene.kono...@gmail.com> wrote:
> This thread is to discuss IBGateway software and how JBT can be used with
> it.
>
> Here are the instructions:
>
> 1. Download and runhttp://www.interactivebrokers.com/download/gwclient.jar
>
> 2. When the application pops up, click "Edit Settings", change
> "LocalApiPort" to the same value as in the one used in JBT
> (Configure|Preferences|TWS Connection), and click "Save Edits".
>
> 3. In the "market data" login using your TWS real account credentials.
>
> 4. Start JBT, and run one or more strategies in the "forward test" mode.
>
> 5. Confirm that market data appears in JBT and that IBGateWay has three
> "green" statuses, as in the image attached.
>
>  ibgateway.PNG
> 56KViewDownload

Skyisthelimit

unread,
Aug 19, 2008, 9:06:52 PM8/19/08
to JBookTrader
Nice finding indeed. One question, if I do apply for a FIX account,
does it require changes from JBT to get order route working? Thanks

Shane

unread,
Aug 19, 2008, 9:14:38 PM8/19/08
to jbook...@googlegroups.com
Firefox knows how to handle it.  Click on the link and open it or save it and open.

nonlinear5

unread,
Aug 19, 2008, 9:14:58 PM8/19/08
to JBookTrader
> One question, if I do apply for a FIX account,
> does it require changes from JBT to get order route working?

Yes, the way I understand it from their description is that to route
orders, you have to be running a FIX engine which connects to
IBGateway. That means that most of the stuff in Trader.java and
TraderAssitant.java would need to be reworked.

Gab

unread,
Aug 19, 2008, 9:16:22 PM8/19/08
to jbook...@googlegroups.com
I confirm that the data appear and all the lights are green.  It's a nice finding indeed, thanks Dave and Marcin.  Jean, if you want help to set up, you can call me.

I don't quite understand why the TWS protocol would be different from this one.  You think they would have written two different protocol to send and request the data?  It sure worth the test.

nonlinear5

unread,
Aug 19, 2008, 9:29:56 PM8/19/08
to JBookTrader
> I don't quite understand why the TWS protocol would be different from this
> one.  You think they would have written two different protocol to send and
> request the data?  It sure worth the test.

FIX is considered a "standard" protocol for financial communications.
I've never used it, but I've heard that it's cumbersome and complex. I
think that is the reason that IB created a "wrapper" protocol, which I
assume simply translates the meaning of FIX messages into TWS API
messages, such as tickPrice(), marketDepth(), etc. If IB didn't have
this wrapper, the API users would have to deal with FIX. It's all
guesses on my part, though.

Skyisthelimit

unread,
Aug 19, 2008, 9:36:08 PM8/19/08
to JBookTrader
I have IBGateway running and JBT can do forward test with data
connection. But I can't start TWS, can you verify if this happens to
everyone?

Gab

unread,
Aug 19, 2008, 9:39:18 PM8/19/08
to jbook...@googlegroups.com
I have IBGateway running and JBT can do forward test with data
connection. But I can't start TWS, can you verify if this happens to
everyone?

I just started my TWS, I'm able to start it, but I can't connect in my real account without disconnecting the IBGateway.  Eugene, are you sure we could route the orders through the TWS?

Skyisthelimit

unread,
Aug 19, 2008, 9:44:35 PM8/19/08
to JBookTrader
That's the same with mine, for "can't start", I mean I can't get
connected without disconnecting IBGateway..
So IB gateway is good for forward testing at least to check if data
feeding is better. If indeed, IBGateway delivers much better data feed
quality, I may try to get a FIX account and test it out if JBT is
modified to handle FIX order routing..

nonlinear5

unread,
Aug 19, 2008, 10:07:05 PM8/19/08
to JBookTrader
> I have IBGateway running and JBT can do forward test with data
> connection. But I can't start TWS, can you verify if this happens to
> everyone?

To be able to connect to *both* TWS and IBGateway, there must be *two*
open ports, and JBT should chose one for market data and the other one
for order routing. This does require a change to JBT, but it should be
a small one.

My suggestion is that we go one step at a time. First, let's find out
of the data feed through IBGateway is better than that through TWS.
For this step, we don't need any changes in JBT. We can run forward
tests without TWS. If we like IBGateway, we'll proceed to step 2,
which is getting data from IBGateway and transmitting orders via TWS.



Gab

unread,
Aug 19, 2008, 10:24:44 PM8/19/08
to jbook...@googlegroups.com
To be able to connect to *both* TWS and IBGateway, there must be *two*
open ports, and JBT should chose one for market data and the other one
for order routing. This does require a change to JBT, but it should be
a small one.

I think the problem isn't there, the problem comes from IB who won't let you connect into your real account with two instances.  If you're able to connect  to *both* TWS and IBGateway with JBT, it's no use if you can't login with *both* TWS and IBGateway.  Maybe I don't get something tough...:)

nonlinear5

unread,
Aug 19, 2008, 10:33:09 PM8/19/08
to JBookTrader
> I think the problem isn't there, the problem comes from IB who won't let you
> connect into your real account with two instances.

There will not be a problem connecting JBT to both TWS and IBGateway
at the same time. It's just a matter of connecting to two different
sockets. Don't worry about now, we'll deal with it when the time comes.

nonlinear5

unread,
Aug 20, 2008, 12:30:33 AM8/20/08
to JBookTrader
I figured that the best way to compare data feeds through TWS and
IBGateway is to start two JBT instances, connect to TWS from one JBT
instance, connect to IBGateway from another JBT instance, record raw
market data, and then compare the recorded market data streams.
However, what happens is that once TWS is running, IBGateway refuses
to log in if it's the same account, and the same way around: if
IBGateway is connected, TWS would not log in. I didn't expect this.
So, for this test to work, it looks like one has to have *two*
separate real account accounts with IB. Does anyone have two real
accounts?

HF Dave

unread,
Aug 20, 2008, 2:22:40 AM8/20/08
to JBookTrader
On Aug 20, 6:30 am, nonlinear5 <eugene.kono...@gmail.com> wrote:
> So, for this test to work, it looks like one has to have *two*
> separate real account accounts with IB. Does anyone have two real
> accounts?

In fact, I have never thought anything else. Sorry that I forgot to
mention this. For IB it is just a market data connection so you are
limited to one per account. Since we do not want to run TWS at all
(slow down the PC etc.) it is restrictive in the right way. On the
other hand it keeps us from making the comparison. I have PC powerful
enough and two real accounts at IB so I can run JBT twice for the
test. The question is is you can connect twice with the FIX. I mean 1x
TWS and 1x GW over FIX.

Florent Guiliani

unread,
Aug 20, 2008, 4:49:14 AM8/20/08
to jbook...@googlegroups.com
Skyisthelimit wrote:
> That's the same with mine, for "can't start", I mean I can't get
> connected without disconnecting IBGateway..
> So IB gateway is good for forward testing at least to check if data
> feeding is better. If indeed, IBGateway delivers much better data feed
> quality, I may try to get a FIX account and test it out if JBT is
> modified to handle FIX order routing..

I bet that JBT doesn't need mods to work with IBGateway even for order routing.
Why? Because IBGateway ask for your FIX login. I bet that IBG aslo open the FIX
connection and accept orders from the API.

--
Florent,

Gab

unread,
Aug 20, 2008, 9:50:04 AM8/20/08
to jbook...@googlegroups.com
However, what happens is that once TWS is running, IBGateway refuses
to log in if it's the same account, and the same way around: if
IBGateway is connected, TWS would not log in. I didn't expect this.

That's what I wanted to say, but my english is so bad .  Then, it will be impossible to route the order through our TWS while getting the data from IBgateway.

HF Dave

unread,
Aug 20, 2008, 1:03:52 PM8/20/08
to JBookTrader
On Aug 20, 3:50 pm, Gab <gabrieldanca...@gmail.com> wrote:
> That's what I wanted to say, but my english is so bad . Then, it will be
> impossible to route the order through our TWS while getting the data from
> IBgateway.

It is weird to me that the GW provides data but prevent one from
executing.

Anyway, you can request second account from IB. The second account, in
the terms of next login / password pair, is free. You only have to
deal with their desk what is always a frustrating experience. :)

Gab

unread,
Aug 20, 2008, 1:09:21 PM8/20/08
to jbook...@googlegroups.com

 You only have to
deal with their desk what is always a frustrating experience. :)

You're right, I hoped it was over but I'll have to deal with them another time.  I'll start yoga right now. :)

HF Dave

unread,
Aug 20, 2008, 1:18:42 PM8/20/08
to JBookTrader
On Aug 20, 7:03 pm, HF Dave <tmi...@gmail.com> wrote:
> Anyway, you can request second account from IB. The second account, in
> the terms of next login / password pair, is free. You only have to
> deal with their desk what is always a frustrating experience. :)

Thinking more about ... this is not exactly what we wanted. :) We
wanted to get rid of the overbloated TWS to keep the system load as
low as possible. If the GW cannot completely substitute TWS we can
only benefit from it in the case it can provide better data.

nonlinear5

unread,
Aug 22, 2008, 9:33:00 AM8/22/08
to JBookTrader
I've been running IBGateway non-stop, 24 hours a day for the last 3
days. It looks very stable, and unlike TWS, it doesn't need to be
restarted every day. Perfect for data collection.

Kelvin

unread,
Aug 24, 2008, 1:47:18 PM8/24/08
to JBookTrader
I think that, since IBGateway can not route orders, we just forget it.
The strategy design is more important.

In addition, I have some robust and live traded strategy in JST.
Although the average profit per year is not as high as the theoretical
profit in JBT, it can always pumping money from the market. JST is
more mature and faster in optimization. The most important thing for
JST is that we always have historical data for at least one year. I
think we should combine the JBT and JST into one project, so that I do
not need to run JST and JBT in two different machines.

jeb211b

unread,
Aug 24, 2008, 2:55:32 PM8/24/08
to JBookTrader
I would prefer that JBT and JST be kept as separate projects, as the
book input is so very different from a price bar input.

What I hope to see is that some kind and industrious Java expert would
modify JST to handle at least 2 symbols as input data streams (ie ES
and SPX or ES and TICK). I have attempted this, but my understanding
of objects is too poor to make a major modification to JST.

Maybe the results of JBT market depth strategies could be improved if
a technical input such as TICK was available along with the book data.
> > restarted every day. Perfect for data collection.- Hide quoted text -
>
> - Show quoted text -

nonlinear5

unread,
Aug 24, 2008, 9:34:13 PM8/24/08
to JBookTrader
> JST is more mature and faster in optimization.

JBT optimizer is actually about 10 times faster than JST optimizer. On
my machine, JBT optimizer cycles through about 2 million records per
second. It's just that JBT deals with vastly bigger data sets,
compared to JST, so optimization appears to be slow. Regarding the
"maturity" level, I'd say that JBT has less "rough spots" than JST,
since JBT development has been much more active and recent.

> The strategy design is more important.

That I fully agree with.

nonlinear5

unread,
Aug 24, 2008, 10:17:46 PM8/24/08
to JBookTrader
> What I hope to see is that some kind and industrious Java expert would
> modify JST to handle at least 2 symbols as input data streams (ie ES
> and SPX or ES and TICK). I have attempted this, but my understanding
> of objects is too poor to make a major modification to JST.
>
> Maybe the results of JBT market depth strategies could be improved if
> a technical input such as TICK was available along with the book data.
>

I'll make an experimental JBT build which will include access to TICK/
TRIN from any strategy.

Kelvin

unread,
Aug 24, 2008, 10:26:15 PM8/24/08
to JBookTrader
JST optimizer can make use multiple CPUs, but jbt can not do it at
this point.

Skyisthelimit

unread,
Aug 24, 2008, 10:50:26 PM8/24/08
to JBookTrader
That will be nice, I remember I proposed this before: )

jeb211b

unread,
Aug 25, 2008, 12:46:07 AM8/25/08
to JBookTrader
Thanks in advance for being willing to create an experimental JBT
build with TICK/TRIN. I look forward to experimenting with it.

Gab

unread,
Aug 25, 2008, 12:16:59 PM8/25/08
to jbook...@googlegroups.com
That's is good news.  Since Tick and Trin are pre-move indicators, it could be interesting to test that with marketBook. 

Another interesting thing that we could try is some knid of pair trading.  Instead of trading in one direction, we would trade the difference.  Of course, we would need two set of historical data, but if that is the plan with TICK and TRIN, it's another possibility.

Jean Morin

unread,
Aug 25, 2008, 1:09:40 PM8/25/08
to jbook...@googlegroups.com
Yes it's good news the addition of TRIN and TICK, because ES is the image of the market through the S&P500, it's not a stock so we have to think about it diffently than a simple stock, FOREX or commodity.  Knowing the pressure and the direction in the market will bring an edge I'm sure.
Ted

2008/8/25 Gab <gabriel...@gmail.com>

nonlinear5

unread,
Aug 25, 2008, 1:13:02 PM8/25/08
to JBookTrader
I have my experimental JBT build with TICK and TRIN running today, and
it seems to work well. I'll publish it tonight, so perhaps we could do
a multi-user test tomorrow.

On Aug 25, 1:09 pm, "Jean Morin" <jeanmor...@gmail.com> wrote:
> Yes it's good news the addition of TRIN and TICK, because ES is the image of
> the market through the S&P500, it's not a stock so we have to think about it
> diffently than a simple stock, FOREX or commodity.  Knowing the pressure and
> the direction in the market will bring an edge I'm sure.
> Ted
>
> 2008/8/25 Gab <gabrieldanca...@gmail.com>
>
> > That's is good news.  Since Tick and Trin are pre-move indicators, it could
> > be interesting to test that with marketBook.
>
> > Another interesting thing that we could try is some knid of pair trading.
> > Instead of trading in one direction, we would trade the difference.  Of
> > course, we would need two set of historical data, but if that is the plan
> > with TICK and TRIN, it's another possibility.
>

Gab

unread,
Aug 25, 2008, 1:21:25 PM8/25/08
to jbook...@googlegroups.com
I have my experimental JBT build with TICK and TRIN running today, and
it seems to work well. I'll publish it tonight, so perhaps we could do
a multi-user test tomorrow.

I'm in.

Jean Morin

unread,
Aug 25, 2008, 4:51:41 PM8/25/08
to jbook...@googlegroups.com
I'll be part of the test  Ted

2008/8/25 Gab <gabriel...@gmail.com>

MKoistinen

unread,
Aug 4, 2009, 9:30:28 AM8/4/09
to HF Dave, JBookTrader
IB tell me that, as an individual trader that already has a normal
account and a simulated trading account, I am not eligible for another
login, referring me to this web page:

http://www.interactivebrokers.com/en/p.php?f=userMgmt&ib_entity=llc

Has anyone gotten around this?


Best,
- Martin

Eugene Kononov

unread,
Aug 4, 2009, 10:10:03 AM8/4/09
to jbook...@googlegroups.com

IB tell me that, as an individual trader that already has a normal
account and a simulated trading account, I am not eligible for another
login, referring me to this web page:

http://www.interactivebrokers.com/en/p.php?f=userMgmt&ib_entity=llc

Has anyone gotten around this?




Yes, you can have two simulated accounts, in addition to the real account. But you need to create another user name.

Klaus

unread,
Aug 4, 2009, 12:14:16 PM8/4/09
to JBookTrader
Hi,

you can also get two normal accounts with two different user names.

Klaus

Eugene Kononov

unread,
Aug 4, 2009, 12:55:19 PM8/4/09
to jbook...@googlegroups.com




Hi,

you can also get two normal accounts with two different user names.



Yes, actually that's what I meant, two regular accounts with two different user names.

cwu

unread,
Jun 7, 2010, 1:17:20 AM6/7/10
to jbook...@googlegroups.com
The TWS installer has IB Gateway client included since release 9.04. Is there any one using JBT with the new IB Gateway client now?

2008/8/25 Gab <gabriel...@gmail.com>

--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group at http://groups.google.com/group/jbooktrader?hl=en
-~----------~----~----~----~------~----~------~--~---


Reply all
Reply to author
Forward
0 new messages