Skip to content

Real-Time Options Ticker: A Live Options Chain in My Terminal

RealTimeOptionsTicker puts a live options chain in my terminal: calls on the left, strikes down the middle, puts on the right, redrawn every few seconds.

It is a Python command-line tool. Give it a ticker and it shows the contracts for one expiry the way a broker screen does, with prices, volume, implied volatility and the greeks, and keeps refreshing until you quit. It is a learning project, not trading software: the default Yahoo feed is delayed, and every frame says the data is not trading advice.

It began in November 2025 as a Rust scaffold that never fetched any data. The Python version described here landed in July 2026.

What is on the screen

Under a header with the price and expiry sits the sentiment line. Here "sentiment" just means a few numbers across the whole expiry: put/call ratios by volume and open interest, implied volatility at the strike nearest the price, total call and put volume, and max pain. Nothing is scored or predicted.

Each side of the table shows bid, ask, last, change, volume, implied volatility, and the bid-ask spread as a percentage of mid. The strike nearest the price is highlighted. A price that moved since the last poll turns green or red, and a last trade older than ten minutes fades with an age tag. --greeks swaps in delta, gamma, theta and vega, and --tui opens a Textual app with a tab per symbol.

The screenshot on this page uses an offline simulated feed, so the symbol DEMO and every price in it are made up.

One interface, three feeds

Every data source implements one small abstract class, DataProvider, with two jobs: list a symbol's expiry dates, and return one expiry's chain as normalized OptionQuote objects. Everything downstream only sees those.

Yahoo, through yfinance, needs no key but is delayed. Tradier and Polygon read an API key from an environment variable and send their own greeks, so the engine skips the local maths for them.

"Real-time" here means polling, every ten seconds by default. There is no streaming connection yet.

The maths

For Yahoo I compute the greeks with Black-Scholes, using only the standard library: statistics.NormalDist gives the normal curve, so there is no SciPy. The inputs are the price, the strike, days to expiry over 365, a risk-free rate (4% unless you pass --rate) and each contract's implied volatility from the feed. Theta is per calendar day and vega per volatility point. Unusable inputs, such as zero volatility, show a dash rather than a misleading zero.

Black-Scholes assumes European options, and US equity options can be exercised early, so these are approximations. Tests check the model against textbook values and put-call parity.

Max pain is the strike where option writers would owe the least across all open interest if the stock settled there.

Keeping the screen smooth

Polling runs on a background thread. Each poll fetches the chain, picks the strikes nearest the price, attaches greeks, computes the sentiment numbers, marks what moved since the last poll, and swaps in the new snapshot under a lock.

The screen never waits on the network. The plain view redraws four times a second from the latest snapshot with rich, and the Textual app reads it every half second through the same render functions. If a poll fails, the last good data stays up with a warning. When the market is closed, polling slows to once a minute.

--record appends the visible strikes to SQLite or CSV, and --alert "iv>1.0" rings the bell and sends a desktop notification once when a threshold is crossed.

Tests

There are 38 pytest tests in eight files, all offline on fake data. They cover the greeks, analytics, engine, market hours, formatting, recorder, alerts, and the Tradier and Polygon parsers. The Yahoo provider, the render code and the CLI have none. As of October 2026, 37 pass; the failing one is in the list below.

Running it

git clone https://git.mocipher.com/m01/RealTimeOptionsTicker.git
cd RealTimeOptionsTicker
pip install .                         # Python 3.9+
options-ticker AAPL                   # nearest expiry, live view
options-ticker SPY --greeks -i 5      # greeks, refresh every 5 s
options-ticker AAPL MSFT NVDA --tui   # interactive watchlist

What I'd do next

  • Fix SQLite recording. The connection is opened on the main thread, the polling thread may not use it, and the error is swallowed, so --record x.db writes nothing in the live view. CSV works.
  • Keep alert state per symbol. In a watchlist the symbols share it, so an alert that stays true for one fires again on every poll.
  • Count time to expiry in hours, not whole days. On expiry day it is zero and the greeks go blank.
  • Have the Polygon provider follow pagination instead of stopping at 250 contracts, and send its key in a header so a network error cannot print it on screen.
  • Fix the failing test: its fixture expiry is 20 July 2026, now in the past. Then add tests for the Yahoo provider and the render functions.