Gamestudio Links
Zorro Links
Newest Posts
Question on TMF and WFO training
by Ger1
Today at 11:34
Is Zorro's rollover calculation wrong?
by pcz
Yesterday at 21:30
how can I open a *.dbl file?
by jcl
Yesterday at 19:19
Zelda like games.
by Realspawn
Yesterday at 18:53
Backtesting with T1 data and variable spread
by pcz
Yesterday at 14:12
AUM Magazine
Latest Screens
Triton Wing
ZeaL
Computer Repair Simulator
Collider (working title)
Space Rider
Who's Online
19 registered (kiamonster, Iglarion, boatman, alibaba, jenGs, GreenBoat, kmerlo, Ger1, Dalla, 2 invisible), 520 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Angeltrader77, Diska, GBA, TomJ, afoluj
17574 Registered Users
Topic Options
Rate This Topic
#464110 - 01/23/17 07:26 Interactive Brokers Futures Symbology Not Recognised
boatman Online
Senior Member

Registered: 04/23/14
Posts: 474
Loc: 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?
_________________________
www.robotwealth.com

Top
#464592 - 02/28/17 09:47 Re: Interactive Brokers Futures Symbology Not Recognised [Re: boatman]
Gloria Offline
Newbie

Registered: 02/28/17
Posts: 5
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

Top
#464633 - 03/02/17 14:20 Re: Interactive Brokers Futures Symbology Not Recognised [Re: Gloria]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 25378
Loc: 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.

Top
#464755 - 03/08/17 15:58 Re: Interactive Brokers Futures Symbology Not Recognised [Re: jcl]
Gloria Offline
Newbie

Registered: 02/28/17
Posts: 5

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

Top
#464770 - 03/09/17 19:41 Re: Interactive Brokers Futures Symbology Not Recognised [Re: Gloria]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 25378
Loc: 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.

Top
#464920 - 03/16/17 16:05 Re: Interactive Brokers Futures Symbology Not Recognised [Re: jcl]
Gloria Offline
Newbie

Registered: 02/28/17
Posts: 5
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


Edited by Gloria (03/16/17 16:08)

Top
#464952 - 03/20/17 10:40 Re: Interactive Brokers Futures Symbology Not Recognised [Re: Gloria]
mig Offline
Newbie

Registered: 11/11/16
Posts: 5
Loc: 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

Top



Gamestudio download | chip programmers | Zorro platform | shop | resources | magazine | manual | support faq | bugs | beta features

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) 3dgamestudio.net