Repository navigation
feat(metrics): swing metrics from the shared block - #102
Merged
Merged
Conversation
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
swingblock (etf-std/swing.block.ts, applied withapply-block.ts) inscripts/update-data.ts, history mode: wired once aswithSwing(<feed root>, await withRange52w(...))right before index.json is written. EverymetricsgetspctFrom52wHigh,athPrice,athDate,athBasis,pctFromAth,volatility1y,sigmaFromMean60d,high60d,low60dafter the range-52w keys, beforereturnsBasisandperformanceAsOfClosecolumn of the published history pages (no new requests), so kept funds get the same values again and reruns stay zero-diffslice(-11, -2)) and a real value check (athPricea number,athBasisdaily closes since <date>); tests that list the index-added keys now include the swing keys### Metrics and caveats: the swing listWhy
Screener plan 1.6, item S5: the ETF feeds publish the same swing metrics as the Stocks feed
Checks
swing-gates.sh <repo> baselinebefore the edit,swing-gates.sh <repo> checkafter:bun test(66 pass, 0 fail, 438 expect() calls),bun testwith the config controls exported,bun buildof the updater and ofsrc/main.tsx,git diff --check, check-readme, check-scripts, check-log-tags,apply-block.ts --check swing,range-52w,calendar-dates, tc with no new errors: all okTICKERS=DXJ ./scripts/update-data.ts(exit 0), DXJ in api index.json:{"pctFrom52wHigh":-3.29,"athPrice":61.2933,"athDate":"2026-10-06","athBasis":"daily closes since 2006-06-16","pctFromAth":-3.29,"volatility1y":19.11,"sigmaFromMean60d":-0.23,"high60d":61.2933,"low60d":56.4}; data discarded (git checkout -- api/ && git clean -fd api/), nothing committed