For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

IB VIX Futures problem/question



  • Hey guys,
    I'm trying to request IB datafeed for VIX futures, however, I seem to always get "Ambiguous contract: multiple answers received"

    I've split the log of getContractDetails() into two pieces - one for "no contract", the other for "multiple answers" so I can get the correct failure reason.

    I'm requesting the feed like this:
    vx1 = ibstore_live.getdata(
    dataname='VIX-FUT-CFE-USD-202010-1000',
    tz=pytz.timezone('US/Central'),
    name='VX1',
    sessionstart=dtm.time(8, 31, 00),
    sessionend=dtm.time(15, 15, 00),
    timeframe=bt.TimeFrame.Minutes,
    qcheck=0.5,
    historical=False,
    latethrough=True,
    compression=1,
    backfill=False,
    backfill_start=False)

    Can someone let me know how exactly to request the futures feed ?
    I've tried:
    VXV0-FUT-CFE-USD-202010-1000
    VXV-FUT-CFE-USD-202010-1000
    VXX-FUT-CFE-USD-202011-1000
    VXX0-FUT-CFE-USD-202011-1000
    However - result in "No security definition has been found for the request" + "Ambiguous contract: none"

    Here's also a full log:
    Symbol: VIX
    Exchange: CFE
    Currency: USD
    Expiry next: 202010
    Multiplier: 1000
    Server Version: 76
    TWS Time at connection:20201021 10:35:08 EST
    STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:usfuture.nj>
    STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:usfarm.nj>
    STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:cashfarm>
    STORE NOTIF: <error id=-1, errorCode=2104, errorMsg=Market data farm connection is OK:usfarm>
    STORE NOTIF: <error id=-1, errorCode=2106, errorMsg=HMDS data farm connection is OK:ushmds.nj>
    STORE NOTIF: <error id=-1, errorCode=2106, errorMsg=HMDS data farm connection is OK:ushmds>
    STORE NOTIF: <error id=-1, errorCode=2158, errorMsg=Sec-def data farm connection is OK:secdefil>
    STORE NOTIF: Ambiguous contract: multiple answers received

    Here is also a screenshot from TWS:
    TWS.png



  • dataname='VIX-FUT-CFE-USD-202011-1000',
    name='VX1',

    From the looks of it, it returns these 4 separate contracts, does anyone have any idea how to properly request only the first one (VXX0)?

    Found 4 items:

    Nr: 1 | Category: Volatility Index | Contract Month: 202011 | Industry: Indices | Long name: CBOE Volatility Index
    Market Name: VX | Currency: USD | Exchange: CFE | Expiry: 20201118
    Local symbol: VXX0 | Sec type: FUT | Symbol: VIX | Trading class: VX

    Nr: 2 | Category: Volatility Index | Contract Month: 202011 | Industry: Indices | Long name: CBOE Volatility Index
    Market Name: VX44 | Currency: USD | Exchange: CFE | Expiry: 20201104
    Local symbol: VX44X0 | Sec type: FUT | Symbol: VIX | Trading class: VX44

    Nr: 3 | Category: Volatility Index | Contract Month: 202011 | Industry: Indices | Long name: CBOE Volatility Index
    Market Name: VX45 | Currency: USD | Exchange: CFE | Expiry: 20201111
    Local symbol: VX45X0 | Sec type: FUT | Symbol: VIX | Trading class: VX45

    Nr: 4 | Category: Volatility Index | Contract Month: 202011 | Industry: Indices | Long name: CBOE Volatility Index
    Market Name: VX47 | Currency: USD | Exchange: CFE | Expiry: 20201124
    Local symbol: VX47X0 | Sec type: FUT | Symbol: VIX | Trading class: VX47



  • Nevermind, I wasn't placing the expiry date correctly:
    dataname='VIX-FUT-CFE-USD-20201118-1000'

    All good :)



  • feeds/ibdata.py needs correction:
    - TICKER-YYYYMM-EXCHANGE # Future
    - TICKER-YYYYMM-EXCHANGE-CURRENCY # Future
    - TICKER-YYYYMM-EXCHANGE-CURRENCY-MULT # Future
    - TICKER-FUT-EXCHANGE-CURRENCY-YYYYMM-MULT # Future

    Should be YYYYMMDD


Log in to reply
 

});