Gate all XAU-only aggregator logic by pair

The SELL quality gate (6e), SELL volatility gate (6g), M5 noise gates
(6h), ATR trade-setup generator, and M5 pullback archetype are all
gold-tuned but previously keyed only on xau_strategy.enabled or the
timeframe, so they would have silently applied gold constants to any
other pair. Each now also requires display_name == "XAU/USD".

No behavior change for XAU (conditions are tautologically true for the
only registered pair today) — verified by test suite and pinned-window
backtest CSV diff.
This commit is contained in:
Harwinder Sekhon
2026-07-10 20:53:23 -04:00
parent 1bc48915bd
commit db50bf02d7
+10 -3
View File
@@ -704,6 +704,7 @@ class SignalAggregator:
or (report.final_signal == SignalStrength.NEUTRAL and report.final_score < 0)
)
if (self.config.xau_strategy.enabled
and report.display_name == "XAU/USD"
and xau_is_sell_dir
and report.signal_quality not in self.config.xau_strategy.sell_min_quality):
report.warnings.append(
@@ -734,6 +735,7 @@ class SignalAggregator:
# Shorts in quiet markets fade against gold's macro uptrend;
# only take sells when volatility regime confirms real selling.
if (self.config.xau_strategy.enabled
and report.display_name == "XAU/USD"
and xau_is_sell_dir
and report.signal_quality in ("A+", "A", "B", "C")
and report.volatility_regime
@@ -744,12 +746,16 @@ class SignalAggregator:
report.signal_quality = "D"
report.trade_setup = None
# ── 6h. M5 noise gate ────────────────────────────────────
if self.config.primary_timeframe == Timeframe.M5:
# ── 6h. M5 noise gate (gold-tuned thresholds — XAU only) ──
if (self.config.primary_timeframe == Timeframe.M5
and report.display_name == "XAU/USD"):
self._apply_m5_filters(report)
# ── 7. Trade setup for actionable signals ──────────────────
if report.trade_setup is None and report.signal_quality in ("A+", "A"):
# ATR generator is XAU-only: it hardcodes gold pip value and
# 2-decimal price rounding.
if (report.trade_setup is None and report.signal_quality in ("A+", "A")
and report.display_name == "XAU/USD"):
atr = (report.primary_analysis.key_levels.get("atr", 0)
if report.primary_analysis else 0)
if atr > 0:
@@ -765,6 +771,7 @@ class SignalAggregator:
# trend-continuation pullback (retrace to EMA21/KC-mid). Runs
# after reasons so its marker lands at reasons[0] for tagging.
if (self.config.primary_timeframe == Timeframe.M5
and report.display_name == "XAU/USD"
and self.config.xau_strategy.m5_pullback_enabled
and report.trade_setup is None
and report.signal_quality != "F"):