Closed MollyZhang closed 7 years ago
@MollyZhang I can't find an example to test it but 9982345f06bfcbc897e1774ffd9c189f732f736b should take care of the issue
Here is an example "WOOF", http://finance.yahoo.com/quote/WOOF/options?p=WOOF&date=1495152000
WOOF has calls for may 19 2017, june 16 2017, july 21 2017 and sep 15, 2017 while only has puts for june 16 2017, july 21 2017 and sep 15, 2017 (not may 19 2017).
after updating with your newest commit,
wallstreet.Put("WOOF", source="yahoo")
still gives this error:
Ok I see what the issue is now. I've added a dictionary to keep track of dates that are listed as expiration dates but do not contain both calls and puts and remove them from the expirations list for the given type
Thanks for the update! I tried again, now getting this error saying it can't find option for this stock at all.
and
@MollyZhang You'll have to use the source='yahoo' parameter since Google finance has no option data for this company
@mcdallas You are right I forgot to add source="yahoo", I just checked it, yes it works as expected now. Thank you! I am closing this issue.
jnj = wallstreet.Call("JNJ", source="yahoo")
gives this error:
ValueError: ('Possible expiration dates for this stock are:', ['13-04-2017', '21-04-2017', '05-05-2017', '12-05-2017', '19-05-2017', '26-05-2017', '16-06-2017', '21-07-2017', '20-10-2017', '19-01-2018', '15-06-2018', '18-01-2019'])
And that's because on expiration 13-04-2017, there is only put option, no call option. For the rest of the expiration dates, there are both calls and puts.
Is there anyway to not throw ValueError, and instead find the nearest date that do have calls? Thanks!