Skip to content

v0.6.0

Choose a tag to compare

@deepentropy deepentropy released this 14 Oct 20:38
· 11 commits to main since this release

Added

  • OptionScreener and OptionField (#53): option chains from the TradingView options scanner, for one or more underlyings.
    • Greeks (delta, gamma, theta, vega, rho), implied volatility (mid, bid, ask), theoretical price, bid/ask
    • Expiration is returned as a datetime; expiration filters accept dates, ISO strings or YYYYMMDD integers
    • Works for US equities and ETFs (NASDAQ:AAPL, AMEX:SPY), indices (SP:SPX) and NSE:NIFTY
  • get_iv_term_structure(symbol) (#53): implied volatility by time to expiration, one point per listed expiration plus standard tenors (1w to 1y).
import tvscreener as tvs

opts = tvs.OptionScreener("NASDAQ:AAPL")
opts.where(tvs.OptionField.OPTION_TYPE == "call")
opts.where(tvs.OptionField.DELTA.between(0.4, 0.6))
df = opts.get()

ts = tvs.get_iv_term_structure("NASDAQ:AAPL")

Notes: implied volatilities are fractions (0.27 = 27%). The options scanner does not return last price, volume or open interest. See the Option Screener docs.

Full suite: 168 tests and 2 subtests passed.