- Introduced `test_lifecycle_parity.py` to verify event timelines between live and backtest evaluations, ensuring consistent activation, partial close, scalp exit, and regime shift behaviors across different timeframes.
- Added `test_lifecycle_units.py` for unit testing of lifecycle configurations, including cent normalization, activation thresholds, and the absence of R-multiple fields.
- Created `test_three_state_contract.py` to enforce and validate the three-state regime (TREND, MEAN_REVERSION, VOLATILITY_SHOCK) across various components, ensuring that any attempt to use more than three states raises appropriate errors.
- Updated search space for `n_states` in models M15 and M5 from categorical to integer range (3 to 4).
- Lowered `reg_alpha` and `reg_lambda` ranges to allow HMM OHE signal through for models M15 and M5.
- Adjusted the `make_objective` function to reflect changes in parameter suggestions for M5 and M15.
- Introduced new model configuration file for stage1 M15 with optimized parameters and score.
- Added binary changes to the study_headway_cent database.
- 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
- Deleted `signal_evaluator.py`, which contained the previous Z-Score and RCEV evaluation logic.
- Added `signal_engine.py`, implementing a new stateful signal engine for regime confirmation and trade management.
- The new engine evaluates entry and exit conditions based on regime stability, XGBoost confidence, and Bollinger Band positions.
- Introduced constants for minimum confirmation bars, entry probabilities, maximum hold bars, and profit erosion thresholds.
- Introduced RCEVScorer class for calculating expected dollar profit based on historical trade outcomes and market conditions.
- Replaced Z-Score signal gating with RCEV scoring in SignalEvaluator for live evaluations.
- Added new configuration for RCEV thresholds and tiered floors based on timeframes.
- Enhanced MT5 trader logic to utilize RCEV scoring for trade decision-making, including regime-aware take-profit and stop-loss calculations.
- Updated ATR trailing stop logic to incorporate new RCEV parameters and configurations.
- Maintained backward compatibility with existing Z-Score logic for scenarios without RCEV calibration.
- Deleted ensemble metadata, feature scalers, and model metadata for H1 headway cent models.
- Removed LSTM regime classifier files for H1 headway cent models.
- Deleted corresponding files for model_0, model_1, and model_2 in both H1 and M15 headway cent directories.
- Cleaned up unnecessary files to streamline the model directory structure.
- Full workflow from raw data to live trading (Phase 0–7)
- LSTM ensemble, temperature calibration, fine-tuning, staleness/auto-retrain
- Sensitivity analysis and tiered Z-Score trading modes
- Updated command reference (all 16 modes + 22 CLI options)
- Signal logic with exact TF Z-Score cutoffs
- Guardian LSTM auto-retrain documentation
- Model files layout and troubleshooting guide
- data_consolidator: add consolidate_usdchf_m15/m5 producing USDCHF_master_M15.csv
and USDCHF_master_M5.csv; H1 legacy fallback now excludes M5/M15 filenames
- processor: _USDCHF_PATH_BY_TF lookup so each TF loads its matching-frequency
USDCHF master (H1→master.csv, M15→master_M15.csv, M5→master_M5.csv)
- main: cmd_consolidate runs all three TF consolidations in one pass with per-TF summary
- optimizer: H1 n_states reverted [3,4], obs_cov floor raised 0.1→0.5,
MIN_OOS_TRADES_BY_TF["H1"] lowered 200→75
- risk_manager: H1 headway_cent small-account daily cap raised 1→2 trades
- README: per-TF USDCHF filename/master table; dedicated "Getting deep history from MT5"
section (any symbol, any TF) with MetaQuotes-Demo Pro Tip
- visualizer.py: _tf_dir now uses reports/<TF>_<broker>/ so M5_headway_cent
and M5_standard charts save to separate folders and never overwrite each other
- All 5 plot functions + generate_full_report accept broker= param and pass it through
- main.py cmd_report: passes broker= to generate_full_report; print updated to
show reports/<TF>_<broker>/ path
- README.md: --mode report added to all four per-TF workflows (H1, M15, M5 cent,
M5 standard); Step 6 updated with correct broker-specific folder tree; command
reference table updated with broker-specific path description
- State Labels section rewritten: shows Chop (n_states=3), Chop_Low=2
and Chop_High=3 (n_states=4) with mean-return rank explanation
- Added explanation of why M5 uses two Chop sub-states and what
distinguishes them (log-return rank, not volatility)
- Signal logic table updated: "Chop state (2 or 3)" blocked
- Regime-aligned filter note updated to reference both state 2 and 3
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Cent vs Standard account section with P&L conversion tables
(explains that +$2.40 cent = $0.024 real USD, standard is 1:1)
- Remove all paper trading / --account demo|live references;
replace with --mode demo (real orders, no prompt) and --mode live (real orders, YES prompt)
- Update model file references to broker+TF naming convention
(hmm_model_H1_headway_cent.pkl etc.)
- Update study DB references to per-broker files (study_headway_cent.db / study_standard.db)
- Add M5 standard account workflow with prob_threshold 0.55-0.60 rationale
- Signal logic table updated: regime-aligned filter (Bull=BUY only, Bear=SELL only, Chop=blocked)
- Probability threshold table per TF per broker with search ranges
- Spread viability guard: cent M5-only 1.5x vs standard all-TFs 3.0x
- Standard account guard documented in risk management table
- Data freshness section explaining IS/OOS split dates and sync_validate scope
- Degenerate HMM training abort guard documented
- Troubleshooting table updated; removed dry_run/--account demo row
- State labels table updated with signal eligibility notes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
M15 generates ~96 bars/day vs M5's 288 — both now get a 4-trade/day
cap for small accounts so the optimizer can clear MIN_OOS_TRADES=200
thresholds during the coming re-optimization.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- prob_threshold: 0.52-0.65 -> 0.50-0.58 (ceiling cut stops optimizer settling
at 0.64 where only 40 trades fire per OOS window)
- short_threshold: 0.35-0.48 -> 0.42-0.50 (raises floor for symmetric buy/sell
sensitivity; was asymmetrically biased against shorts)
- README: update probability threshold table for M15 and H1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- risk_manager: store tf in AdaptiveRiskManager.__init__; get_trade_limits
and can_trade use self.tf by default — M5 small accounts correctly get
4 trades/day without threading tf= through every call site
- mt5_trader: pass tf=tf to both AdaptiveRiskManager instantiations so
the live loop displays and enforces trades=0/4 for M5 (was 0/2)
- README: DXY -> USDCHF throughout; TF-specific model file names; M5/M15/H1
workflow sections; consolidate mode in command reference; correct
short_threshold table; M5 n_states restriction note; updated trade limit
table showing M5 4/day cap; period 6m recommendation for H1/M15 validate
- models/m5_meta.json: updated with latest optimization result (score 4.49)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- README: add dedicated Volatility Ensemble section documenting three-model
bucketing (low/med/high ATR), feature table, threshold explanation, and
ONNX file list; update pipeline diagram, train/export descriptions, and
prob_threshold range (0.505-0.60)
- optimizer.py: lower prob_threshold search space lower bound 0.52 → 0.505
so Optuna can find thresholds matching the model's real output range
- processor.py: add map_dxy_to_bars() helper that forward-fills DXY beyond
file coverage (handles sync data newer than last DXY export); fix
load_dxy_data() date format to match YYYY-MM-DD saved format
- validator.py: use load_xgb_ensemble + get_predictions_ensemble; import
and apply map_dxy_to_bars in _apply_features() so DXY is included in
validation inference
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DXY is a daily index exposed by MT5 only at the day level — there is no
per-timeframe variant. Remove the three separate dxy_raw_path entries
from TF_CONFIG and replace them with a single module-level DXY_RAW_PATH
constant (data/raw/DXY_data.csv) that all timeframes share.
process_pipeline() now references DXY_RAW_PATH directly; the pipeline
degrades gracefully (4-feature model) if the file is absent.
README Data Setup section updated with DXY export instructions and the
single expected filename.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers installation, data setup, Telegram config, full step-by-step workflow
for H1/M15/M5 timeframes, signal logic, risk management, MQL5 EA, and
troubleshooting. Replaces the auto-generated GitHub placeholder.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>