Trying to debug getting futures options chain (works sometimes, fails to load others) #65
Replies: 2 comments 2 replies
-
update: I tried IB gateway and everything just worked. something wonky is happening in TWS. |
Beta Was this translation helpful? Give feedback.
-
I've seen the exact same thing recently. The API just returned empty values for /ES chains and it refuses to qualify contracts for same-day /ES options even though they are tradable. Things I've seen break the IBKR gateway API (without it actually crashing or any active error indication... just silent errors until manually restarted):
I attempted my lookups across multiple days, so I don't know if just restarting the gateway fixed it or if their backend APIs are down randomly. I saw the /ES chains problem fixed itself, but I'm still not sure about the 0DTE /ES FOP qualifications (I decided to just fetch all contracts 5+ days in advance and cache them so future lookups can't fail). Also remember in the gateway app to uncheck "Expose entire trading schedule to API" under the Configuration -> API -> Settings parameters because it can cause chains to fail to load due to all the extra data returned when enabled (when using full details though). Also remember to adjust your gateway memory far above the default limit. 4096 or 6144 MB are safer values than the defaults especially when fetching option chains with all the dates returned. I also tried using |
Beta Was this translation helpful? Give feedback.
-
When grabbing /ES option chains, sometimes the following code works, sometimes it doesn't. I think it's on the TWS side, but don't know how to address it (if possible)
I can't find the pattern when it does or doesn't work.
When it works, it returns the chain, and I can grab all the tickers.
When it does not work, I get the following error from python:
Error 322, reqId 7: Error processing request. no derivatives returned
which I believe is an error on the TWS side. The TWS API logs (logging level: Error) showIs there some known bug in TWS, or is there some setting I'm missing?
I did come across this: https://groups.io/g/twsapi/topic/101318985
Maybe it's some corrupted cache/DB on the TWS side? Would using the IB Gateway be better than TWS?
Beta Was this translation helpful? Give feedback.
All reactions