Enable BUY-only chart patterns on M5 — bearish patterns dropped (OOS negative)

M5 factory: cp_enabled=True, patterns limited to inv_hs, double_bottom,
bull_flag. SELL CP lost -3.21R on OOS; BUY CP: +41.8R PF 1.60 on 12mo,
+65.2R PF 1.48 on 5yr. Adds +22R to the M5 book (708 vs 513 trades).
M15/H1 remain disabled — all failed OOS validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015kby7M9JwpYi8NQT2yoxAi
This commit is contained in:
Harwinder Sekhon
2026-07-16 16:08:13 -04:00
parent ca37a7ab5a
commit de6424ec3f
3 changed files with 23 additions and 6 deletions
+9 -4
View File
@@ -1841,11 +1841,13 @@ def _():
inline_cfg.xau_strategy.blocked_regimes = ["trending"]
inline_cfg.xau_strategy.sell_blocked_hours_utc = [15, 17]
if tf == Timeframe.M5:
# Documented per-TF override (see xauusd.py docstring):
# hour 9 UTC blocked on M5 only.
# Documented per-TF overrides (see xauusd.py docstring):
# hour 9 UTC blocked + BUY-only chart patterns on M5 only.
inline_cfg.xau_strategy.blocked_hours_utc = (
inline_cfg.xau_strategy.blocked_hours_utc + [9]
)
inline_cfg.xau_strategy.cp_enabled = True
inline_cfg.xau_strategy.cp_patterns = ["inv_hs", "double_bottom", "bull_flag"]
assert dataclasses.asdict(factory_cfg) == dataclasses.asdict(inline_cfg), \
f"XAU factory config differs from inline construction for {tf}"
@@ -2439,13 +2441,16 @@ def _():
assert rep.trade_setup.strategy == "XAU_CP"
@test("CP pipeline: disabled by default — no XAU_CP setups anywhere")
@test("CP pipeline: disabled by default except M5 BUY-only")
def _():
assert XauStrategyConfig().cp_enabled is False
assert PlatformConfig().xau_strategy.cp_enabled is False
from pair_signals import PAIR_PRODUCERS
for tf in (Timeframe.M5, Timeframe.M15, Timeframe.H1, Timeframe.H4):
for tf in (Timeframe.M15, Timeframe.H1, Timeframe.H4):
assert PAIR_PRODUCERS[XAUUSD](tf, None).xau_strategy.cp_enabled is False
m5_cfg = PAIR_PRODUCERS[XAUUSD](Timeframe.M5, None)
assert m5_cfg.xau_strategy.cp_enabled is True
assert m5_cfg.xau_strategy.cp_patterns == ["inv_hs", "double_bottom", "bull_flag"]
cfg = PlatformConfig()
cfg.primary_timeframe = Timeframe.H1
cfg.confirmation_timeframes = [Timeframe.M15, Timeframe.H4]