Skip to content

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

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 (66 pass, exit 0), and again with the 29 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 (52 pre-existing)
  • live TICKERS="AGGY AGZD" bun ./scripts/update-data.ts: 96 rows, 96 with dataFile, all 96 get a range (basis Close), 10 young funds carry range52wSince; 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() before writeIndex writes index.json.
@daggerok
daggerok merged commit cd27a1b into main Oct 29, 2026
1 check passed
@daggerok
daggerok deleted the feat/range-52w branch October 29, 2026 21:51
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