zfin/docs/reference/cli/quote.md
2026-06-30 08:32:56 -07:00

3.1 KiB

zfin quote

Show the latest quote for a symbol, with a price chart and recent history.

Usage: zfin quote <SYMBOL> [--since <WHEN>] [--export-chart <PATH>] [--live]

Prints the last price, the day's open/high/low, volume, and the day-over-day change, followed by a price chart over a recent window (the last ~3 months by default) and a table of the last 20 trading days. Quotes come from Yahoo (TwelveData fallback) and are never cached -- so this command needs network access and does nothing useful in --refresh-data=never mode.

The inline chart renders as a Kitty image (price + Bollinger bands + volume + RSI) when your terminal supports it, falling back to a braille price line otherwise. Force a mode with the global --chart flag (auto / braille / WxH).

Use --since <WHEN> to change how far back the chart reaches. WHEN accepts an absolute YYYY-MM-DD, a relative shortcut (1W, 1M, 1Q, 1Y), or ytd. It governs both the inline chart and the --export-chart PNG; the 20-day history table is always the last 20 trading days regardless.

Supports --export-chart <PATH> to render the chart as a 1920x1080 PNG instead of text (see export charts and the projections page).

Live streaming (--live)

zfin quote --live <SYMBOL> opens a websocket and prints the price continuously (one line per second) instead of a one-shot quote. It runs until interrupted (Ctrl-C) or killed -- handy with timeout:

timeout 12 zfin quote --live BTC-USD   # watch live ticks for 12s

The transport follows ZFIN_LIVE_QUOTE_PROVIDER: free, keyless Yahoo by default, or real-time IEX via Tiingo when selected (works on any Tiingo tier with a key). Outside market hours, US equities stream a closing snapshot and then go quiet; 24/7 symbols (e.g. BTC-USD on Yahoo) keep ticking. The chart / --since / --export-chart options don't apply in --live mode.

Example

ZFIN_HOME=examples/pre-retirement-both zfin quote SPY

# A one-year chart window instead of the default ~3 months:
ZFIN_HOME=examples/pre-retirement-both zfin quote SPY --since 1Y
SPY  $746.74  (close)
========================================
  Date:          2026-06-18
  Open:          $747.76
  High:          $748.23
  Low:           $743.86
  Volume:        80,875,657
  Change (1D):   +$5.78 (+0.78%)
  Change (3M):   +$31.40 (+4.39%)

  ... (price chart over the selected window -- inline Kitty image, or braille)

Two change rows are shown: Change (1D) is the day-over-day move, and Change (<span>) is the move across the chart window (from the first visible candle's close to the current price). The span label reflects --since (3M by default; 1Y, YTD, or a date when set). In the TUI it's the selected chart timeframe instead (e.g. Change (1Y)).

See also

  • perf -- trailing returns instead of a spot price.
  • history -- the last 30 days as a table.
  • Caching -- why quotes need the network.

CLI command reference