Repository navigation
feat(updater): 52-week range from the published closes in every index row - #95
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Shared
range-52wblock from the workspace etf-std tools, applied withapply-block.ts, wired once inmain()right beforeindex.jsonis written (withRange52w). Everyfunds[].metricsgets seven keys, placed beforereturnsBasisandperformanceAsOf:week52Low,week52High: lowest and highest close of the 52 weeks up to the last published closerange52w: position of that close between them in percent (0 = at the low, 100 = at the high)range52wClose,range52wAsOf: the close used and its daterange52wSince: first close when the fund has less than 52 weeks of history, else nullrange52wBasis: 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 ofscripts/update-data.config.jsonexported (exit 0); the first pipeline test now checks the seven keys on every rowTC_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)TICKERS="AGGY AGZD" bun ./scripts/update-data.ts: 96 rows, 96 withdataFile, all 96 get a range (basisClose), 10 young funds carryrange52wSince;returnsBasisandperformanceAsOfstay the last two keys