diff --git a/src/__pycache__/main_ml.cpython-310.pyc b/src/__pycache__/main_ml.cpython-310.pyc index 6e81872..4caf38c 100644 Binary files a/src/__pycache__/main_ml.cpython-310.pyc and b/src/__pycache__/main_ml.cpython-310.pyc differ diff --git a/src/main_ml.py b/src/main_ml.py index eda7014..d1b8e3d 100644 --- a/src/main_ml.py +++ b/src/main_ml.py @@ -110,7 +110,6 @@ class MLTradingBot: # Symbol constraints cache self.symbol_info = {} - self.pairs = ['BTCUSDT', 'ETHUSDT', 'SOLUSDT', 'BNBUSDT', 'XRPUSDT'] # Track open positions self.current_trades = {} # CLEAN START - reset on bot restart @@ -921,37 +920,6 @@ class MLTradingBot: # Auto-recover open positions from Binance on restart # STARTUP: Load open orders from Binance so Bot knows its positions - logger.info('📥 Loading open positions from Binance...') - try: - account = await self.binance.get_balance() - for pair in ['BTCUSDT', 'ETHUSDT', 'SOLUSDT', 'BNBUSDT', 'XRPUSDT']: - try: - orders = await self.binance.get_open_orders(pair) - if orders: - order = orders[0] - self.current_trades[pair] = { - 'qty': float(order['origQty']), - 'buy_price': float(order['price']), - 'buy_time': datetime.fromtimestamp(order['time']/1000).isoformat(), - 'order_id': order['orderId'], - 'peak_profit': 0.0 - } - logger.info(f' ✅ Loaded {pair}: {order[origQty]} @ ') - except: - pass - except Exception as e: - logger.warning(f'Could not load Binance positions: {e}') - - logger.info(f'✅ Startup complete: {len(self.current_trades)} positions loaded from Binance') - - # Create trigger file location - trigger_file = '/tmp/bot_liquidate_trigger' - - # FIRST: Cancel all pending orders to free capital - await self.cancel_all_open_orders() - - # SECOND: Load exchange info BEFORE liquidation - await self.load_exchange_info() # THIRD: ONE-TIME LIQUIDATE BTC TO USDT IF NEEDED await self.liquidate_btc_to_usdt_on_startup()