Skip to content

feat(updater): 52-week range from the published closes in every index row - #102

Merged
daggerok merged 1 commit into
mainfrom
feat/range-52w
Oct 29, 2026
Merged

daggerok merged 1 commit into
mainfrom
feat/range-52w

Conversation

@daggerok

Copy link
Copy Markdown
Owner

What

Shared range-52w block from the workspace etf-std tools, applied with apply-block.ts, wired once in main() right before index.json is written (withRange52w). Every funds[].metrics gets seven keys, placed before returnsBasis and performanceAsOf:

  • week52Low, week52High: lowest and highest close of the 52 weeks up to the last published close
  • range52w: position of that close between them in percent (0 = at the low, 100 = at the high)
  • range52wClose, range52wAsOf: the close used and its date
  • range52wSince: first close when the fund has less than 52 weeks of history, else null
  • range52wBasis: the history column used (Close, Market Price, NAV)

Closes, not intraday highs and lows; no new requests. Unavailable values are null, never 0.

Why

A 52-week range column sorted by position (like Fidelity) in the brand apps and the ETFs hub; the UI follows in a separate change.

Checks

  • bun test (42 pass, exit 0), and again with the 24 workflow controls of scripts/update-data.config.json exported (exit 0); the first pipeline test now checks the seven keys on every row
  • TC_MODE=esnext .claude/tools/etfs/tc/check.sh . prints nothing; the default (IDE) run shows no new error lines compared with main (53 pre-existing)
  • live TICKERS="AAXJ ACWI" bun ./scripts/update-data.ts: 482 rows, 482 with dataFile, all 482 get a range, 27 young funds carry range52wSince; basis NAV per Share everywhere, because the iShares history sheet publishes only NAV (As Of, NAV per Share, Ex-Dividends, Shares Outstanding, Non-FV NAV), no market close; returnsBasis and performanceAsOf stay the last two keys

… row

The shared range-52w block is applied to scripts/update-data.ts and withRange52w wraps the final rows in main() right before index.json is written.
@daggerok
daggerok merged commit b0ef541 into main Oct 29, 2026
1 check passed
@daggerok
daggerok deleted the feat/range-52w branch October 29, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant