Repository navigation
Add backtesting framework, parameter optimization, and drift metrics - #23
Merged
Merged
Conversation
- Add full backtesting suite: BTC DCA simulation, options hedging (puts/collars), drawdown strategies (cash reserve, trailing stop, adaptive sizing), and SPY/QQQ buy-and-hold benchmarks - Add parameter optimizer with grid search over stop_offset × buy_offset × coverage_threshold, rolling 21-day metrics, drift detection, and volatility regime classification - Generate 31-page comparison PDF with charts, risk analysis, and backtest limitations - Update strategy defaults to grid-search-optimized values: stop_offset=1.25%, buy_offset=$0.50, coverage=25%, lot_size=200 - Add drift metrics to Netlify Blobs state snapshot (rolling Sharpe, volatility, regime, suggested params, drift alerts) - Add order replacement logic with cancel-before-replace and PDT safety - Extend Order entity with side, order_id, created_at fields - Add cancel_order_by_id to SafeCashBot with state verification - Add Slack oncall summary notifications - Add IWM to Twelve Data symbol map - Replace emoji with text indicators in logs for CI/terminal compatibility - Add docs: strategy writeup PDF and comparison backtest PDF Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pipe drift_metrics from main.py into market_data.json so the dashboard can render regime status, rolling Sharpe/vol/return stat cards, a parameter comparison table, and a pulsing alert banner when Sharpe < -1.0 or regime is HIGH_VOL. Co-Authored-By: Claude Opus 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
Test plan
python -m trading_system.backtests.strategy_comparison_backtest— verify 31-page PDF generates with all sectionspytest tests/— verify all unit tests pass (order entities, state manager, momentum DCA, simulation, order replacement)🤖 Generated with Claude Code