What fresh_ver is
fresh_ver is a self-contained variant of the FX + equity report: legs come from
fresh_ver/registry.py (LEG_REGISTRY), caches live under fresh_ver/data/
with *_fv stems (separate from repo-root data/), and HTML is written to
fresh_ver/output/.
Full report (report_fv.html): per-leg v2 blocks plus summary matrices across legs.
USD lens (usd_lens.html): a compact “USD vs each currency” view with a single convention and small charts.
How to regenerate
From the forex/ project root:
- Live fetch — pull Yahoo history, update
fresh_ver/data/, write HTML/MD:
python fresh_ver/run_report.py - Cache only — no network; use existing
fresh_ver/data/files:
python fresh_ver/run_report.py --no-fetch
After publishing, refresh the copies next to this page:
cp forex/fresh_ver/output/report_fv.html …/fresh_ver_report_fv.html
cp forex/fresh_ver/output/usd_lens.html …/fresh_ver_usd_lens.html
Inputs & storage
- Source: Yahoo Finance via
yfinance(fx_history_io.fetch_ticker_history),period="2y",auto_adjust=True. - Caches:
fresh_ver/data/<stem>_history.csv/.parquetand<stem>_meta.json(stems end in_fv). - Close prices are used for FX % moves and stock marks; NaN closes are dropped in the series builder.
Registry legs
LEG_REGISTRY drives tickers, share counts for horizon tables, and whether a leg is FX-only (no stock fetch, no equity tables — included in summaries and USD lens).
| Block | FX (Yahoo) | Stock | Shares | Notes |
|---|---|---|---|---|
| USD/JPY | JPY=X | 7203.T | 100 | Toyota |
| USD/EUR | EURUSD=X | RHM.DE | 100 | USD per 1 EUR; % convention in report text |
| USD/CHF | CHF=X | SDZ.SW | 100 | Sandoz |
| USD/AUD | AUD=X | BHP.AX | 100 | BHP |
| USD/HKD | HKD=X | 2800.HK | 500 | Tracker Fund |
| USD/CNY | CNY=X | 601988.SS | 100 | Bank of China (Shanghai) |
| USD/GBP | GBP=X | BARC.L | 100 | Barclays; pence → GBP |
| USD/PHP | PHP=X | — | — | FX only |
| USD/THB | THB=X | — | — | FX only |
| USD/INR | INR=X | — | — | FX only |
| USD/IDR | IDR=X | — | — | FX only |
Period definitions
Same horizon logic as the main fx_report.compute_periods helper: daily closes, anchored to each leg’s last trading date.
| Key | Label | Rule |
|---|---|---|
1d | Past day | 1 trading day back |
1w | Past week | 5 trading days |
1m | Past month | 21 trading days (~1 month) |
3m | Past 3 months | 63 trading days (~3 months) |
ytd | Year to date | Last close on or before 1 Jan of the anchor year → latest |
12m | Past 12 months | Last close on or before (latest − 365 days) → latest |
Percent change: (end / start − 1) × 100 on those closes. Short history yields an “insufficient history” message instead of a %.
--no-fetch vs live fetch
- Default: downloads each ticker, refreshes
fresh_ver/data/, then renders both HTML files. --no-fetch: reads caches only — reproducible or offline, provided caches already exist.