Skip to content

Instantly share code, notes, and snippets.

@mattypiper
Created August 20, 2020 03:24
Show Gist options
  • Save mattypiper/19bb84ada86fc1fe128d4ad8d31b9a8f to your computer and use it in GitHub Desktop.
Save mattypiper/19bb84ada86fc1fe128d4ad8d31b9a8f to your computer and use it in GitHub Desktop.
find high stock option open interest using yahoo finance
#!/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