zfin/docs/reference/cli/history.md
Emil Lerch 74fc219afd
All checks were successful
Generic zig build / build (push) Successful in 5m48s
Generic zig build / publish-macos (push) Successful in 11s
Generic zig build / deploy (push) Successful in 23s
add docs/guides
2026-06-22 14:53:53 -07:00

1.8 KiB

zfin history

Two modes in one command, selected by whether you pass a symbol.

Usage:
  zfin history <SYMBOL>     # last 30 days of candles
  zfin history [flags]      # portfolio-value timeline

Symbol mode

With a positional symbol, shows the last 30 trading days of OHLCV candles:

ZFIN_HOME=examples/pre-retirement-both zfin history VTI
Price History for VTI (last 30 days)
========================================
        Date       Open       High        Low      Close       Volume
2026-06-04       370.62     373.99     370.36     373.38    3,111,996
...

Portfolio mode

With no symbol, reads your history/*-portfolio.srf snapshots and renders rolling-window returns, a braille chart, and a recent-snapshots table. (Build that history with snapshot.)

Flag Effect
--since <DATE> Earliest as-of date (inclusive).
--until <DATE> Latest as-of date (inclusive).
--metric <name> liquid (default), illiquid, or net_worth.
--resolution <name> daily | weekly | monthly | auto.
--limit <N> Cap the recent-snapshots table (default 40).
--rebuild-rollup Regenerate history/rollup.srf and exit.

Dates accept YYYY-MM-DD or relative shortcuts (1W/1M/1Q/1Y).

ZFIN_HOME=examples/post-retirement zfin history --metric net_worth --since 1Y

See also


CLI command reference