Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
How to get all VALID options
Has anyone using Yahoo for option chain seen some errors in the past few days?? For example, getting option chain for GOOG, I get an internal server error for expiry?dates?2020-06-05,?2020-07-17,?2020-06-26,?2020-08-21,?2020-11-20 (using, for example,? for the last date). Should I be using a different URL? Thanks Jimmy On Wed, Aug 7, 2019 at 4:38 AM Francois G via Groups.Io <namasteparis=[email protected]> wrote: Yes I noticed that also. It seems that only DOTM strikes with bid/ask=0 and/or with open interest=0 are missing. Which is not a big loss, in a trader's point of view... |
Changing the date to now or 1600830400 works, so it's a date problem - too far into the future? Best wishes, M On Fri, 15 May 2020 at 19:40, Jimmy <jimmydtalbot@...> wrote:
-- +44 (0) 7528 551604? Gulfstream Software - Winner Risk Management Awards 2010 This message is subject to : |
Thanks for the response. It works for dates after?2020-11-20, so it's not that?
2020-11-20 is too far in the future.?
?also does not work (I got there by selecting from the date dropdown at?
), so maybe it's just some internal (hopefully transient) problem at yahoo finance. On Fri, May 15, 2020 at 6:30 PM mark collins <mark.collins@...> wrote:
|
juxeiier
This is really unbelievable.
The quality of this API is really low, which is especially evident in this problem. I have now implemented something with Yahoo finance, which gives me the valid option chains. Then I create all needed contracts and serialize them to a file(because it takes an enormous amount of time to get them). That way, the cached contracts can be reloaded and only new expiration chains well need to be added. But still, why do we need to do this? We deserve better from IB, since all this data is available in the option trader window. I now struggle in reveiving the greeks for the options. Are they even there when markets are closed? |
Matthias Frener
> I now struggle in reveiving the greeks for the options. Are they even there when markets are closed? You probably have to switch to frozen market-data type. You will only see live-greeks while market is open, otherwise there is no bid/ask and difficult to calculate it. (the exact time depends on markte, e.g. 9:30-16:00 for stock options on CBEO or 24/5 (with 10min stop each day) at GLOBEX), > But still,?why do we need to do this? We deserve better from IB, since all this data is available in the option trader window.TWS has same issue. Option an option chain and change between dates and scroll up/down the strikes. You will that is terrible slow, takes seconds until you have all the strikes and even longer until prices show up - because they probably have to da same as we have to. What I did to make it smooth in my App is indeed to store it locally. I cache option chains that have been requested from TWS locally. So it only slow the first time, second time it's cache hit and there immediatly. Am Di., 16. M?rz 2021 um 11:01?Uhr schrieb juxeiier <juxeiier@...>: This is really unbelievable. |
juxeiier
Hi Matthias,
thx for help. You really cache the contracts locally? If I get all contracts for all chains for 120days from today, that takes 2hours just for 3 symbols!! That is the reason I implemented a little serializer/caching mechanism with the pickler module(python). After restart of the algorithm, I have all the contracts almost immediatly at my disposal. |
Matthias Frener
>??If I get all contracts for all chains for 120days from today, that takes 2hours just for 3 symbols!! Do you need them all? (and you probably do something wrong, should be way faster with?reqSecDefOptParams). Wanted to speed up option chain on UI - so no point on download all because I won't look at all anyhow. I keep the last 16 queried option chains on cache. If I open #17, #0 falls out of cache and #17 goes into. So if you want to look at #0 again, it will need to get strikes again, but #17 is fast now. Am Di., 16. M?rz 2021 um 11:26?Uhr schrieb juxeiier <juxeiier@...>: Hi Matthias, |
I do get valid chains in this way: chains = ib.reqSecDefOptParams(contract.symbol, '', contract.secType, contract.conId) then I just get the one for exchange SMART. Then for expiration date I need, I get the list of strikes and create a list of Option() objects - options. that list I pass to reqQualifyContracts() -?ib.qualifyContracts(*options) The combinations of expirations and strikes that don't exist don't pass qualification (you'll see errors in the stderr but they are handled in the background). The options that were qualified successfully have non-zero conId so I filter them out. You don't have to do too many calls - just get a product of expirations/strikes you need and then create list of Option() objects, qualify them and filter on conId. I use the ib-insync Python module so my method calls might be slightly different from standard API (I guess only capitalization?). Is that what you are also doing? On Tue, Mar 16, 2021 at 7:01 AM juxeiier <juxeiier@...> wrote: This is really unbelievable. |
Filtering on SMART when dealing with US stocks is OK, but when you deal with foreign or commodities exchanges (MONEP, GLOBEX, NYMEX...), SMART doesn't work anymore.
This is my algo, compliant with any symbol any exchange: I collect all answers from reqSecDefOptParams. If SMART is present in the answers, I only keep SMART. If SMART is NOT present, I keep all answers. |
juxeiier
Hi Michael,
you might wanna try this little tool I have written, see /g/twsapi/topic/little_tool_for_option_chain/81408600?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,81408600 It basically frees you from doing all of this and provides a fast caching mechanism if? you reload your application. Cheers, Juergen |
to navigate to use esc to dismiss