¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Option Chain (Strike/Bid/Ask) into Panda


 

All perfectly reasonable questions. And questions that I am quite frankly embarassed to have to address, due to my complete lack of knowledge on the subject. But below is my honest best-efforts attempt:

I am using contractDetails and reqContractDetails to see what strikes are listed for a particular Underlying/Expiration/Right (Call or Put)/Multiplier. From what I can tell, contractDetails does not respond with a specific field/callback for "strike" but instead the strike information is contained in the callback contractDetails.contract. So for starters, I am having trouble parsing out just the strike portion of that and storing that information.

Second question - I have gathered that reqContractDetails does not provide any information related to market price (please correct me if I am wrong). In this case, I imagine one would have to follow up the reqContractDetails request with a series of reqMktData requests to get Bid/Ask prices for all the available options that you identified in step one. Is there any way to request all this market data at once? Or would one have to write a loop and do a separate reqMktData request for each contract separately.

def contractDetails(self, reqId, contractDetails):
print("ContractDetails: ", reqId, " ", contractDetails.contract, "\n")
self.data.append([contractDetails.contract])

def start(self):

contract = Contract()
contract.symbol = "AVGO"
contract.secType = "OPT"
contract.exchange = "SMART"
contract.currency = "USD"
contract.lastTradeDateOrContractMonth = "202101"
#contract.strike = 480
contract.right = "C"
contract.multiplier = "100"
#contract.primaryExchange = "NASDAQ"

self.reqContractDetails(1, contract)

Join [email protected] to automatically receive all group messages.