Interactive Brokers Futures Symbology Not Recognised

Posted By: boatman

Interactive Brokers Futures Symbology Not Recognised - 01/23/17 06:26

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?
Posted By: Gloria

Re: Interactive Brokers Futures Symbology Not Recognised - 02/28/17 08:47

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
Posted By: jcl

Re: Interactive Brokers Futures Symbology Not Recognised - 03/02/17 13:20

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.
Posted By: Gloria

Re: Interactive Brokers Futures Symbology Not Recognised - 03/08/17 14:58


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
Posted By: jcl

Re: Interactive Brokers Futures Symbology Not Recognised - 03/09/17 18:41

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.
Posted By: Gloria

Re: Interactive Brokers Futures Symbology Not Recognised - 03/16/17 15:05

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
Posted By: mig

Re: Interactive Brokers Futures Symbology Not Recognised - 03/20/17 09:40

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
Posted By: jcl

Re: Interactive Brokers Futures Symbology Not Recognised - 03/29/17 13:43

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"
Posted By: mig

Re: Interactive Brokers Futures Symbology Not Recognised - 03/31/17 08:08

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
Posted By: jcl

Re: Interactive Brokers Futures Symbology Not Recognised - 04/04/17 07:56

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.
Posted By: boatman

Re: Interactive Brokers Futures Symbology Not Recognised - 04/04/17 09:52

This is really useful jcl, thanks. I will test it out as well.

Cheers
Posted By: mig

Re: Interactive Brokers Futures Symbology Not Recognised - 04/19/17 10:07

Hi, tried it again using the newest Beta Version 1.56.4 , but still the very same error messages as above...any idea?? Thx
Posted By: jcl

Re: Interactive Brokers Futures Symbology Not Recognised - 04/21/17 15:25

I was just informed that the uploaded IB plugin version did indeed not yet support expired futures, but this one should:

http://opserver.de/down/IB.zip

And also use a newer contract. I don't think that IB lets you download a future from 2015, but March 2017 should work.
Posted By: mig

Re: Interactive Brokers Futures Symbology Not Recognised - 04/24/17 07:24

Sorry...still not working...used the newest Beta 1.56.5 and the new IB.dll
Error message slightly different though....

Download compiling..........
IB.dll => Interactive Brokers plugin mounted
Login Interactive Brokers..
!IB Socket connected
!Account DUxxxxx at UTC 24.04. 07:13
Download...
Error 053: DAX-FUTX-20170317-FDAX-DTB-EUR unavailable at this time
!DAX-FUTX-20170317-FDAX-DTB-EUR 01.01. 00:00:00 to 24.04. 07:15:13 failed history unavailable!
Error 056: Can't download DAX-FUTX-20170317-FDAX-DTB-EUR 2017 history
No bars generated
Logout.. ok
Posted By: jcl

Re: Interactive Brokers Futures Symbology Not Recognised - 04/26/17 08:43

Error 053 is ok since that asset is not available. But Error 056 should not happen, however I can also confirm the problem.

The historical data of that contract is not available. We found other contracts where it did not work either. We're currently checking with IB API support what the problem might be. Please stay tuned for the next attempts.
Posted By: mig

Re: Interactive Brokers Futures Symbology Not Recognised - 04/26/17 09:45

Thanks for checking, but why should that asset not be available? It is the latest expired FDAX exp. date 17/03/17 , at 7:13 UTC, which is 9:13 CET, so during normal session hours?
Posted By: jcl

Re: Interactive Brokers Futures Symbology Not Recognised - 04/26/17 12:33

Well, don't ask me, ask IB - but at least here I could agree with them, since I also would consider it "unavailable" when it is not available anymore.
© 2024 lite-C Forums