update docs for chart changes
This commit is contained in:
parent
25f074f622
commit
3f48a5b38c
8 changed files with 28 additions and 29 deletions
24
TODO.md
24
TODO.md
|
|
@ -81,28 +81,10 @@ ranking; unlabeled items are "someday, if the mood strikes."
|
||||||
|
|
||||||
## `--export-chart` follow-ups - priority LOW
|
## `--export-chart` follow-ups - priority LOW
|
||||||
|
|
||||||
V1 of `--export-chart <PATH>` shipped for `quote` and `projections`
|
V1 of `--export-chart <PATH>` shipped for `quote`, `projections`
|
||||||
(default bands mode only). Several adjacent surfaces still don't
|
(default bands mode only), and `history`. Several adjacent surfaces
|
||||||
have PNG export and were deferred:
|
still don't have PNG export and were deferred:
|
||||||
|
|
||||||
- **`history --export-chart`.** The `history` command renders a
|
|
||||||
single-series braille chart of portfolio value over time
|
|
||||||
(synthesized into `Candle` records and fed to
|
|
||||||
`format.computeBrailleChart`). It doesn't share the z2d
|
|
||||||
pipeline that `quote` (`tui/chart.zig`) and `projections`
|
|
||||||
(`tui/projection_chart.zig`) use. To export, options:
|
|
||||||
- **A.** Pipe the synthesized candles through
|
|
||||||
`tui/chart.zig`'s `renderChart` - but that draws Bollinger
|
|
||||||
Bands and an RSI panel, both meaningless on a portfolio-
|
|
||||||
value series.
|
|
||||||
- **B.** Add a minimal "single-series line chart" z2d
|
|
||||||
renderer (a slimmed-down `projection_chart.zig` without
|
|
||||||
bands). ~150 lines. Same renderToSurface shape so PNG
|
|
||||||
export is trivial after.
|
|
||||||
- **C.** Skip it permanently; the braille chart is fine for
|
|
||||||
what `history` is. Document as "not exportable".
|
|
||||||
B is the right answer if PNG export of the history chart is
|
|
||||||
ever requested.
|
|
||||||
- **`projections --convergence` / `--return-backtest`.** Both
|
- **`projections --convergence` / `--return-backtest`.** Both
|
||||||
render forecast-evaluation charts via `tui/forecast_chart.zig`.
|
render forecast-evaluation charts via `tui/forecast_chart.zig`.
|
||||||
Not refactored to expose a `renderToSurface` seam yet -
|
Not refactored to expose a `renderToSurface` seam yet -
|
||||||
|
|
|
||||||
|
|
@ -83,8 +83,9 @@ there.)
|
||||||
## 3. Review the timeline with `history`
|
## 3. Review the timeline with `history`
|
||||||
|
|
||||||
Run [`zfin history`](../reference/cli/history.md) with no symbol for the
|
Run [`zfin history`](../reference/cli/history.md) with no symbol for the
|
||||||
portfolio-value timeline: rolling-window changes, a braille chart, and
|
portfolio-value timeline: rolling-window changes, a chart (an inline
|
||||||
a recent-snapshots table.
|
Kitty image when your terminal supports it, else braille), and a
|
||||||
|
recent-snapshots table.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ZFIN_HOME=examples/post-retirement zfin history
|
ZFIN_HOME=examples/post-retirement zfin history
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,13 @@ Price History for VTI (last 30 days)
|
||||||
## Portfolio mode
|
## Portfolio mode
|
||||||
|
|
||||||
With no symbol, reads your `history/*-portfolio.srf` snapshots and
|
With no symbol, reads your `history/*-portfolio.srf` snapshots and
|
||||||
renders rolling-window returns, a braille chart, and a recent-snapshots
|
renders rolling-window returns, a chart, and a recent-snapshots
|
||||||
table. (Build that history with [`snapshot`](snapshot.md).)
|
table. (Build that history with [`snapshot`](snapshot.md).)
|
||||||
|
|
||||||
|
The chart renders as an inline Kitty image when your terminal supports
|
||||||
|
it, falling back to braille otherwise. Force a mode with the global
|
||||||
|
[`--chart`](index.md) flag (`auto` / `braille` / `WxH`).
|
||||||
|
|
||||||
| Flag | Effect |
|
| Flag | Effect |
|
||||||
|-----------------------|-------------------------------------------------|
|
|-----------------------|-------------------------------------------------|
|
||||||
| `--since <DATE>` | Earliest as-of date (inclusive). |
|
| `--since <DATE>` | Earliest as-of date (inclusive). |
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ subcommand:
|
||||||
| `--refresh-data=<auto\|force\|never>` | Cache freshness policy. `auto` (default) respects TTLs; `force` re-fetches everything; `never` is offline. See [offline guide](../../guides/offline-and-refresh.md). |
|
| `--refresh-data=<auto\|force\|never>` | Cache freshness policy. `auto` (default) respects TTLs; `force` re-fetches everything; `never` is offline. See [offline guide](../../guides/offline-and-refresh.md). |
|
||||||
| `-p, --portfolio <PATTERN>` | Portfolio file or glob (repeatable; default `portfolio*.srf`). Resolved against `ZFIN_HOME` when set, else the current directory. Quote globs to prevent shell expansion. |
|
| `-p, --portfolio <PATTERN>` | Portfolio file or glob (repeatable; default `portfolio*.srf`). Resolved against `ZFIN_HOME` when set, else the current directory. Quote globs to prevent shell expansion. |
|
||||||
| `-w, --watchlist <FILE>` | Watchlist file (default `watchlist.srf`). |
|
| `-w, --watchlist <FILE>` | Watchlist file (default `watchlist.srf`). |
|
||||||
|
| `--chart <auto\|braille\|WxH>` | Inline chart graphics for `history` / `quote` / `projections`. `auto` (default) renders a Kitty image when the terminal supports it, else braille; `WxH` forces Kitty at that resolution. |
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
zfin --no-color --refresh-data=never -p 'portfolio_*.srf' analysis
|
zfin --no-color --refresh-data=never -p 'portfolio_*.srf' analysis
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,16 @@ Usage: zfin quote <SYMBOL>
|
||||||
```
|
```
|
||||||
|
|
||||||
Prints the last price, the day's open/high/low, volume, and the
|
Prints the last price, the day's open/high/low, volume, and the
|
||||||
day-over-day change, followed by a 20-day chart. Quotes come from Yahoo
|
day-over-day change, followed by a price chart of the last 60 candles
|
||||||
|
and a table of the last 20 trading days. Quotes come from Yahoo
|
||||||
(TwelveData fallback) and are **never cached** -- so this command needs
|
(TwelveData fallback) and are **never cached** -- so this command needs
|
||||||
network access and does nothing useful in `--refresh-data=never` mode.
|
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`](index.md) flag (`auto` / `braille` / `WxH`).
|
||||||
|
|
||||||
Supports `--export-chart <PATH>` to render the chart as a 1920x1080
|
Supports `--export-chart <PATH>` to render the chart as a 1920x1080
|
||||||
PNG instead of text (see [export charts](../../guides/offline-and-refresh.md)
|
PNG instead of text (see [export charts](../../guides/offline-and-refresh.md)
|
||||||
and the projections page).
|
and the projections page).
|
||||||
|
|
@ -32,7 +38,7 @@ SPY $746.74 (close)
|
||||||
Volume: 80,875,657
|
Volume: 80,875,657
|
||||||
Change: +$5.78 (+0.78%)
|
Change: +$5.78 (+0.78%)
|
||||||
|
|
||||||
... (20-day braille chart)
|
... (60-candle price chart -- inline Kitty image, or braille)
|
||||||
```
|
```
|
||||||
|
|
||||||
## See also
|
## See also
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,8 @@ pub const meta: framework.Meta = .{
|
||||||
\\shows the last 30 trading days of candles for that symbol.
|
\\shows the last 30 trading days of candles for that symbol.
|
||||||
\\Portfolio mode (no positional, optionally with flags) reads
|
\\Portfolio mode (no positional, optionally with flags) reads
|
||||||
\\`history/*-portfolio.srf` snapshots and renders rolling-windows
|
\\`history/*-portfolio.srf` snapshots and renders rolling-windows
|
||||||
\\returns + a braille chart + a recent-snapshots table.
|
\\returns + a chart (an inline Kitty image when the terminal
|
||||||
|
\\supports it, braille otherwise) + a recent-snapshots table.
|
||||||
\\
|
\\
|
||||||
\\Portfolio-mode flags:
|
\\Portfolio-mode flags:
|
||||||
\\ --since <DATE> earliest as-of date (inclusive)
|
\\ --since <DATE> earliest as-of date (inclusive)
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@ pub const meta: framework.Meta = .{
|
||||||
\\Usage: zfin quote <SYMBOL> [--export-chart <PATH>]
|
\\Usage: zfin quote <SYMBOL> [--export-chart <PATH>]
|
||||||
\\
|
\\
|
||||||
\\Show the latest real-time quote for a symbol (Yahoo / TwelveData)
|
\\Show the latest real-time quote for a symbol (Yahoo / TwelveData)
|
||||||
\\plus a braille price chart of the last 60 candles and a table
|
\\plus a price chart of the last 60 candles (an inline Kitty image
|
||||||
|
\\when the terminal supports it, braille otherwise) and a table
|
||||||
\\of the last 20 trading days.
|
\\of the last 20 trading days.
|
||||||
\\
|
\\
|
||||||
\\If real-time fetch fails, falls back to the cached close. The
|
\\If real-time fetch fails, falls back to the cached close. The
|
||||||
|
|
|
||||||
|
|
@ -88,12 +88,15 @@ const usage_footer =
|
||||||
\\ the same directory as the first resolved
|
\\ the same directory as the first resolved
|
||||||
\\ portfolio file.
|
\\ portfolio file.
|
||||||
\\ -w, --watchlist <FILE> Watchlist file (default: watchlist.srf)
|
\\ -w, --watchlist <FILE> Watchlist file (default: watchlist.srf)
|
||||||
|
\\ --chart <MODE> Inline chart graphics for history / quote /
|
||||||
|
\\ projections: auto (Kitty image when the
|
||||||
|
\\ terminal supports it, else braille),
|
||||||
|
\\ braille, or WxH (Kitty at that resolution)
|
||||||
\\
|
\\
|
||||||
\\Interactive command options:
|
\\Interactive command options:
|
||||||
\\ -s, --symbol <SYMBOL> Pre-load a symbol and open on the
|
\\ -s, --symbol <SYMBOL> Pre-load a symbol and open on the
|
||||||
\\ Quote tab. Without this flag, the TUI
|
\\ Quote tab. Without this flag, the TUI
|
||||||
\\ opens on the Portfolio tab.
|
\\ opens on the Portfolio tab.
|
||||||
\\ --chart <MODE> Chart graphics: auto, braille, or WxH
|
|
||||||
\\ --default-keys Print default keybindings
|
\\ --default-keys Print default keybindings
|
||||||
\\ --default-theme Print default theme
|
\\ --default-theme Print default theme
|
||||||
\\
|
\\
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue