fix: spread dict access and close_position retry logic
- Fix 'dict' has no attribute 'spread' by using .get("spread", 0)
- Add 3-retry loop to close_position() with fresh price each attempt
- Match retry pattern from send_order() for consistency
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
0d25548ed5
commit
6e0db5274b
+1
-1
@@ -1220,7 +1220,7 @@ class TradingBot:
|
||||
regime=regime,
|
||||
volatility=volatility,
|
||||
session=session_status.get("session", "unknown"),
|
||||
spread=self.mt5.get_symbol_info(self.config.symbol).spread if hasattr(self.mt5, 'get_symbol_info') else 0,
|
||||
spread=self.mt5.get_symbol_info(self.config.symbol).get("spread", 0) if hasattr(self.mt5, 'get_symbol_info') else 0,
|
||||
atr=0, # ATR calculated in main loop, not available here
|
||||
smc_signal=signal.signal_type,
|
||||
smc_confidence=signal.confidence,
|
||||
|
||||
Reference in New Issue
Block a user