Created
August 20, 2020 03:24
-
-
Save mattypiper/19bb84ada86fc1fe128d4ad8d31b9a8f to your computer and use it in GitHub Desktop.
find high stock option open interest using yahoo finance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import yfinance as yf | |
from pprint import pprint | |
goog = yf.Ticker("GOOG") | |
option_dates = goog.options | |
for date in option_dates: | |
opt = goog.option_chain(date) | |
calls = opt.calls | |
oi = calls.loc[calls['openInterest'] > 1000] | |
if len(oi) > 0: | |
print(f'=== {date} ===') | |
pprint(oi) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment