Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Nymphodora), 972 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Getting started with the IB API #460920
07/20/16 17:17
07/20/16 17:17
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
I have a demo account for IB, have installed the IB Gateway, and am trying to get Zorro to connect. I'm getting the following error message whenever I click on "Trade":

"!The TWS is out of date and must be upgraded."

This is odd, as I literally just downloaded it today from here:
https://www.interactivebrokers.com/en/index.php?f=16457

Is this not the right location to get the API, or am I doing something else wrong?

After the above error message, I'm also getting this error:

"Couldn't connect to TWS. Confirm that "Enable A..."

Where you see "..." the message is cut off. It is not clear to me how I can see the rest of the error message. Any ideas?

Thanks!

Re: Getting started with the IB API [Re: Cstyle] #460941
07/21/16 09:00
07/21/16 09:00
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
I can't answer why your TWS is out of date - that's an issue for IB support - but you can see the rest of the error message in the log. Alternatively, double click into the message window - that will copy the message to the clipboard.

Re: Getting started with the IB API [Re: jcl] #461026
07/22/16 22:22
07/22/16 22:22
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
Thanks for the double click advice. Very useful.

For some reason today, even though I've not changed anything, I'm no longer getting the error message for TWS being out of date. Instead, I'm getting this:

"Login IB (demo)..
!IB Socket connected at UTC 22.07. 22:18
!Account DU424687
Subscribe TSLA
!Requested market data is not subscribed.Error&BEST/STK/Top&BEST/STK/Top
Error 053: TSLA not available at this time
No bars generated
Logout.. ok
Copied to Clipboard!"

Is it because the markets are now closed? I realize I'm not going to be able to trade in the demo account with the markets closed, but I'm just trying to test connecting zorro to IB. Please advise.

Thanks!

Re: Getting started with the IB API [Re: Cstyle] #461104
07/25/16 21:43
07/25/16 21:43
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
Any advice?

Re: Getting started with the IB API [Re: Cstyle] #461115
07/26/16 08:53
07/26/16 08:53
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
IB already advised you: subscribe their market data.

Also look in the manual under "IB" about what you need to know for trading with IB.

Re: Getting started with the IB API [Re: jcl] #461131
07/26/16 14:54
07/26/16 14:54
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
I am subscribed to their data, through my primary account. I do not (yet) want to connect zorro to my live account and trade with it until I've done some trading in my paper account. Do I have to subscribe to data in my paper account as well?

Re: Getting started with the IB API [Re: Cstyle] #461137
07/26/16 15:38
07/26/16 15:38
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
I don't think so. I can trade with my paper and normal account, but have certainly not twice paid for market data. Maybe you have to activate your subscription for the paper account also. Contact IB support - they should know.

Re: Getting started with the IB API [Re: jcl] #461140
07/26/16 16:25
07/26/16 16:25
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
Originally Posted By: jcl
I don't think so. I can trade with my paper and normal account, but have certainly not twice paid for market data. Maybe you have to activate your subscription for the paper account also. Contact IB support - they should know.


You're right. I had to activate it for the paper account. By default it is not active, which is kind of stupid in my opinion, but at least I was able to resolve it. Thanks!

Having said that, while z8 now runs and I can see in my IB portfolio that it did in fact execute some buy orders, I'm still getting errors from zorro:

Quote:
Trade Z8 portfolio (NFA) 26.07.2016
Error 062: Can't open Z8.par (rt:2)
Lookback period (252 bars).

What is error 062?

And I'm also getting a bunch of these warnings:

Quote:
XLU: Open: 0 New: 9
!Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.
[XLU::L0105] Long 9@52.24
XLV: Open: 0 New: 4
!Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.
[XLV::L0106] Long 4@74.76
Quit
Logout.. ok


Is it safe to ignore the Order Event Warnings?

Thanks!

Last edited by Cstyle; 07/26/16 16:26.
Re: Getting started with the IB API [Re: Cstyle] #461230
07/29/16 19:14
07/29/16 19:14
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
Quote:
Trade Z8 portfolio (NFA) 26.07.2016
Error 062: Can't open Z8.par (rt:2)
Lookback period (252 bars).


This anything to worry about? Just looking up that error in help I get:

Quote:
A file was not found or could not be opened. Check the file name and make sure that the file exists and is not opened in another application.


I did a search through the zorro install directory and z8.par was not found.

Please advise.

Re: Getting started with the IB API [Re: Cstyle] #461238
07/30/16 07:12
07/30/16 07:12
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
You can ignore the message. - In case of such problems, look also in the recent bug list. Normally such a problem was already encountered by other people and is commented in the list.

