fix: Adjust trailing stop parameters for Gold (XAUUSD) trading
Deploy to Windows VPS / deploy (push) Has been cancelled
Deploy to Windows VPS / deploy (push) Has been cancelled
PROBLEM: - Trailing stop values were optimized for Forex, not Gold - breakeven_buffer_pips=5 → only $0.05 buffer for Gold (way too small!) - min_distance_points=100 → only $1.00 minimum (too tight!) - Trades were being stopped out with only ~$0.50 profit SOLUTION (Gold-optimized): - breakeven_buffer_pips: 5 → 300 ($3.00 buffer) - min_distance_points: 100 → 500 ($5.00 minimum distance) - atr_multiplier: 1.0 → 1.5 (more breathing room) IMPACT: - Trades now have proper room to develop - Less premature stop-outs - Better profit potential per trade Updated in: - enhanced_trailing_stop.py (class defaults + initialization) - TradingBot_V1.6_Adaptive_Complete_CORRECTED.ipynb (Cell 78) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"timestamp": "2026-01-21T13:31:39.173342",
|
"timestamp": "2026-01-21T22:36:39.567434",
|
||||||
"session_thresholds": {
|
"session_thresholds": {
|
||||||
"asian": 60,
|
"asian": 60,
|
||||||
"ny": 60,
|
"ny": 60,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class EnhancedTrailingStopManager:
|
|||||||
def __init__(self,
|
def __init__(self,
|
||||||
# Breakeven Settings
|
# Breakeven Settings
|
||||||
breakeven_trigger_pct: float = 0.30, # ← Früher! (war 0.50)
|
breakeven_trigger_pct: float = 0.30, # ← Früher! (war 0.50)
|
||||||
breakeven_buffer_pips: int = 5, # ← +5 Pips über BE
|
breakeven_buffer_pips: int = 300, # ← +$3 für Gold (300 × 0.01)
|
||||||
|
|
||||||
# Profit Locking (Multi-tier)
|
# Profit Locking (Multi-tier)
|
||||||
tier1_trigger: float = 0.50, # Bei 50% zu TP
|
tier1_trigger: float = 0.50, # Bei 50% zu TP
|
||||||
@@ -47,7 +47,7 @@ class EnhancedTrailingStopManager:
|
|||||||
|
|
||||||
# ATR-based Trailing
|
# ATR-based Trailing
|
||||||
use_atr_trailing: bool = True,
|
use_atr_trailing: bool = True,
|
||||||
atr_multiplier: float = 1.0, # Trail by 1 × ATR
|
atr_multiplier: float = 1.5, # Trail by 1.5 × ATR (mehr Spielraum)
|
||||||
|
|
||||||
# Time-based Protection
|
# Time-based Protection
|
||||||
time_based_breakeven: bool = True,
|
time_based_breakeven: bool = True,
|
||||||
@@ -57,7 +57,7 @@ class EnhancedTrailingStopManager:
|
|||||||
session_trailing_multipliers: Optional[Dict[str, float]] = None,
|
session_trailing_multipliers: Optional[Dict[str, float]] = None,
|
||||||
|
|
||||||
# Technical
|
# Technical
|
||||||
min_distance_points: int = 100):
|
min_distance_points: int = 500): # Min $5 für Gold (500 × 0.01)
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
breakeven_trigger_pct: Bei wie viel % zu TP → Breakeven
|
breakeven_trigger_pct: Bei wie viel % zu TP → Breakeven
|
||||||
@@ -452,7 +452,7 @@ from enhanced_trailing_stop import EnhancedTrailingStopManager, create_enhanced_
|
|||||||
# Initialize Manager
|
# Initialize Manager
|
||||||
enhanced_trailing = EnhancedTrailingStopManager(
|
enhanced_trailing = EnhancedTrailingStopManager(
|
||||||
breakeven_trigger_pct=0.30, # Früher BE (30% statt 50%)
|
breakeven_trigger_pct=0.30, # Früher BE (30% statt 50%)
|
||||||
breakeven_buffer_pips=5, # +5 Pips über BE
|
breakeven_buffer_pips=300, # +$3 über BE (300 points × 0.01 = $3 für Gold)
|
||||||
|
|
||||||
tier1_trigger=0.50, # Multi-tier Locking
|
tier1_trigger=0.50, # Multi-tier Locking
|
||||||
tier1_lock_pct=0.25,
|
tier1_lock_pct=0.25,
|
||||||
@@ -462,11 +462,13 @@ enhanced_trailing = EnhancedTrailingStopManager(
|
|||||||
tier3_lock_pct=0.75,
|
tier3_lock_pct=0.75,
|
||||||
|
|
||||||
use_atr_trailing=True, # ATR-based Trailing
|
use_atr_trailing=True, # ATR-based Trailing
|
||||||
atr_multiplier=1.0,
|
atr_multiplier=1.5, # Erhöht von 1.0 auf 1.5 für mehr Spielraum
|
||||||
|
|
||||||
time_based_breakeven=True, # Time-based BE
|
time_based_breakeven=True, # Time-based BE
|
||||||
hours_to_breakeven=4.0,
|
hours_to_breakeven=4.0,
|
||||||
|
|
||||||
|
min_distance_points=500, # Min $5 Abstand (500 × 0.01 = $5 für Gold)
|
||||||
|
|
||||||
session_trailing_multipliers={ # Session-aware
|
session_trailing_multipliers={ # Session-aware
|
||||||
'asian': 1.0,
|
'asian': 1.0,
|
||||||
'ny': 1.5,
|
'ny': 1.5,
|
||||||
|
|||||||
@@ -4480,5 +4480,32 @@
|
|||||||
},
|
},
|
||||||
"position_control_active": true,
|
"position_control_active": true,
|
||||||
"order_result": "OrderSendResult(retcode=10009, deal=626476900, order=687904350, volume=0.1, price=4859.07, bid=0.0, ask=0.0, comment='Request executed', request_id=1587946471, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='XAUUSD', volume=0.1, price=4859.06, stoplimit=0.0, sl=4850.599735563063, tp=4879.51066109234, deviation=20, type=0, type_filling=1, type_time=0, expiration=0, comment='TradingBot_V1.6', position=0, position_by=0))"
|
"order_result": "OrderSendResult(retcode=10009, deal=626476900, order=687904350, volume=0.1, price=4859.07, bid=0.0, ask=0.0, comment='Request executed', request_id=1587946471, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='XAUUSD', volume=0.1, price=4859.06, stoplimit=0.0, sl=4850.599735563063, tp=4879.51066109234, deviation=20, type=0, type_filling=1, type_time=0, expiration=0, comment='TradingBot_V1.6', position=0, position_by=0))"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"timestamp": "2026-01-21T22:07:45.539524",
|
||||||
|
"version": "V1.6_Adaptive_Complete",
|
||||||
|
"symbol": "XAUUSD",
|
||||||
|
"entry_signal": 1,
|
||||||
|
"confidence": 96.04,
|
||||||
|
"adaptive_threshold": 70,
|
||||||
|
"signal_quality": "excellent",
|
||||||
|
"market_regime": "ranging",
|
||||||
|
"regime_strength": 23.441527630046537,
|
||||||
|
"risk_adjusted_strength": 150099.4901620502,
|
||||||
|
"adaptive_interval": 15,
|
||||||
|
"session": "asian",
|
||||||
|
"relaxed_features": {
|
||||||
|
"pullback_entry_disabled": true,
|
||||||
|
"lower_confidence_threshold": true,
|
||||||
|
"lower_min_strength": true,
|
||||||
|
"fixed_tf_alignment": true
|
||||||
|
},
|
||||||
|
"adaptive_features": {
|
||||||
|
"adaptive_rhythm": true,
|
||||||
|
"session_aware": true,
|
||||||
|
"volatility_based": true
|
||||||
|
},
|
||||||
|
"position_control_active": true,
|
||||||
|
"order_result": "OrderSendResult(retcode=10009, deal=629556692, order=692066470, volume=0.1, price=4816.89, bid=0.0, ask=0.0, comment='Request executed', request_id=1587946472, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='XAUUSD', volume=0.1, price=4816.86, stoplimit=0.0, sl=4801.415068173482, tp=4854.772329566296, deviation=20, type=0, type_filling=1, type_time=0, expiration=0, comment='TradingBot_V1.6', position=0, position_by=0))"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user