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 (monk12, Quad), 830 guests, and 4 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 2 1 2
Interactive Brokers Futures Symbology Not Recognised #464110
01/23/17 06:26
01/23/17 06:26
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
I'm trying to trade a simple futures strategy via Interactive Brokers. I get an error from the IB side:

Error validating request:-'bm' : cause - Please enter a local symbol or an expiry

I've been on the line with IB tech support and they say that the only way this error can arise is due to a contract misspecification on my side. IB told me that these are the strings that correspond to the parts of their API's 'contract' object:
Symbol = ES, SecType = FUT, Expiry 201703, Exchange = GLOBEX, Currency = USD

I can confirm that entring ES-FUT-201703-ESH7 in the 'Symbol' column of my AssetsFix.csv file (which is how I interpret the futures example in the Zorro manual), I get the error described above. This results in a 'Error 53: ES-FUT-201703-ESH7 unavailable at this time' on the Zorro side.

I have also tried using all the combinations of Symbol-LocalSymbol-Expiry-FUT-Exchange-Currency that I could think of, but the error persists, including the full contract expiry date (20170317).

Also confirming that I do have this data subscribed and active in my IB TWS and my account is permissioned for US futures.

Could this be a bug in the IB bridge or am I doing something obviously wrong?

Re: Interactive Brokers Futures Symbology Not Recognised [Re: boatman] #464592
02/28/17 08:47
02/28/17 08:47
Joined: Feb 2017
Posts: 20
G
Gloria Offline
Newbie
Gloria  Offline
Newbie
G

Joined: Feb 2017
Posts: 20
Hi,

I have basically the same question.

Zorro: 1.50 free version
IB TWS: 952.3b (with the standard demo account user "edemo", pwd "demouser")

For the demo account, IB streams simulated ticks for a number of instruments, for example for "MSFT" (US stock). Zorro does receive these ticks when I set in AssetsFix.csv

MSFT,64.1600,0.01000,0.0000,0.0000,0.0000,0.000000,0.0000,0.000,0.0,0.000,MSFT

IB also streams simulated ticks for the Eurex Dax Future, March 2017 contract. However, when I try in AssetsFix.csv the line

FDAX,11985.50,0.50,0.50,0.50,0.0,0.0,0.0,1.0,25,3.5,DAX-FUT-20170317-FDAX

I get the error message:

<strategy name>
Login IB (demo)..
!IB Socket connected
!Account DU<number>
!Marktdaten Farm Verbindung ist OK:ibdemo
!HMDS Daten Farm Verbindung ist OK:demohmds at UTC 28.02. 08:26
Subscribe FDAX
!Fehler bei der Anfragebestätigung:-'zd' : Grund - Please enter a local symbol or an expiry
Error 053: DAX-FUT-20170317-FDAX unavailable at this time
Error 055: No FDAX prices
Logout.. ok

I also tried some obvious variations such as "201703" for the expiry, etc., no result.

Any idea?

Kind regards,

Gloria

Re: Interactive Brokers Futures Symbology Not Recognised [Re: Gloria] #464633
03/02/17 13:20
03/02/17 13:20
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
It won't work with 1.50. Futures are only supported with the latest version, 1.54.

For downloading you need no change to AssetsFix, you can enter the symbol directly in the yellow field on top of the Download panel. F.i. ES-FUT-20170915-ES-GLOBEX-USD.

Re: Interactive Brokers Futures Symbology Not Recognised [Re: jcl] #464755
03/08/17 14:58
03/08/17 14:58
Joined: Feb 2017
Posts: 20
G
Gloria Offline
Newbie
Gloria  Offline
Newbie
G

Joined: Feb 2017
Posts: 20

Thank you. Meanwhile I installed 1.54, but there is still an issue.

Whereas
Code:
int i = contractUpdate ("ES",1,FUTURE);


