From bb40bceb4cc9c6649a9e57d63d4374a53023130f Mon Sep 17 00:00:00 2001 From: harwinder Date: Fri, 22 May 2026 10:44:16 -0400 Subject: [PATCH] Tighten TP targets by 20% for faster hits (configurable tp_tightening_factor=0.8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Applied uniformly across all 3 trade setup functions. Lowered min_rr_ratio 0.5→0.4 proportionally to preserve trade acceptance rate. SL unchanged. --- config.py | 3 ++- signal_aggregator.py | 12 ++++++++++++ test_all.py | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index b0fd579..f27024b 100755 --- a/config.py +++ b/config.py @@ -117,7 +117,8 @@ class SignalConfig: default_risk_pct: float = 1.0 default_rr_ratio: float = 2.0 atr_sl_multiplier: float = 1.5 - min_rr_ratio: float = 0.5 + min_rr_ratio: float = 0.4 + tp_tightening_factor: float = 0.8 @dataclass diff --git a/signal_aggregator.py b/signal_aggregator.py index 07cdf9f..99b1d1c 100755 --- a/signal_aggregator.py +++ b/signal_aggregator.py @@ -525,6 +525,10 @@ class SignalAggregator: sl = price - cfg.sl_atr_multiplier * atr tp2 = price + tp_mult * 1.5 * atr + tf = self.config.signals.tp_tightening_factor + tp1 = price + (tp1 - price) * tf + tp2 = price + (tp2 - price) * tf + sl_distance = price - sl tp_distance = tp1 - price rr = tp_distance / sl_distance if sl_distance > 0 else 0 @@ -576,6 +580,10 @@ class SignalAggregator: tp2 = price - tp_mult * 1.5 * atr direction = "SELL" + tf = self.config.signals.tp_tightening_factor + tp1 = price + (tp1 - price) * tf + tp2 = price + (tp2 - price) * tf + sl_distance = abs(price - sl) tp_distance = abs(tp1 - price) rr = tp_distance / sl_distance if sl_distance > 0 else 0 @@ -931,6 +939,10 @@ class SignalAggregator: direction = "SELL" entry, sl = price, sl_price + tf = self.config.signals.tp_tightening_factor + tp1 = entry + (tp1 - entry) * tf + tp2 = entry + (tp2 - entry) * tf + tp1_distance = abs(tp1 - entry) rr = tp1_distance / sl_distance if sl_distance > 0 else 0 diff --git a/test_all.py b/test_all.py index c8dcb41..e630789 100644 --- a/test_all.py +++ b/test_all.py @@ -167,7 +167,8 @@ def _(): def _(): sc = SignalConfig() assert sc.min_confidence == 55.0 - assert sc.min_rr_ratio == 0.5 + assert sc.min_rr_ratio == 0.4 + assert sc.tp_tightening_factor == 0.8 assert sc.atr_sl_multiplier == 1.5 assert sc.default_rr_ratio == 2.0 assert sc.cooldown_bars == 5