Need Help with Expiry Date on VIX Futures

Discussion in 'App Development' started by globalarbtrader, Sep 9, 2015.

  1. (Sorry for the rather abbreviated subject line, which I now find I cannot edit)

    I trade through IB, fully automated, using python code of my own design.

    Up to now I've used the following process to get contract expiries.

    - based on the liquid expiry cycle (quarterly, monthly or weird) get the next contract
    - create a contract with a 6 character expiry (eg "201510")
    - ask IB for the contract details. Obviously only one contract would match this specification.
    - receive back a contract object with an 8 character expiry

    However recently the exchange began listing VIX futures with weekly cycles. This means that 201510 is no longer a unique identifier for VIX; you need to specify which one. Assuming you want the normal monthly expiry this would be "20151021". If you don't specify this then step 3 will fail.

    (This isn't just me being dumb; there are quite a few threads for various products highlighting this problem - eg http://ninjatrader.com/support/forum/showthread.php?t=76470)

    As a result I've had to create a fairly ugly fix by including a hard coded list of expiry dates for each contract month.

    I've pored through the IB API documentation - nothing. I've also, and had a quick google, but I can't find anywhere that will provide me with the expiry calendar without writing some extremely ugly and involved scraping utility.

    Anyone here have any ideas?

    GAT
     
  2. rmorse

    rmorse Sponsor

  3. They don't use it, at least not for futures (I don't trade options) but that wouldn't help me. I could for example specify all expiry dates with an 8 character string. The issue I have is I need I nice way of getting those expiry dates to begin with. For every contract except VIX I just need to specify the 6 character YYYYMM date and ask IB to give me the 8 character date; and it's trivial to write code which says "I'm trading U5, Okay it's quarterly and all rolls are liquid, so the next contract is Z5'.

    GAT
     
  4. 2rosy

    2rosy

    Are asking where to get reference data (expiries)?
     
  5. rmorse

    rmorse Sponsor

    Sorry, I thought you were looking for help on the options for VIX.
     
  6. Yes exactly. Ideally through some kind of API

    GAT