Add M5 gates 5-6 and trailing-stop exits (+48R → +105R on 12mo)

Gates 5-6 in the M5 filter: block 'high' vol regime entries (chop
transition — 61% WR, negative total while low/normal/extreme all
positive) and block SELLs with RSI<25 (dip already extended, mean-
reverts before target). 365d: 419→311 trades, +41→+48.4R, DD 11.2→8.0R.

Replace the fixed RR-0.5 take-profit with a trailing stop: arm at
+0.6R favorable excursion, trail 0.75R behind best price, stop levels
update at bar close (conservative). The RR-0.5 target was the binding
constraint — winners kept running after TP. Whole trail parameter grid
(arm 0.4-1.2 × dist 0.5-1.25) lands +90-103R, a plateau not a spike;
also +91.7R on the pre-gate 419-trade population. TP1 stays advisory;
Telegram alerts include the arm price and trail distance. max_hold
200→300 bars (trailing exits need room; +10R).

12mo M5, same 311 trades: +105.0R total, PF 2.27, DD 7.9R, 61% WR,
train/val +54.6/+50.4, every quarter positive.
This commit is contained in:
harwinder
2026-07-09 13:34:57 -04:00
parent 8687f98b39
commit 0393087168
4 changed files with 171 additions and 6 deletions
+16
View File
@@ -254,6 +254,22 @@ def format_signal_message(report: SignalReport) -> str:
lines.append(f"🎯 TP2: `{_fmt_price(ts.take_profit_2)}`")
lines.append(f"⚖️ RR: 1:{ts.risk_reward:.1f}")
# Trailing-stop management plan (matches backtested exit model:
# TP1 is advisory, the trail is the exit).
sig_cfg = PlatformConfig().signals
if sig_cfg.trail_arm_r > 0:
risk_dist = abs(ts.entry_price - ts.stop_loss)
if ts.direction == "BUY":
arm_price = ts.entry_price + sig_cfg.trail_arm_r * risk_dist
else:
arm_price = ts.entry_price - sig_cfg.trail_arm_r * risk_dist
trail_dist = sig_cfg.trail_dist_r * risk_dist
lines.append(
f"🔄 Trail: once price hits `{_fmt_price(arm_price)}` "
f"(+{sig_cfg.trail_arm_r:.1f}R), trail SL ${trail_dist:.2f} "
f"behind best price — TP1 is a guide, let it run"
)
lines += ["", "━━━━━━━━━━━━━━━━━━━━",
"_Educational / research use only._"]