returns 9 contracts for the S&P 500 E-Mini future, and the IB TWS log file plausibly says
Code:
10:26:54:545 -> 8-1-10:25-
10:26:54:545 -> 54-1-DU<account>-
10:26:54:549 <- 9-7-3-0-ES-FUT--0----USD---0---
10:26:54:742 -> 10-8-3-ES-FUT-20170317-0--GLOBEX-USD-ESH7-ES-ES-215465490-0.25-50-ACTIVETIM,ADJUST,ALERT,ALGO,ALLOC,AVGCOST,BASKET,COND,CONDORDER,DAY,DEACT,DEACTDIS,DEACTEOD,GAT,GTC,GTD,GTT,HID,ICE,IOC,LIT,LMT,LTH,MIT,MKT,MTL,NGCOMB,NONALGO,OCA,PEGBENCH,SCALE,SCALERST,SNAPMID,SNAPMKT,SNAPREL,STP,STPLMT,TRAIL,TRAILLIT,TRAILLMT,TRAILMIT,WHATIF-GLOBEX-1-11004968-E-mini S&P 500--201703----CST-20170308:1700-1515,1530-1600;20170309:1700-1515,1530-1600-20170308:0830-1515,1530-1600;20170309:0830-1515,1530-1600---0-


and so on, I cannot get the contracts of the Eurex Dax Future. In TWS your enter the symbol "DAX", then choose "Future", then select an expiry month. I do have live ticks for it.

When I run in Zorro
Code:
i = contractUpdate ("DAX",1,FUTURE);


it finds zero contracts, and the IB TWS logs show an error:
Code:
10:03:09:224 -> 8-1-10:01-
10:03:09:224 -> 54-1-DU<account>-
10:03:09:224 <- 9-7-2-0-DAX-FUT--0----USD---0---
10:03:09:464 -> 4-2-2-200-No security definition has been found for the request-
10:03:16:668 -> 4-2--1-2108-Market data farm connection is inactive but should be available upon demand.cashfarm-


Why does it say "USD" for the Dax Future? It ought to be "EUR". Where can I set the currency so that Zorro asks TWS for the right contract?

Thanks for your help. Kind regards,

Gloria

Re: Interactive Brokers Futures Symbology Not Recognised [Re: Gloria] #464770
03/09/17 18:41
03/09/17 18:41
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes, DAX is traded in EUR and also at a different exchange. So I would use "DAX-IDX-SMART-EUR" for the underlying. Possibly you need to replace "SMART" with the exchange symbol that you can see in the TWS.

Re: Interactive Brokers Futures Symbology Not Recognised [Re: jcl] #464920
03/16/17 15:05
03/16/17 15:05
Joined: Feb 2017
Posts: 20
G
Gloria Offline
Newbie
Gloria  Offline
Newbie
G

Joined: Feb 2017
Posts: 20
Unfortunately, I have still not been able to get any Eurex futures prices into Zorro.

I made some progress using your previous hint. The Zorro code
Code:
int i = contractUpdate ("DAX-IDX-SMART-EUR",1,FUTURE);


