How do I use trading toolbox to get IB option chain?

조회 수: 3 (최근 30일)
Scott Tuttle
Scott Tuttle 2016년 7월 5일
답변: Stephan 2021년 3월 7일
Hi, I thought I might try getting the option chain for the RUT index (Russell 2000) via a partially completed ibContract as described in the documentation for the IB API interface here: http://interactivebrokers.github.io/tws-api/contract_details.html#gsc.tab=0
I coded the following:
optContract = ib.Handle.createContract;
optContract.symbol = 'RUT';
optContract.secType = 'OPT';
optContract.exchange = 'CBOE';
optContract.currency = 'USD';
optionChain = contractdetails(ib, optContract);
disp('Option contract details');
disp(optionChain)
The display of the optionChain shows:
Option contract details
marketName: 'RUT'
minTick: 0.0500
priceMagnifier: 1
orderTypes: 'ACTIVETIM,ADJUST,ALERT,ALLOC,AON,AVGCOST,BASKET,CON…'
validExchanges: 'SMART,CBOE,CBOE2'
underConId: 416888
longName: 'Russell 2000 Stock Index'
contractMonth: '201612'
industry: 'Indices'
category: 'Broad Range Equity Index'
subcategory: '*'
timeZoneId: 'CST'
tradingHours: '20160705:0830-1515;20160706:0830-1515'
liquidHours: '20160705:0830-1515;20160706:0830-1515'
summary: [1x1 Interface.AE6A66F3_8FA9_4076_9C1F_3728B10A4CC7]
secIdList: []
cusip: ''
ratings: ''
descAppend: ''
bondType: ''
couponType: ''
callable: 0
putable: 0
coupon: 0
convertible: 0
maturity: ''
issueDate: ''
nextOptionDate: ''
nextOptionType: ''
nextOptionPartial: 0
notes: ''
evRule: ''
evMultiplier: 0
Seems that the request recognized the RUT, and I do see a contract month for 201612, but nothing else that shows the various option contract details for the various strikes and expirations.
I was hoping that I would get back an array of option contract details so that I could then iterate over them and use the name of each contract (e.g., 'RUT 160819C01180000') on a getdata request to obtain the bid and ask price for each option. Any ideas on how I can do this?
If the Matlab trading toolbox contractdetails function does not support this, what other method could anyone suggest to get the option chain?
  댓글 수: 6
qmnjb007
qmnjb007 2017년 9월 1일
Would also like to see this question answered!
Scott Tuttle
Scott Tuttle 2017년 9월 7일
G_Ib.Handle.registerevent({'contractDetailsEnd',@SbtContractDetailsEventHandler});

댓글을 달려면 로그인하십시오.

채택된 답변

Stephan
Stephan 2021년 3월 7일
Using the help of @Scott Tuttle i wrote a function to download the option chain. It can be downloaded at FEX.

추가 답변 (1개)

Kawee Numpacharoen
Kawee Numpacharoen 2017년 9월 7일

카테고리

Help CenterFile Exchange에서 Transaction Cost Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by