19 Commits
Author SHA1 Message Date
Luke Mosoti a89156b402 feat: add strategy backtesting module for live model evaluation
- Introduced `strategy_backtest.py` as a single source of truth for scoring and backtesting.
- Implemented functions to load live model bundles, build feature frames, and execute backtests.
- Ensured consistency between optimized models and their validation/trading counterparts.
- Added functionality for generating trading signals and retrieving the latest trading decision.
2026-07-31 21:52:30 +03:00
Luke Mosoti bbc36d2395 Add lot escalation what-if analysis CSV report
This commit introduces a new CSV file containing the results of a lot escalation what-if analysis. The report includes various regimes, timeframes, trade counts, net profits, final balances, final equities, returns, maximum drawdowns, and profit factors for different escalation scenarios.
2026-07-30 14:56:49 +03:00
Luke Mosoti 75736fe516 Refactor code structure for improved readability and maintainability 2026-07-29 00:24:42 +03:00
Luke Mosoti 82b1e9f559 Refactor code structure for improved readability and maintainability 2026-07-20 20:28:36 +03:00
Luke Mosoti 62c1119fa2 chore: clean up code structure and remove unused code blocks 2026-07-14 11:41:19 +03:00
Luke Mosoti aaa843681c Untrack >100MB report artifacts 2026-07-13 22:36:26 +03:00
Luke Mosoti 067d319984 Add new CSV files for smoke tests including probability summary, session audit, stage survival, and top rejected candidates 2026-07-13 14:30:26 +03:00
Luke Mosoti c75e5c7bad Add central pipeline verification module and session filter implementation
- Introduced `pipeline_verification.py` containing multiple verifier classes for dataset integrity, feature leakage, evaluation integrity, prediction alignment, and more.
- Added `SessionFilter` class in `session_filter.py` for unified session/time-of-day filtering.
- Implemented `VerificationResult` data class for structured verification results.
- Created utility functions for hashing and manifest building.
- Established a test suite for the session filter to ensure correct functionality.
- Updated `__init__.py` to include the new shared module.
2026-07-07 16:04:10 +03:00
Luke Mosoti 6a2bce1d65 Remove lifecycle parity, unit, and three-state contract tests
- Deleted `test_lifecycle_parity.py`, which contained tests for lifecycle event timelines in live and backtest scenarios.
- Deleted `test_lifecycle_units.py`, which included unit tests for lifecycle configurations and floating PnL calculations.
- Deleted `test_three_state_contract.py`, which verified the enforcement of three semantic states across various components.
2026-07-02 13:42:05 +03:00
Luke Mosoti 71a6c90426 Update strategy tester notebook with new results and adjusted max drawdown limit
- Updated parallel processing output times to reflect new execution durations.
- Modified strategy results table with new entries and adjusted values for fixed_tp and fixed_tp_plus_mr strategies.
- Increased maximum drawdown percentage from 30.0 to 35.0.
- Enhanced filtering logic to ensure proper retrieval of results from all_results or valid_results.
2026-07-02 12:00:40 +03:00
Luke Mosoti 3c985fdb4c fix: Loosen M15 ADX/RSI grids and sync regime threshold to 15.0
- Strategy_Tester: ADX_GRID [15.0, 18.0, 20.0], PULLBACK_RSI_GRID [35.0, 40.0, 45.0, 50.0]
- Strategy_Tester: regime is_trend threshold 20.0 -> 15.0
- Explorer: regime is_trend threshold 20.0 -> 15.0
- .gitignore: add nul and .kilo/ entries
- Deleted nul file from repo
2026-06-29 21:45:19 +03:00
Luke Mosoti 2dff0baa02 Add scripts for generating strategy reports and smoke testing Explorer integration
- Implemented `generate_bridge_csv.py` to generate reports for strategy winners from the Strategy Tester notebook.
- Added `smoke_test_explorer.py` to perform smoke tests on the Explorer notebook integration, validating core logic and data processing.
2026-06-19 11:07:05 +03:00
Luke Mosoti 9f8d61bdc0 Fix notebook merge conflicts, update ensemble API, and update README
- Resolve 5 committed git merge conflict markers in GoldRegimeX_Explorer.ipynb
  that rendered it invalid JSON and unexecutable in Jupyter
- Conflict resolution: keep wfo_mode_w dropdown, reg_lambda5_w / min_child_weight5_w
  sliders, Run WFO Score Comparison button, and Section 6 CV Path Inspector from
  copilot branch; keep ensemble API imports (load_xgb_ensemble, get_predictions_ensemble)
  from HEAD
- Fix notebook Sections 1 and 5 to use load_xgb_ensemble / train_xgb_ensemble /
  get_predictions_ensemble instead of old single-model API; ensures equity curves
  and WFO scores match production vol-bucketed ensemble
- Update README changelog with merge conflict resolution and ensemble API fix entry
2026-05-14 10:49:45 +03:00
Luke Mosoti ca2c17286d Refactor optimization scoring and WFO parameters
- Updated MIN_OOS_TRADES_HARD for M15 from 30 to 60.
- Introduced WFO_PARAMS_FAST for quicker intraday regime detection.
- Adjusted WFO_TRIALS and added WFO_TRIALS_FAST to accommodate wider search space.
- Revised scoring formula in compute_cpcv_score to improve accuracy and range.
- Enhanced _run_wfo to support different WFO modes and adjusted CV folds based on TF.
- Aligned feature preparation and state alignment for consistency in backtesting.
- Updated make_objective to include new parameters and improved tree depth and learning rate settings.
- Changed pruner strategy based on TF in run_optimization for better trial management.
2026-05-14 10:25:59 +03:00
Luke Mosoti e741208111 Refactor code structure for improved readability and maintainability 2026-05-14 10:23:09 +03:00
de59b2d9b7 Merge remote-tracking branch 'origin/main' into copilot/fix-oos-scaling-issue
# Conflicts:
#	notebooks/GoldRegimeX_Explorer.ipynb
#	src/optimizer.py

Co-authored-by: lucasmos <160877590+lucasmos@users.noreply.github.com>
2026-05-14 07:19:32 +00:00
87af6a51df Fix WFO bugs, improve scoring formula, add WFO fast mode, update Optuna params and notebook
Agent-Logs-Url: https://github.com/lucasmos/GoldRegime_X/sessions/4537788d-1709-47c0-8a49-0c7fa9086451

Co-authored-by: lucasmos <160877590+lucasmos@users.noreply.github.com>
2026-05-11 12:51:34 +00:00
Luke Mosoti 335fcc7b3f Fix out-of-sample states alignment in backtesting
Updated the out-of-sample (OOS) backtesting process to ensure that the states used are aligned with the OOS data frame index. This change addresses potential mismatches by applying a mask to the states based on the aligned index, improving the accuracy of the backtest results.
2026-05-11 15:43:42 +03:00
Luke Mosoti b2724a4115 Add interactive research notebook for GoldRegime X and update study_headway_cent.db 2026-05-11 14:14:21 +03:00