Tighten TP targets by 20% for faster hits (configurable tp_tightening_factor=0.8)

Applied uniformly across all 3 trade setup functions. Lowered min_rr_ratio
0.5→0.4 proportionally to preserve trade acceptance rate. SL unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
harwinder
2026-05-22 10:44:16 -04:00
parent 643952a8e2
commit a731b7c8df
3 changed files with 16 additions and 2 deletions
+2 -1
View File
@@ -117,7 +117,8 @@ class SignalConfig:
default_risk_pct: float = 1.0 default_risk_pct: float = 1.0
default_rr_ratio: float = 2.0 default_rr_ratio: float = 2.0
atr_sl_multiplier: float = 1.5 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 @dataclass
+12
View File
@@ -525,6 +525,10 @@ class SignalAggregator:
sl = price - cfg.sl_atr_multiplier * atr sl = price - cfg.sl_atr_multiplier * atr
tp2 = price + tp_mult * 1.5 * 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 sl_distance = price - sl
tp_distance = tp1 - price tp_distance = tp1 - price
rr = tp_distance / sl_distance if sl_distance > 0 else 0 rr = tp_distance / sl_distance if sl_distance > 0 else 0
@@ -576,6 +580,10 @@ class SignalAggregator:
tp2 = price - tp_mult * 1.5 * atr tp2 = price - tp_mult * 1.5 * atr
direction = "SELL" direction = "SELL"
tf = self.config.signals.tp_tightening_factor
tp1 = price + (tp1 - price) * tf
tp2 = price + (tp2 - price) * tf
sl_distance = abs(price - sl) sl_distance = abs(price - sl)
tp_distance = abs(tp1 - price) tp_distance = abs(tp1 - price)
rr = tp_distance / sl_distance if sl_distance > 0 else 0 rr = tp_distance / sl_distance if sl_distance > 0 else 0
@@ -931,6 +939,10 @@ class SignalAggregator:
direction = "SELL" direction = "SELL"
entry, sl = price, sl_price 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) tp1_distance = abs(tp1 - entry)
rr = tp1_distance / sl_distance if sl_distance > 0 else 0 rr = tp1_distance / sl_distance if sl_distance > 0 else 0
+2 -1
View File
@@ -167,7 +167,8 @@ def _():
def _(): def _():
sc = SignalConfig() sc = SignalConfig()
assert sc.min_confidence == 55.0 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.atr_sl_multiplier == 1.5
assert sc.default_rr_ratio == 2.0 assert sc.default_rr_ratio == 2.0
assert sc.cooldown_bars == 5 assert sc.cooldown_bars == 5