簡體   English   中英

ib_insync,提取所有選項

[英]ib_insync, extraction of all options

我需要從交互式經紀人中提取特定底層證券的所有選項。 例如,對於ADS標的,我需要所有到期日期在未來 3 個月內的期權。 我正在使用ib_insync包裝器來提取必要的信息,例如bidask等。它運作良好,但我需要可用選項的列表。

因此,我需要類似的東西(即下面的偽代碼):

contracts = []
for underlying in ["ADS", "VOW"]:
   tmp = **give me a list of all options (i.e., strikes, expiration date) for *underlying***
   contracts.append(tmp)
   

感謝任何幫助!

自己搜索答案時遇到了這個問題。 我在這里ib_insync文檔中找到了答案。

spx = Index('SPX', 'CBOE')
chains = ib.reqSecDefOptParams(spx.symbol, '', spx.secType, spx.conId)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM