fix: Update external config files to use 0.10 lot size
ROOT CAUSE FOUND: User was right - there was an external config file! advanced_position_management.py had hardcoded values: - base_risk = 0.01 (should be 0.02) - return 0.01 fallback (should be 0.10) - No min/max lot enforcement CHANGES: 1. advanced_position_management.py: ✅ base_risk: 0.01 → 0.02 (2% risk) ✅ return fallback: 0.01 → 0.10 ✅ volume_min: max(broker_min, 0.10) ✅ volume_max: min(broker_max, 0.20) 2. session_filter_patch.py: ✅ Added lot sizing config: - min_lot: 0.10 - max_lot: 0.20 - default_lot: 0.10 IMPACT: - Bot will now use 0.10 minimum lot - Adaptive sizing respects 0.10-0.20 range - No more 0.01 lot trades TESTING NEEDED: 1. Restart kernel 2. Reimport advanced_position_management 3. Verify next trade uses 0.10 lot 🎯 Generated with Claude Code Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -28,7 +28,7 @@ class AdaptivePositionSizer:
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
base_risk: float = 0.01,
|
||||
base_risk: float = 0.02,
|
||||
high_confidence_threshold: float = 80.0,
|
||||
medium_confidence_threshold: float = 70.0,
|
||||
high_multiplier: float = 1.5,
|
||||
@@ -105,7 +105,7 @@ class AdaptivePositionSizer:
|
||||
symbol_info = mt.symbol_info(symbol)
|
||||
if not symbol_info:
|
||||
logger.error(f"Symbol info not available for {symbol}")
|
||||
return 0.01 # Minimum
|
||||
return 0.10 # Minimum
|
||||
|
||||
# Pip Value berechnen
|
||||
point = symbol_info.point
|
||||
@@ -117,8 +117,8 @@ class AdaptivePositionSizer:
|
||||
volume = risk_amount / (stop_loss_distance * pip_value)
|
||||
|
||||
# Auf erlaubte Schritte runden
|
||||
volume_min = symbol_info.volume_min
|
||||
volume_max = symbol_info.volume_max
|
||||
volume_min = max(symbol_info.volume_min, 0.10) # Min: Broker-Min oder 0.10
|
||||
volume_max = min(symbol_info.volume_max, 0.20) # Max: Broker-Max oder 0.20
|
||||
volume_step = symbol_info.volume_step
|
||||
|
||||
volume = round(volume / volume_step) * volume_step
|
||||
@@ -458,7 +458,7 @@ class AdvancedPositionManager:
|
||||
enable_adaptive_sizing: bool = True,
|
||||
enable_trailing_stop: bool = True,
|
||||
enable_partial_tp: bool = True,
|
||||
base_risk: float = 0.01):
|
||||
base_risk: float = 0.02):
|
||||
"""
|
||||
Args:
|
||||
enable_adaptive_sizing: Adaptive Position Sizing aktivieren
|
||||
@@ -550,7 +550,7 @@ print("✅ Advanced Position Management activated!")
|
||||
# Cell: In execute_trade_v2_adaptive()
|
||||
|
||||
# BEFORE (old):
|
||||
volume = 0.01 # Fixed
|
||||
volume = 0.10 # Fixed
|
||||
|
||||
# AFTER (with Adaptive Sizing):
|
||||
if adv_position_mgr.adaptive_sizing:
|
||||
@@ -561,7 +561,7 @@ if adv_position_mgr.adaptive_sizing:
|
||||
symbol=symbol
|
||||
)
|
||||
else:
|
||||
volume = 0.01
|
||||
volume = 0.10
|
||||
|
||||
|
||||
# Cell: Add to Scheduler (for Trailing Stop + Partial TP)
|
||||
|
||||
@@ -40,6 +40,11 @@ SESSION_WHITELIST_CONFIG = {
|
||||
'max_risk_per_trade': 0.02, # Max Risk pro Trade (2%) - Erhöht am 20.12.2025 für Adaptive Sizing
|
||||
'min_atr': 0.0008, # Minimum ATR für Risk Filter
|
||||
|
||||
# Lot Sizing (14.01.2026)
|
||||
'min_lot': 0.10, # Minimum Lot Size
|
||||
'max_lot': 0.20, # Maximum Lot Size
|
||||
'default_lot': 0.10, # Default/Fallback Lot Size
|
||||
|
||||
# Trading Optionen
|
||||
'risk_filter': True, # ATR-basierter Risk Filter
|
||||
'use_pullback_entry': False, # Pullback Entry Strategie
|
||||
|
||||
@@ -2698,5 +2698,32 @@
|
||||
},
|
||||
"position_control_active": true,
|
||||
"order_result": "OrderSendResult(retcode=10009, deal=608743724, order=668660737, volume=0.01, price=4636.11, bid=0.0, ask=0.0, comment='Request executed', request_id=1587946349, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='XAUUSD', volume=0.01, price=4636.11, stoplimit=0.0, sl=4631.522798769643, tp=4647.053003075894, deviation=20, type=0, type_filling=1, type_time=0, expiration=0, comment='TradingBot_V1.6', position=0, position_by=0))"
|
||||
},
|
||||
{
|
||||
"timestamp": "2026-01-14T13:36:45.332111",
|
||||
"version": "V1.6_Adaptive_Complete",
|
||||
"symbol": "XAUUSD",
|
||||
"entry_signal": 1,
|
||||
"confidence": 100.0,
|
||||
"adaptive_threshold": 70,
|
||||
"signal_quality": "excellent",
|
||||
"market_regime": "ranging",
|
||||
"regime_strength": 0.9313780689158762,
|
||||
"risk_adjusted_strength": 213781.9730686972,
|
||||
"adaptive_interval": 15,
|
||||
"session": "london",
|
||||
"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=608970963, order=668899888, volume=0.01, price=4635.22, bid=0.0, ask=0.0, comment='Request executed', request_id=1587946350, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='XAUUSD', volume=0.01, price=4635.39, stoplimit=0.0, sl=4630.437135255516, tp=4647.107161861209, 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