FX (fresh_ver)

How the fresh_ver bundle is built, then the two HTML outputs side by side in separate tabs.

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 / .parquet and <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).

BlockFX (Yahoo)StockSharesNotes
USD/JPYJPY=X7203.T100Toyota
USD/EUREURUSD=XRHM.DE100USD per 1 EUR; % convention in report text
USD/CHFCHF=XSDZ.SW100Sandoz
USD/AUDAUD=XBHP.AX100BHP
USD/HKDHKD=X2800.HK500Tracker Fund
USD/CNYCNY=X601988.SS100Bank of China (Shanghai)
USD/GBPGBP=XBARC.L100Barclays; pence → GBP
USD/PHPPHP=XFX only
USD/THBTHB=XFX only
USD/INRINR=XFX only
USD/IDRIDR=XFX only

Period definitions

Same horizon logic as the main fx_report.compute_periods helper: daily closes, anchored to each leg’s last trading date.

KeyLabelRule
1dPast day1 trading day back
1wPast week5 trading days
1mPast month21 trading days (~1 month)
3mPast 3 months63 trading days (~3 months)
ytdYear to dateLast close on or before 1 Jan of the anchor year → latest
12mPast 12 monthsLast 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.
Tab shell: fx_equity_report_tabbed.html · Embedded: fresh_ver_report_fv.html, fresh_ver_usd_lens.html

Embedded: fresh_ver_report_fv.html (copy of fresh_ver/output/report_fv.html).

Embedded: fresh_ver_usd_lens.html (copy of fresh_ver/output/usd_lens.html).