now returns 6, and the IB TWS log file at least shows that the contract details of the three current Dax and the three current Dax mini futures have been sent to Zorro:
Code:
<snip>
WI 15:56:06:670 JTS-EServerSocket-410: [101:63:76:1:0:0:0:INFO] Handling incoming ReqContractDtails message.
WI 15:56:06:670 JTS-EServerSocket-410: [101:63:76:1:0:0:0:DET] Started reading message:
WI 15:56:06:670 JTS-EServerSocket-410: [101:63:76:1:0:0:0:DET] Finished reading message:
WI 15:56:06:670 JTS-EServerSocket-410: [101:63:76:1:0:0:0:DET] wd::[version=7,ID=3,reqDesc=Symbol=DAX  Type=FUT  Expiry=null  Strike=0.0  Put/Call=?  Exchange=null  CompExch=null  Currency=EUR  Multiplier=null IbLocalSymbol=null  IbTradingClass=null  SecIdType=NULL  SecId=null  includeExpired=false  needLeadFutureMonth=false  needContinuousLeadFutureOnly=false  newsSource=null  Legs=null  Special Info=null,action=null]
WI 15:56:06:670 JTS-EServerSocket-410: [101:63:76:1:0:0:0:DET] [9;7;0;DAX;FUT;null;0.0;2;null;null;EUR;null;null;false;false;NULL;null]
WI 15:56:06:670 JTS-EServerSocket-410: [101:63:76:1:0:0:0:DET] Start validating message:
WI 15:56:06:670 JTS-EServerSocket-410: [101:63:76:1:0:0:0:DET] Finished validating message:
WI 15:56:06:670 JTS-EServerSocket-410: [101:63:76:1:0:0:0:DET] Started processing message:
WI 15:56:06:670 JTS-EServerSocket-410: [101:63:76:1:0:0:0:INFO] Requested contract details.
WI 15:56:06:670 JTS-EServerSocket-410: [101:63:76:1:0:0:0:DET] Finished processing message:
WI 15:56:06:854 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Sending contract details.
WI 15:56:06:854 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:DET] [10;8;DAX;FUT;20170317;0;2;DTB;EUR;FDAX MAR 17;FDAX;FDAX;237123039;0.5;25;ACTIVETIM,ADJUST,ALERT,ALGO,ALLOC,AVGCOST,BASKET,COND,CONDORDER,DAY,DEACT,DEACTDIS,DEACTEOD,GAT,GTC,GTD,GTT,HID,ICE,IOC,LIT,LMT,MIT,MKT,MTL,NGCOMB,NONALGO,OCA,PEGBENCH,REL,SCALE,SCALERST,SNAPMID,SNAPMKT,SNAPREL,STP,STPLMT,TRAIL,TRAILLIT,TRAILLMT,TRAILMIT,WHATIF;DTB;825711;DAX 30 Index (Deutsche Aktien Xchange 30);;201703;;;;MET;20170316:0800-2205;20170317:0800-1300;20170316:0800-2205;20170317:0800-1300;0;;]
WI 15:56:06:855 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Contract details sent.
WI 15:56:06:857 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Sending contract details.
WI 15:56:06:857 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:DET] [10;8;DAX;FUT;20170317;0;2;DTB;EUR;FDXM MAR 17;FDXM;FDXM;237123146;1.0;5;ACTIVETIM,ADJUST,ALERT,ALGO,ALLOC,AVGCOST,BASKET,COND,CONDORDER,DAY,DEACT,DEACTDIS,DEACTEOD,GAT,GTC,GTD,GTT,HID,ICE,IOC,LIT,LMT,MIT,MKT,MTL,NGCOMB,NONALGO,OCA,PEGBENCH,REL,SCALE,SCALERST,SNAPMID,SNAPMKT,SNAPREL,STP,STPLMT,TRAIL,TRAILLIT,TRAILLMT,TRAILMIT,WHATIF;DTB;825711;DAX 30 Index (Deutsche Aktien Xchange 30);;201703;;;;MET;20170316:0800-2205;20170317:0800-1300;20170316:0800-2205;20170317:0800-1300;0;;]
WI 15:56:06:857 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Contract details sent.
WI 15:56:06:859 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Sending contract details.
WI 15:56:06:860 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:DET] [10;8;DAX;FUT;20170616;0;2;DTB;EUR;FDAX JUN 17;FDAX;FDAX;248032161;0.5;25;ACTIVETIM,ADJUST,ALERT,ALGO,ALLOC,AVGCOST,BASKET,COND,CONDORDER,DAY,DEACT,DEACTDIS,DEACTEOD,GAT,GTC,GTD,GTT,HID,ICE,IOC,LIT,LMT,MIT,MKT,MTL,NGCOMB,NONALGO,OCA,PEGBENCH,REL,SCALE,SCALERST,SNAPMID,SNAPMKT,SNAPREL,STP,STPLMT,TRAIL,TRAILLIT,TRAILLMT,TRAILMIT,WHATIF;DTB;825711;DAX 30 Index (Deutsche Aktien Xchange 30);;201706;;;;MET;20170316:0800-2205;20170317:0800-2205;20170316:0800-2205;20170317:0800-2205;0;;]
WI 15:56:06:860 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Contract details sent.
WI 15:56:06:864 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Sending contract details.
WI 15:56:06:864 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:DET] [10;8;DAX;FUT;20170616;0;2;DTB;EUR;FDXM JUN 17;FDXM;FDXM;248032234;1.0;5;ACTIVETIM,ADJUST,ALERT,ALGO,ALLOC,AVGCOST,BASKET,COND,CONDORDER,DAY,DEACT,DEACTDIS,DEACTEOD,GAT,GTC,GTD,GTT,HID,ICE,IOC,LIT,LMT,MIT,MKT,MTL,NGCOMB,NONALGO,OCA,PEGBENCH,REL,SCALE,SCALERST,SNAPMID,SNAPMKT,SNAPREL,STP,STPLMT,TRAIL,TRAILLIT,TRAILLMT,TRAILMIT,WHATIF;DTB;825711;DAX 30 Index (Deutsche Aktien Xchange 30);;201706;;;;MET;20170316:0800-2205;20170317:0800-2205;20170316:0800-2205;20170317:0800-2205;0;;]
WI 15:56:06:864 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Contract details sent.
WI 15:56:06:867 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Sending contract details.
WI 15:56:06:867 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:DET] [10;8;DAX;FUT;20170915;0;2;DTB;EUR;FDAX SEP 17;FDAX;FDAX;259034591;0.5;25;ACTIVETIM,ADJUST,ALERT,ALGO,ALLOC,AVGCOST,BASKET,COND,CONDORDER,DAY,DEACT,DEACTDIS,DEACTEOD,GAT,GTC,GTD,GTT,HID,ICE,IOC,LIT,LMT,MIT,MKT,MTL,NGCOMB,NONALGO,OCA,PEGBENCH,REL,SCALE,SCALERST,SNAPMID,SNAPMKT,SNAPREL,STP,STPLMT,TRAIL,TRAILLIT,TRAILLMT,TRAILMIT,WHATIF;DTB;825711;DAX 30 Index (Deutsche Aktien Xchange 30);;201709;;;;MET;20170316:0800-2205;20170317:0800-2205;20170316:0800-2205;20170317:0800-2205;0;;]
WI 15:56:06:867 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Contract details sent.
WI 15:56:06:869 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Sending contract details.
WI 15:56:06:869 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:DET] [10;8;DAX;FUT;20170915;0;2;DTB;EUR;FDXM SEP 17;FDXM;FDXM;259034742;1.0;5;ACTIVETIM,ADJUST,ALERT,ALGO,ALLOC,AVGCOST,BASKET,COND,CONDORDER,DAY,DEACT,DEACTDIS,DEACTEOD,GAT,GTC,GTD,GTT,HID,ICE,IOC,LIT,LMT,MIT,MKT,MTL,NGCOMB,NONALGO,OCA,PEGBENCH,REL,SCALE,SCALERST,SNAPMID,SNAPMKT,SNAPREL,STP,STPLMT,TRAIL,TRAILLIT,TRAILLMT,TRAILMIT,WHATIF;DTB;825711;DAX 30 Index (Deutsche Aktien Xchange 30);;201709;;;;MET;20170316:0800-2205;20170317:0800-2205;20170316:0800-2205;20170317:0800-2205;0;;]
WI 15:56:06:870 JTS-CCPDispatcherS1-32: [101:63:76:1:0:10:8:INFO] Contract details sent.
WI 15:56:06:870 JTS-CCPDispatcherS1-32: [101:63:76:1:0:52:1:INFO] Sending contract details end.
WI 15:56:06:870 JTS-CCPDispatcherS1-32: [101:63:76:1:0:52:1:INFO] Contract details end sent.
<snip>


