简体   繁体   English

Python - TWS Api reqMktData of options with delayed mkt data

[英]Python - TWS Api reqMktData of options with delayed mkt data

I am trying to quote some options using reqMktData using the delayed data type.我正在尝试使用延迟数据类型使用 reqMktData 引用一些选项。 I keep receiving:我不断收到:

Error 200 , reqId 108: No security definition has been found for the request , contract: Contract(secType='OPT', symbol='qqq', lastTradeDateOrContractMonth='20220916', strike=292.5, right='C', exchange='SMART', currency='USD')错误 200 ,reqId 108:没有找到请求的安全定义,contract: Contract(secType='OPT', symbol='qqq', lastTradeDateOrContractMonth='20220916', strike=292.5, right='C', exchange= 'SMART', currency='USD')

My code:我的代码:

    ib.reqMarketDataType(3)
    op_contract = Contract()
    op_contract.symbol = asset_ticker
    op_contract.secType = 'OPT'
    op_contract.exchange = option_exchange
    op_contract.currency = currency
    op_contract.right = 'C'
    op_contract.lastTradeDateOrContractMonth = date
    op_contract.strike = strike
    ib.qualifyContracts(op_contract) #it does find a conID, unique per strike.
    mkt_data_op = ib.reqMktData(op_contract)

Am I mising anything?我错过了什么吗? Contract seems ok as I can query historical information...合同似乎还可以,因为我可以查询历史信息...

To make it clearer: I have no data subscription - that is why I am using delayed data (works fine with stocks), trying the cake before buying it;)更清楚地说:我没有数据订阅——这就是为什么我使用延迟数据(适用于股票),在购买蛋糕之前先试一试;)

Try changing the exchange to 'BOX'尝试将交换更改为“BOX”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM