finding · mql5/findings/forex_shared_data/ROTATION-MECHANISM.md
A coverage-ledger-driven, deficit-first engine that tests whether a candidate feature is orthogonal (and non-redundant vs siblings) across every market condition a feature must survive in — not just one calendar window.
The two naive approaches both fail:
The rotation mechanism replaces both with a coverage-ledger-driven, deficit-first loop.
A stratum is one cell of:
asset_class × symbol × threshold × vol(low/mid/high) × session(Asian/US-EU) × trend(up/flat/down)
00:00–08:00, US-EU 12:00–20:00. Bars outside both bands are excluded.close − EMA(close, span=200) normalized by its rolling std: up (z>0.5) / down (z<−0.5) / flat.Base cells (symbol × threshold) = 19 forex + 62 crypto = 81, each expanded by up to 3 vol × 2 session × 3 trend = 18 strata.
Kernels need a contiguous 200-bar causal window (de-gap respected, no look-ahead). Restricting the input bars to one regime would shatter that window. So: fetch the contiguous series once, compute the candidate matrix (each value sees a proper trailing window), attach the regime label to each output value-row, and a stratum's data = the value-rows whose label matches. The kernels always see clean causal windows; stratification happens on the outputs.
read coverage ledger
→ deficit[s] = target_N − paths_done[s] for every FEASIBLE stratum s
→ pick the K strata with the LARGEST deficit (least-covered first)
→ for each picked stratum:
pull its REAL value-rows
stationary block-bootstrap resample (Politis–Romano; preserves local autocorrelation)
FUSED PASS:
candidate × production : Spearman |ρ| + Chatterjee ξ (orthogonality)
candidate × candidate : Leave-out R² + max |Spearman| (redundancy / siblings)
paths_done[s] += 1 ; append per-path result ; persist ledger
Loop batches until every feasible stratum reaches target_N (default 20). At 750-threshold crypto cells (spearman-only tier) ξ is skipped — too few bars per slice for a reliable conditional metric; Spearman still runs.
All of the above is implemented in rotating_slice_orthogonality_probe.py — one byte-identical engine shared with the crypto hub, invoked with --asset forex or --asset crypto. See the probes page for the engine + the three-axis gate probes, and the overview for scope and run recipes.