Can you take a look at this log and tell me what I need to type into the "Single Asset" field of the "Download" program in order to read prices from IB?
What line do I need to add to AssetsFix.csv in order to use "plotCurve" and display a chart?

Thanks for your help. Kind regards,

Gloria

Last edited by Gloria; 03/16/17 15:08.
Re: Interactive Brokers Futures Symbology Not Recognised [Re: Gloria] #464952
03/20/17 09:40
03/20/17 09:40
Joined: Nov 2016
Posts: 9
Frankfurt
M
mig Offline
Newbie
mig  Offline
Newbie
M

Joined: Nov 2016
Posts: 9
Frankfurt
Hi,
I had the same problems myself…..drove me crazy…

Here is what I found out by now, confirmed by the developers:

1. For futures you can only download historical prices via Zorro for contracts that are still live..not for any expired contracts…!!
Via the Download script for EUREX and the FDAX (25 Multiplier) you can do that currently for the JUN17 / SEP17 / DEC17
2. So for the current front month future you have to type the following contract name in the “Single Asset” field: DAX-FUT-20170616-FDAX-DTB-EUR
3. Or you can add the following line on the AssetsIB sheet:
DAX-FUT-2017061,12097.00,1.00000,0.0000,0.0000,0.5000,12.500000,24648.9590,11.911,1.0,4.000,DAX-FUT-20170616-FDAX-DTB-EUR
I updated the missing parameters manually to match IB standard Margin and commission rates, as IB send only the last price…nothing else
4. If you want to use this specific asset in your script you need to add the following line:
asset("DAX-FUT-2017061");
5. For downloading historical prices, you need to do this manually for example via the IB API and the DDE sheet and convert those to .csv and then .t6 format to use them for backtests
IB allows you to download data for expired contracts up to 2 years back only, so currently the last available contract would be JUN/15, max. time frame is 1 Minute candles (in fact 30 sec. would work as well , but I am not sure if this makes a lot of sense)
Here is the link to the IB Tutorial:
http://interactivebrokers.github.io/tws-api/dde_tutorial.html#gsc.tab=0
6. Unfortunately, Zorro (via the IB Bridge) is not able to download the volume data for the respective candles yet…. I hope this will change…&#128521; http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=446748&page=6

That should work.
Good luck.
Best
Michael

Re: Interactive Brokers Futures Symbology Not Recognised [Re: mig] #465079
03/29/17 13:43
03/29/17 13:43
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
For options and futures, normally only existing contracts can be read, not expired contracts. But try the asset type "FUTX" instead of "FUT" for expired contracts, f.i. "DAX-FUTX-DateOfExpiry-FDAX-DTB-EUR"

Re: Interactive Brokers Futures Symbology Not Recognised [Re: jcl] #465093
03/31/17 08:08
03/31/17 08:08
Joined: Nov 2016
Posts: 9
Frankfurt
M
mig Offline
Newbie
mig  Offline
Newbie
M

Joined: Nov 2016
Posts: 9
Frankfurt
unfortunately this does not work...tried it with JUN/15 & SEP/15 FDAX
this is the Error message received:
Download compiling...........
Login Interactive Brokers..
!IB Socket connected
!Account DUxxxxx at UTC 31.03. 08:05
Download...
!Error validating request:-'br' : cause - Please enter a valid security type DAX-FUTX--0--20150918--FDAX
!Error validating request:-'br' : cause - Please enter a valid security type DAX-FUTX--0--20150918--FDAX
Error 053: DAX-FUTX-20150918-FDAX-DTB-EUR unavailable at this time
!Error validating request:-'bo' : cause - Please enter a valid security type DAX-FUTX--0--20150918--FDAX

Re: Interactive Brokers Futures Symbology Not Recognised [Re: mig] #465132
04/04/17 07:56
04/04/17 07:56
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Try it with the beta version. FUTX is an undocumented feature yet and I don't know if if was already available in the release.

Page 1 of 2 1 2

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