Re: Getting started with the IB API [Re: jcl] #461366
08/02/16 23:49
08/02/16 23:49
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
Originally Posted By: jcl
You can ignore the message. - In case of such problems, look also in the recent bug list. Normally such a problem was already encountered by other people and is commented in the list.


Good to know. Thanks a million!

Re: Getting started with the IB API [Re: jcl] #461451
08/05/16 20:33
08/05/16 20:33
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
I'm not sure why I'm getting some of these messages in the log when I trade a strategy with the IB API:

Quote:
PennyPicker9
Login IB (demo)..
!IB Socket connected
!Real account not supported
!Account DUXXXXXX at UTC 03.08. 13:37
Loading AMLP prices.. 12000 min
Warning 034: No asset data for GDX
Loading GDX prices..
!Historical Market Data Service error message:Historical data request pacing violation
!No historical data query found for ticker id:17
!Historical Market Data Service error message:Historical data request pacing violation
!No historical data query found for ticker id:18
!Historical Market Data Service error message:Historical data request pacing violation
!No historical data query found for ticker id:19
!Historical Market Data Service error message:Historical data request pacing violation
!No historical data query found for ticker id:20
!Historical Market Data Service error message:Historical data request pacing violation
!No historical data query found for ticker id:21 . 12000 min
Warning 034: No asset data for REM
Loading REM prices.. 12000 min
Warning 034: No asset data for GYLD
Loading GYLD prices.. 12000 min
Warning 034: No asset data for UNG
Loading UNG prices.. 12000 min

Trade: PennyPicker9 portfolio 03.08.2016
Lookback period (500 bars)
[82: Tue 19.07.16 18:40] 999977 +0 +0 .
[83: Tue 19.07.16 19:00] 999977 +0 +0
[84: Tue 19.07.16 19:20] 999977 +0 +0
[85: Tue 19.07.16 19:40] 999977 +0 +0
[86: Tue 19.07.16 20:00] 999977 +0 +0
[87: Tue 19.07.16 20:20] 999977 +0 +0
...


Any advice?

Last edited by Cstyle; 08/05/16 20:33.
Re: Getting started with the IB API [Re: Cstyle] #461733
08/18/16 17:55
08/18/16 17:55
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
All of a sudden I'm no longer able to connect to the API:

Code:
PennyPicker9 compiling..............
IB.dll => IB (demo) plugin mounted
Login IB (demo)..
!Couldn't connect to TWS.  Confirm that "Enable ActiveX and Socket Clients" is enabled on the TWS "Configure->API" menu. 
!TWS Gateway running? Port =  4002
Can't connect!



When I look under IB's API settings I don't even see "Enable ActiveX and Socket Clients":

https://goo.gl/photos/87tchGU6At3ys6KFA

Any advice?

Thanks!

Re: Getting started with the IB API [Re: Cstyle] #461744
08/19/16 09:49
08/19/16 09:49
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
How to set up the TWS is also described in the manual under "IB".

Re: Getting started with the IB API [Re: jcl] #461753
08/19/16 11:32
08/19/16 11:32
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline
Junior Member
mhdus  Offline
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
Check the socket port: As far as I remember, the full-blown TWS is using 4002 by default while the API Gateway is using 7496 (or vice versa). Both can be changed, of course. I believe you have a mismatch between Zorro and the API settings.

Re: Getting started with the IB API [Re: mhdus] #461759
08/19/16 15:19
08/19/16 15:19
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
Originally Posted By: jcl
How to set up the TWS is also described in the manual under "IB".


Right. I've compared what I have with what is in the manual. They match exactly, with the only exception being I don't have "Enable ActiveX and Socket Clients" as an option. Please take a look at what I'm seeing:

https://goo.gl/photos/87tchGU6At3ys6KFA

I'm not sure what else I can do to resolve this. Any help that can be provided would be great!

Re: Getting started with the IB API [Re: mhdus] #461760
08/19/16 15:21
08/19/16 15:21
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
Originally Posted By: mhdus
Check the socket port: As far as I remember, the full-blown TWS is using 4002 by default while the API Gateway is using 7496 (or vice versa). Both can be changed, of course. I believe you have a mismatch between Zorro and the API settings.


Per the zorro manual I have socket port set to 7496. You can see what I have here: https://goo.gl/photos/87tchGU6At3ys6KFA

What should I try next?

Thanks!

Re: Getting started with the IB API [Re: Cstyle] #461761
08/19/16 15:28
08/19/16 15:28
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
There are only 2 opportunities to enter a wrong number. If it's not the socket port, then you maybe took your chance with the "User" field?

Re: Getting started with the IB API [Re: jcl] #461769
08/19/16 20:01
08/19/16 20:01
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline
Junior Member
mhdus  Offline
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
Well, your error log from Zorro says: "!TWS Gateway running? Port = 4002"
so it looks as if you have entered 1 as User in Zorro. For Socket port 7496 you need to enter 101 as the User in Zorro. Alternatively you can enter 4002 as the Socket port in the API Settings, of course, and keep User 1 in Zorro.
@jcl: maybe it would be easier to explain in the manual how to apply the SAME Socket port number in both, full TWS and Gateway - to avoid such confusion and surprises as users might switch between Gateway and TWS quite often. Just a thought.

Re: Getting started with the IB API [Re: mhdus] #461976
08/31/16 17:04
08/31/16 17:04
Joined: Jun 2016
Posts: 33
NC
C
Cstyle Offline OP
Newbie
Cstyle  Offline OP
Newbie
C

Joined: Jun 2016
Posts: 33
NC
I had entered my IB username in the Zorro user field. I switched it to 101 and was able to connect. Thank you mhdus!!!

Re: Getting started with the IB API [Re: Cstyle] #462490
10/04/16 15:53
10/04/16 15:53
Joined: Jul 2016
Posts: 7
R
Rockfish Offline
Newbie
Rockfish  Offline
Newbie
R

Joined: Jul 2016
Posts: 7
Hi,
Can you activate it for the Paper account yourself or do the support at IB do this?

This might also answer why i get the following message:
"Z3 (oP group) ..
IB.dll => Interactive Brokers plugin mounted
Login Interactive Brokers..
!IB Socket connected at UTC 04.10. 17:46
Z3.45: PH M 100 H 5 W 2 V 2
Error 053: XAG/USD not available at this time
Error 053: XAU/USD not available at this time
Error 053: SPX500 not available at this time
Error 053: US30 not available at this time
Error 053: NAS100 not available at this time
No bars generated
Logout.. ok
"

Kind regards
Jp

Re: Getting started with the IB API [Re: Rockfish] #462493
10/04/16 17:05
10/04/16 17:05
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
There is no activation. IB is not really suited for trading Z3, but if you still want to do it, read on the "IB" page in the manual how to subscribe market data, obtain trading permissions, and select the correct symbols. It is not as simple as with other brokers, but manageable.

Re: Getting started with the IB API [Re: jcl] #462494
10/04/16 17:18
10/04/16 17:18
Joined: Jul 2016
Posts: 7
R
Rockfish Offline
Newbie
Rockfish  Offline
Newbie
R

Joined: Jul 2016
Posts: 7
Thank you JCL, i have double checked that i have shared data on the IB account pages so... back to the manual. laugh

I have also spend the day opening an FXCM account, it just provides me with FX pairs. But my friend has access to Index and gold for the Z3. Are there any changes/settings i need to take into account?

Thanks!

Last edited by Rockfish; 10/04/16 17:19.
Re: Getting started with the IB API [Re: Rockfish] #462495
10/04/16 18:17
10/04/16 18:17
Joined: Jul 2016
Posts: 7
R
Rockfish Offline
Newbie
Rockfish  Offline
Newbie
R

Joined: Jul 2016
Posts: 7
Originally Posted By: Rockfish
Thank you JCL, i have double checked that i have shared data on the IB account pages so... back to the manual. laugh

I have also spend the day opening an FXCM account, it just provides me with FX pairs. But my friend has access to Index and gold for the Z3. Are there any changes/settings i need to take into account?

Thanks!


The support desk at FXCM gave me the access.

Re: Getting started with the IB API [Re: jcl] #464215
01/27/17 20:31
01/27/17 20:31
Joined: Jan 2017
Posts: 4
Not Applicable
D
drzhous Offline
Guest
drzhous  Offline
Guest
D

Joined: Jan 2017
Posts: 4
Not Applicable
Hi JCL,

Does Zorro 1.50 support IB live account? I installed the version but only see FXCM, IB(demo), MT4(demo) and Oanda V1 demo.

Re: Getting started with the IB API [Re: drzhous] #464240
01/30/17 14:53
01/30/17 14:53
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
For IB live you need to subscribe Zorro S. You can find a list of all differences of Zorro and Zorro S here: http://manual.zorro-project.com/restrictions.htm

Page 1 of 3 1 2 3

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1