Fix remaining QA issues: technicals, caches, engine, screener#116
Merged
mikejamescalvert merged 1 commit intomainfrom Mar 27, 2026
Merged
Fix remaining QA issues: technicals, caches, engine, screener#116mikejamescalvert merged 1 commit intomainfrom
mikejamescalvert merged 1 commit intomainfrom
Conversation
Technical analysis:
- Fix daily_return_pct crash with <2 bars (IndexError)
- Fix weekly trend proxy: was sampling entire dataset instead of last 60 bars
- Add NaN filtering on all indicator outputs (prevents downstream issues)
- Add ADX (trend strength) and ROC (momentum rate) indicators
- Add normalized BB width % for cross-symbol comparison
- Replace bare Exception catch with specific types + logging
Data providers:
- Fix timezone bugs in all 3 cache loaders (fundamentals, earnings, crypto)
that could cause naive-vs-aware datetime TypeError
- Add HTTP error handling to earnings calendar fetch
- Filter past earnings dates from live fetch (was only filtered in cache)
Strategy engine:
- Add zero-price guard for buy orders (validates price > 0 before sizing)
- Add zero-price guard for sell limit orders
- Remove fragile `endswith("USD")` crypto detection from broker (was
misidentifying stock symbols)
Screener:
- Add VIX-adaptive screening thresholds (low vol = stricter, high vol = relaxed)
- Auto-add top 3 screener picks to watchlist for immediate trading
(previously screener created issue but candidates weren't tradeable
until next watchlist review)
Co-Authored-By: Claude Opus 4.6 (1M context) <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
Addresses the remaining issues from the comprehensive QA audit (PR #115 covered the first 10).
Technical Analysis (6 fixes)
IndexErrorwhen <2 bars. Now guarded.close.iloc[-60:].iloc[::5].math.isnancheck. Prevents AI from seeing NaN in analysis.bb_width_pctfor cross-symbol volatility comparison.Data Provider Cache Fixes (4 fixes)
datetime.fromisoformat()could return naive datetimes. Comparing withdatetime.now(tz=UTC)would raiseTypeError. Fixed in fundamentals, earnings, and crypto_market.urlopen()had no try/except around it. Now catches and logs HTTP errors.days_until < 0but live fetch didn't. Fixed.Strategy Engine (2 fixes)
current_pricewas 0 (corrupted data), would divide by zero or create invalid orders. Now validates> 0before using.Broker (1 fix)
endswith("USD")would misidentify stock tickers as crypto (applying wrong time-in-force). Removed; now uses onlyasset_classenum and/in symbol.Screener (2 improvements)
TRADING_WATCHLISTfor immediate trading. Previously, screener only created a GitHub issue and candidates waited days for the weekly watchlist review.Test plan
🤖 Generated with Claude Code