fix sim and wip fix live
This commit is contained in:
@ -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.")
|
||||
|
||||
|
Reference in New Issue
Block a user