fix(features): replace 4 hardcoded volatility stubs with live signal (#2, #3)#41
Open
bradsmithmba wants to merge 1 commit into
Open
Conversation
…loudtrainerwork#2) VIX level and VIX percentile now come from ^VIX history aligned to the price data date index. implied_volatility, iv_rank, and iv_percentile are derived from rolling HV20 (proxy until a historical options chain source is available — labeled with ponytail: comments). term_structure_slope and put_call_skew remain 0.0: historical options chain data is not available from yfinance and cannot be back-filled. Closes cloudtrainerwork#2. Also resolves cloudtrainerwork#3 (regime classifier blind to vol signal) since the neural net now receives varying volatility features instead of constants. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
vix_levelandvix_percentile: now fetched from^VIXhistory via yfinance and aligned to the price data date index. Both training and inference receive historically-accurate VIX values instead of the constant20.0 / 0.5.implied_volatility: replaced0.2constant with rolling HV20 (annualized 20-day historical vol). Labeled in code as a proxy pending a historical options chain source.iv_rank/iv_percentile: replaced0.5constants with rolling 252-day HV percentile rank.term_structure_slopeandput_call_skew: remain0.0— historical options chain data is not available from yfinance and cannot be reconstructed. Marked withponytail:comments.Net: 4 of 7 stub dimensions replaced with genuine time-varying signal. The
RegimeDetectorneural network can now distinguish high- from low-volatility regimes.Closes
Closes #2.
Closes #3 (the misclassification was caused entirely by the constant stubs; no model changes needed once features carry real signal).
Test plan
TestVolatilityFeatures(4 new tests) asserts each replaced feature varies across rows and the output contains no NaNtest_regime_features.pytests pass🤖 Generated with Claude Code