You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: add custom exception hierarchy, structured logging, and consolidated resilience
- Add strategies/exceptions.py with TradingError hierarchy (#78):
TradingHaltError (fail-closed), SignalUnavailableError (fail-open),
OrderExecutionError, RateLimitError, DataValidationError,
StateCorruptionError
- Replace print() with structured logging in 6 scripts (#67):
screener_trade, momentum_trade, scan_with_sentiment,
position_manager, screener, drift_monitor
- Wrap EDGAR HTTP calls with @retry_api() decorator (#66):
_fetch_edgar_tickers() and _fetch_edgar_facts() in fundamentals.py
- Standardize error handling policy (#61):
TradingHaltError breaks loops (fail-closed),
SignalUnavailableError degrades gracefully (fail-open)
- Update all affected tests for new exception types and caplog
Closes#61, closes#66, closes#67, closes#78
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: prevent TradingHaltError from being silently swallowed in signal layers
The `except Exception` handlers around sentiment and insider calls in all
three trade scripts would swallow TradingHaltError from a tripped circuit
breaker, allowing trading to continue without safety checks. Add explicit
`except TradingHaltError: raise` guards so circuit breaker propagates.
Also update RUNBOOK.md to reference TradingHaltError instead of RuntimeError.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: update cooldown docstring and move TradingHaltError to top-level import
- cooldown.py docstring still referenced SystemExit instead of StateCorruptionError
- fundamentals.py had unnecessary local import of TradingHaltError inside function body
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address 8 issues from PR review (consistent circuit breaker handling)
- Change TradingHaltError handling from `raise` to `break` for insider and
sentiment checks in momentum_trade, screener_trade, scan_with_sentiment
(6 sites) — matches the fundamentals pattern so circuit breaker allows
graceful loop exit with summary/alerts instead of crashing mid-loop
- Fix misaligned continuation indentation in logger.info calls for stop
order logging in screener_trade.py and momentum_trade.py (2 sites)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: resolve rebase conflicts (custom exceptions + sanitized errors + caplog)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments