signal_aggregator + engine: drop write-only counters and unreachable branches (no behaviour change)
- SignalAggregator.pb_funnel / cp_funnel and the 19 _reject() ticks inside _try_m5_pullback / _try_chart_pattern: class-level rejection counters nothing in the repo reads. Every gate keeps its early return; only the counter bump before it is gone. - _TP_QUALITY_SCALE: the "B"/"C" entries and the 0.75 default could never be selected — the XAU ATR generator is only called for A+/A. The lookup is now a direct index so a violated invariant fails loudly instead of scaling silently. - engine._classify_regime no longer takes the unused DataFrame argument, and the structure S/R branch tests the 5-minute frame only (M1 is never a primary). Parity: 12-month M5 and H1 books regenerated byte-identical (md5 a28fed4becd056466c26d6a947e1a0e5 / d20405ef64f069770c258bb9bed1ac90). Suite: 461 passed, 0 failed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0156YhogLytzj9P2iH1skGbL
This commit is contained in:
@@ -153,7 +153,7 @@ class TechnicalEngine:
|
||||
if "candlestick" not in disabled: self._detect_candlestick_patterns(df, result)
|
||||
|
||||
# ── Classify market regime ─────────────────────────────────
|
||||
self._classify_regime(df, result)
|
||||
self._classify_regime(result)
|
||||
|
||||
# ── Regime-aware RSI reinterpretation ──────────────────────
|
||||
if self.config.rsi_mode == "regime_aware" and "rsi" not in disabled:
|
||||
@@ -873,7 +873,7 @@ class TechnicalEngine:
|
||||
def _compute_structure_sr(self, df: pd.DataFrame, result: TechnicalAnalysis):
|
||||
"""Detect swing high/low structure levels for S/R and trade setup."""
|
||||
base_lookback = self.config.swing_sr_lookback
|
||||
if result.timeframe in ("1min", "5min"):
|
||||
if result.timeframe == "5min":
|
||||
base_lookback = max(base_lookback, 120)
|
||||
lookback = min(base_lookback, len(df) - 1)
|
||||
if lookback < 10:
|
||||
@@ -1096,7 +1096,7 @@ class TechnicalEngine:
|
||||
confidence=conf, description=desc, weight=rsi_ind.weight,
|
||||
)
|
||||
|
||||
def _classify_regime(self, df: pd.DataFrame, result: TechnicalAnalysis):
|
||||
def _classify_regime(self, result: TechnicalAnalysis):
|
||||
"""Classify the market regime (trending vs ranging vs transitioning)."""
|
||||
adx_sig = result.indicators.get("adx")
|
||||
ema_sig = result.indicators.get("ema_trend")
|
||||
|
||||
Reference in New Issue
Block a user