It turns out that my issue was actually retrieving option expirations that did not exist...problem solved.
I downloaded Contract Inspector that JR recommended from the link below.? It's very useful.
toggle quoted message
Show quoted text
I got lots of 200 error code when I was pulling the option historical bars, I contacted IB technical support and they told me that if I tried to view the same data from the TWS client , what I can see there is what I can pull out from the API. so, you
can view in TWS to see if you can get the bar you wanted there, if you can't that means there is nothing wrong with the code. But they did not explain why those data are not available.Maybe you can contact them for your case.
I am getting a lot of errors today when trying to pull historical daily bars on about half of the S&P500 stocks that I frequently query.
Here's the error message:
ErrorCode: 200
Message: No security definition has been found for the request
Here is the function that I use to pull the stock:
I define the contract using this function:
It's been working well for several years, but I started getting a bunch of ErrorCode: 200 errors today.? I tried the two commented-out ContractDetails lines near the top to fetch the contract ID, but that did not help.? I also tried setting the exchange to
"ISLAND" from the code examples, but that also did not help.? Is there something that I am missing?