How to properly install IB TWS and IB gateway in Win7 64 bit

Questions about MultiCharts and user contributed studies.
atsui
Posts: 25
Joined: 03 Aug 2011
Has thanked: 5 times
Been thanked: 4 times

How to properly install IB TWS and IB gateway in Win7 64 bit

Postby atsui » 09 May 2012

I recently purchased a windows 7 64bit PC to take advantage of the new 64bit MC. However, I don't seem to be able to find a standard procedure to properly install IB TWS and IB Gateway in a windows 7 64bit PC. Currently, I have installed only the 32bit java and copy javaw.exe to the windows /system32 folder and it seems to work fine for the moment. However, if I connect MC to IB Gateway, it takes MC a few minutes to be able to receive data and to place orders which is highly unusual and defects the purpose of using the 64bit MC. I was able to find a workaround on how to install IB gateway in this link.

http://www.elitetrader.com/vb/showthrea ... genumber=2

I haven't tried it yet because I don't want to use too many workarounds when I use MC purely for auto-trading. Currently, I am using IB TWS instead of IB gateway as an interim solution because of the issue mentioned above. All the information I can find so far is just bit and pieces and I am not sure how the various workarounds may affect the system's stability over the long run. I'd like to know if there is proper and standard way to install IB TWS and IB Gateway in a windows7 64 bit pc to ensure my pc's smooth operation in the future. It would be very helpful if MC support can give us some input in this regard as more and more MC users are switching to MC 64 bit.

Any help would be greatly appreciated.

User avatar
TJ
Posts: 6523
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby TJ » 09 May 2012

atsui wrote:I recently purchased a windows 7 64bit PC to take advantage of the new 64bit MC. However, I don't seem to be able to find a standard procedure to properly install IB TWS and IB Gateway in a windows 7 64bit PC. Currently, I have installed only the 32bit java and copy javaw.exe to the windows /system32 folder and it seems to work fine for the moment. However, if I connect MC to IB Gateway, it takes MC a few minutes to be able to receive data and to place orders which is highly unusual and defects the purpose of using the 64bit MC. I was able to find a workaround on how to install IB gateway in this link.

http://www.elitetrader.com/vb/showthrea ... genumber=2

I haven't tried it yet because I don't want to use too many workarounds when I use MC purely for auto-trading. Currently, I am using IB TWS instead of IB gateway as an interim solution because of the issue mentioned above. All the information I can find so far is just bit and pieces and I am not sure how the various workarounds may affect the system's stability over the long run. I'd like to know if there is proper and standard way to install IB TWS and IB Gateway in a windows7 64 bit pc to ensure my pc's smooth operation in the future. It would be very helpful if MC support can give us some input in this regard as more and more MC users are switching to MC 64 bit.

Any help would be greatly appreciated.



I would think the instruction in InteractiveBrokers' website is the authority.

atsui
Posts: 25
Joined: 03 Aug 2011
Has thanked: 5 times
Been thanked: 4 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby atsui » 09 May 2012

Thanks for your input. IB's website was actually the first place I look for instruction but I don't seem to be able to find anything on how to install IB TWS and gateway in a windows 64 bit pc, any pointer is greatly appreciated.

User avatar
Henry MultiСharts
Posts: 8394
Joined: 25 Aug 2011
Has thanked: 1201 times
Been thanked: 2682 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby Henry MultiСharts » 11 May 2012

Hello Andy,

There are no special installation steps or peculiarities that we are aware of while installing IB TWS on a 64 bit PC. The installation procedure is the same for x86 and x64 PC.

Though there are some peculiarities in MultiCharts and TWS communication.
If your TWS is localized (to Japanese for ex.) and you are unable to connect-you need to contact our technical support through the live chat (Mon-Fri 6.30am-4pm EST) or via email (support@multicharts.com) so that we can develop support for your localization.
If your TWS main windows name is different from a regular name (depends on current selected account ex. DF16055 IB TWS, you can check it when you place your cursor over IB icon on the Windows Taskbar or in the Windows Task Manager->Applications tab) and you are unable to connect-please contact us.

What is the exact version of TWS you are running?
What is the exact version and build number of MultiCharts you are running (help tab->About MultiCharts)?
What is the TWS main window name and language?
What exact part does take 3 minutes? 1) Launch TWS/Gateway by MultiCharts and connect or 2) just connect MultiCharts to already running TWS/Gateway?

