fix sim and wip fix live

This commit is contained in:
Dobromir Popov
2025-07-08 02:47:10 +03:00
parent 64678bd8d3
commit 6c91bf0b93
5 changed files with 220 additions and 106 deletions

View File

@ -114,12 +114,17 @@ class TradingExecutor:
# Thread safety
self.lock = Lock()
# Connect to exchange
# Connect to exchange - skip connection check in simulation mode
if self.trading_enabled:
logger.info("TRADING EXECUTOR: Attempting to connect to exchange...")
if not self._connect_exchange():
logger.error("TRADING EXECUTOR: Failed initial exchange connection. Trading will be disabled.")
self.trading_enabled = False
if self.simulation_mode:
logger.info("TRADING EXECUTOR: Simulation mode - skipping exchange connection check")
# In simulation mode, we don't need a real exchange connection
# Trading should remain enabled for simulation trades
else:
logger.info("TRADING EXECUTOR: Attempting to connect to exchange...")
if not self._connect_exchange():
logger.error("TRADING EXECUTOR: Failed initial exchange connection. Trading will be disabled.")
self.trading_enabled = False
else:
logger.info("TRADING EXECUTOR: Trading is explicitly disabled in config.")