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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user