开云体育
Hi everyone,
This might?be a silly question but I do appreciate your idea: I want to get the tick prices (bid and ask) of ~400 options (stock_symbols, expirations and strikes are known) to do some monitoring.
What's the best method to do this?
Currently I can use reqMktData(), but I wonder if there's any better way.
My code:
self.reqMktData(1111, ContractSamples.USOptionContract(),
"", False, False, [])
? ? def
USOptionContract():
? ? ? ? contract = Contract()
? ? ? ? contract.symbol = "NDX"
? ? ? ? contract.secType = "OPT"
? ? ? ? contract.exchange = "SMART"
? ? ? ? contract.currency = "USD"
? ? ? ? contract.lastTradeDateOrContractMonth = "20220705"
? ? ? ? contract.strike = 11600
? ? ? ? contract.right = "C"
? ? ? ? contract.multiplier = "100"
? ? ? ? return contract
Thanks!
|