atsui
Posts: 25
Joined: 03 Aug 2011
Has thanked: 5 times
Been thanked: 4 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby atsui » 11 May 2012

The version no. of my IB tws is 925.6b and MC version 8.0 beta 3(build 5375). I don't have any problem with TWS, it is Gateway that has issue.

I usually open Gateway first then MC. With MC 64bit, MC will then open a TWS login window again even Gateway is upand running.

http://dl.dropbox.com/u/40306543/quotemanager.PNG

You can see from the screen shot that MC tried to establish connection at 22:37 but still cannot connect at 22:50.

I don't seem to be able to find any standard procedure to install TWS in a windows 64bit machine in IB website. So I just follow the standard procedure and installed java 32bit first then TWS. Usually you will get a shortcut error message at this stage when you try to open TWS. I follow the workaround I find and copied javaw.exe to the windows/system32 folder. This way I can open TWS without the shortcut error. The fact that there is shortcut error means that the standard procedure is not catered for windows 64 bit machine.

IB gateway is an entire different story,sometimes I can receive quotes after a few minutes and then I was able to place order after another few minutes. Sometimes I cannot receive any quote at all. The fact that MC opens a TWS login window when it cannot receive any quotes suggests that MC may not be able to recognize the connection with Gateway.

My computer is a brand new dell optiplex with windows 7 professional 64bit.

User avatar
Henry MultiСharts
Posts: 8394
Joined: 25 Aug 2011
Has thanked: 1201 times
Been thanked: 2682 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby Henry MultiСharts » 14 May 2012

atsui wrote:The version no. of my IB tws is 925.6b and MC version 8.0 beta 3(build 5375). I don't have any problem with TWS, it is Gateway that has issue.
I usually open Gateway first then MC. With MC 64bit, MC will then open a TWS login window again even Gateway is upand running.

In QuoteManager->Tools->Data sources->IB make sure the port is the same as in IB Gateway.
"Launch TWS at start" should be disabled.

atsui wrote:You can see from the screen shot that MC tried to establish connection at 22:37 but still cannot connect at 22:50. IB gateway is an entire different story,sometimes I can receive quotes after a few minutes and then I was able to place order after another few minutes. Sometimes I cannot receive any quote at all.

Are all farms connected in IB Gateway when you start MultiCharts and try to plot a chart or place an order?
These users thanked the author Henry MultiСharts for the post:
atsui

atsui
Posts: 25
Joined: 03 Aug 2011
Has thanked: 5 times
Been thanked: 4 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby atsui » 15 May 2012

No entirely sure what happened but the connection is back to normal now. Didn't do anything on my part. The port number in Gateway and TWS is the same; the reason for the delay in receiving quotes and placing order upon opening MC is still a mystery but somehow seems to be able to self-correct. Anyway, thanks for your help and will post again if the issue comes back.
These users thanked the author atsui for the post:
Henry MultiСharts

atsui
Posts: 25
Joined: 03 Aug 2011
Has thanked: 5 times
Been thanked: 4 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby atsui » 09 Jun 2012

I have been advised by ib that it is necessary to install both 32 and 64bit Java in order for tws/gateway to function smoothly. May revert back to using gateway for trading to see if everything is OK.

evdl
Posts: 396
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 84 times
Been thanked: 122 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby evdl » 16 May 2013

Hello Atsui,

I know it is a older post, but did you manage to solve the issue with IB Gateway?

I like to use my papertrade account in combination with IB gateway (uninterrupted datacollection) and my live trading account in combination with IB TWS.

Ib gateway has port 4001 and also quotemanager has 4001. TWS and live account are on port 7498 (this is only for sending orders, not datacollecting).

I see the same issue you had (after a couple of minutes the Gateway connection seems ok, but does not collect data)

The strange thing is that it sometimes works ok and sometimes IB Gateway makes connection to quotemanager but does not collect data at all. The connection status in Gateway states the API is connected, but it does not do anything. And sometimes, Gateway does not connect at all.

Both 32 bit and 64 bit Java is installed and using webbased login for Gateway and TWS and MC8.5 latest release.

Any help appreciated. Thanks.

SUPER
Posts: 622
Joined: 03 Mar 2007
Has thanked: 99 times
Been thanked: 80 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby SUPER » 16 May 2013

On a 64bit Operating System it is essential you install both the 32 bit and 64 bit versions of Java. Please refer to the below directions for additional assistance:

Manually install the latest version of the Java Runtime Environment:

1) Open the link to the download page (http://www.oracle.com/technetwork/java/ ... index.html)
2) In the first section on this page - "Java Platform, Standard Edition", located the "Java SE 7 U9" and click on the blue Download button on the right beneath "JRE"


3) Click the Radial Button "Accept License Agreement"
4) Download the file with "Windows x86 offline", for 32 bit Java installation
5) Choose Save and then execute the downloaded file.
6) Download the file with "Windows x64", for 64 bit Java installation
7) Choose Save and then execute the downloaded file.


8) After this installation please restart your PC.

Regards,

Travis
IB Technical Support



I was advised by TWS team to delete temporary Java files on regular basis, as it can cause problems with data update when it gets to large or reaches its maximum limit.
Attachments
java.jpg
java.jpg (115.22 KiB) Viewed 865 times

evdl
Posts: 396
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 84 times
Been thanked: 122 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby evdl » 16 May 2013

Thanks Super, I will give clearing the cache a try.

SUPER
Posts: 622
Joined: 03 Mar 2007
Has thanked: 99 times
Been thanked: 80 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby SUPER » 17 May 2013

evdl,

One more thing I forgot to mention is to change your MaxPemSize to 1024M, you will be able to edit in the target location directly.

[img]tws1.jpg[/img]

tws1.jpg
tws1.jpg (60.5 KiB) Viewed 810 times

evdl
Posts: 396
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 84 times
Been thanked: 122 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby evdl » 17 May 2013

I am using the webbased login of TWS and Gateway. So I do not have this option to change the memory allocation.

In the meantime I deleted the cache. And started the IB gateway again. Till now it connects to MC. So far so good.

Have to see if it still works after a restart of mc and gateway.

evdl
Posts: 396
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 84 times
Been thanked: 122 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby evdl » 19 May 2013

On Friday night I closed MC and IB Gateway (all markets closed). Now on sunday I started Gateway and MC again.

I got the same issue I had before (except for not reconising MC at all). Gateway makes contact with mc (quotemanager) and then started to make connecting with the symbols I always collect.

Immediately QM tells me the max rate of messages per second had been exceeded and disconnect from gateway and reconnect again. It will come in a loop and does this over and over again.

Resulting in multiple clients in the gateway (not at the same time but client "tabs". Eventually Gateway will crash.

I can't get it to work stable. TWS is working ok. I am not sure if this is Gateway or the way MC is communicating with Gateway. Anyone who has the same issues with this?

In the attached pictures the quotemanager and gateway
Attachments
Gateway.png
Gateway.png (19.62 KiB) Viewed 761 times
Quotemanager.png
Quotemanager.png (140.36 KiB) Viewed 881 times

atsui
Posts: 25
Joined: 03 Aug 2011
Has thanked: 5 times
Been thanked: 4 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby atsui » 20 May 2013

Hi evdl,

1.Just want to clarify if you try to run one stance of gateway and one stance of tws at the same time? I tried to run two stance of tws/gateway for connection to MC at the same time without any success. I used different IB profiles for connection to different markets using multiple tws/gateway but MC can only use one profile at a time.

2. Also I assume that your simulation account for data collection is not created under the same actual account that you use for trading because you are not allowed to receive data from both accounts at the same time. Therefore when you login to your actual account, your sim account fails to receive data.

3. I am curious to know about your experience with gateway. My experience is that it takes a few seconds for MC to starting receiving data from gateway after opening the workspace whereas when using TWS, the time to establish connection is much faster. I don't have the chance to test the data arrival rate using tws vs gateway because of the issue mentioned in 1. above.

4. My experience is that the exceed of max message of 50 per second may relate to order placement, althought you may not be able to see it in MC's order window.

5. The quality of data from sim account is somehow inferior to that from the actual account, i receive bad ticks once in a while using sim account and it seems to me that the data refresh rate is also lower under sim account. It may therefore be advantagous to use actual account for data collection.

Hope it helps.

evdl
Posts: 396
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 84 times
Been thanked: 122 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby evdl » 20 May 2013

Hello atsui,

Thanks for your reply. I try to answer you according to the points you made:

1) I use one live account (IB gateway) and one sim account (TWS) at the same time with one MC. The port number (4001) of quotemanager has the same number as the IB gateway (also 4001). So I can collect data 24/7 without logoff. With the TWS account I don't collect data. I only use this to send orders and therefor the portnumber (7496) needs to be the same in MC(chart part, also 7496). I am now testing my new strategy on sim, but once I go live again I do this the otherway around. So I can have a view on what is happening on the IB side in TWS.

2) The sim account is created under the same live account that I use to trade with and both accounts have data. This is only if you use the sim and live account on the same PC. Otherwise one of the accounts will have no realtime data and will log one of the accounts off.

3) My experience with IB gateway till now is that it is not stable. Sometimes it works and it will collect data for 2 days in a row. The other moment it gives all sorts of error messages (like the max rate message or reconnecting all the time). Also sometimes when you restart IB gateway (end of the week), it will connect to quotemanager but it will take some minutes. And sometimes it will not connect at all to quotemanager. The only thing that will help is restart the pc.

4) In the current setup I use IB gateway only for datacollecting and not for order sending.

5) I did not compare quality of data between gateway or TWS so I can not comment on that.

If you look at the windows processmanager it looks like the javaw.exe for both TWS and IB gateway are interfering with each other. There are two javaw.exe if you have both running. And when Ib gateway is collecting data the javaw.exe uses processor capacity. But at the same time also the TWS javaw.exe is using processor capacity and memory, although the TWS javaw.exe is not collecting data or does anything. So I suspect these two instances of TWS and gateway are somehow not cooperation together. But that is just my opinion and not a fact. I don't know.

But all this aside, if I only use the IB gateway and no TWS, it also is not stable and I can't get it to run for let's say 3 or 4 days in a row without causing trouble. At the moment I am not using gateway anymore because it just doesn't work. If I only use TWS, it works great.

What I would like to know, if this is something with IB gateway or with the datafeed.dll of MC or both?

May I ask MC to comment on this, if this is a known issue?

Thanks
Edwin

atsui
Posts: 25
Joined: 03 Aug 2011
Has thanked: 5 times
Been thanked: 4 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby atsui » 20 May 2013

It seems to me that the best bet may be to do a fresh re-install of MC and Java and make sure installing java32 first then java64. That's what I did and it works fine using gateway now althought somehow I have the feeling that using TWS is still more stable.

User avatar
Henry MultiСharts
Posts: 8394
Joined: 25 Aug 2011
Has thanked: 1201 times
Been thanked: 2682 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby Henry MultiСharts » 24 Oct 2013

evdl, do you still have this issue with the latest version of MultiCharts? Are you using both - gateway and TWS for data in MultiCharts?

evdl
Posts: 396
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 84 times
Been thanked: 122 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby evdl » 24 Oct 2013

Hello Henry,

I did not try anymore after my last post because it took me to much time to figure it out.

So I don't know if it will work with the current MC version.

The idea was to harvest data with my papertrade account, also overnight, with IB Gateway. And use the live trade account with IB TWS for trading. During trading hours it will run simultanious and I have the possibility to check in TWS how the trades are going or in case connection is lost with MC, I have TWS to control my trades. At the end of the tradingday, TWS will be closed and the gateway will continue harvesting data.

Both will use data in MC. The gateway for data harvesting en TWS for displaying price updates on charts and sending orders.

User avatar
Henry MultiСharts
Posts: 8394
Joined: 25 Aug 2011
Has thanked: 1201 times
Been thanked: 2682 times

Re: How to properly install IB TWS and IB gateway in Win7 64

Postby Henry MultiСharts » 04 Nov 2013

Hello evdl,

I have consulted with our engineers regarding your case.
How many IB broker profiles do you have connected in MultiCharts?
Are all of them connected to TWS or multiple TWS?
Do you use IB connection for Manual trading or Automated trading or both?
Do you use DOM for IB instruments in MultiCharts?
When you restart TWS and/or Gateway – do you disconnect the respective broker profiles in MultiCharts?
Apart from Gateway not being able to keep the connection/stability – is there any outstanding issue with IB – MultiCharts connection?
Please send us the logs for analysis when you experience this behavior - MultiCharts connection to IB connection takes too long/has errors with the steps leading to this behavior. In this case we will be able to study the situation.

There were gateway connection/stability issues reported by some of our clients before, but as our analysis has shown - they were not caused by MultiCharts.


Return to “MultiCharts”