Bot auto-update: src/__pycache__/main_ml.cpython-310.pyc,src/main_ml.py

This commit is contained in:
Marc Blatter 2026-07-04 14:40:00 +02:00
parent b3a681861b
commit daab8bc7d4
2 changed files with 1 additions and 18 deletions

View File

@ -917,25 +917,8 @@ class MLTradingBot:
"""Main bot loop"""
logger.info('🤖 BOT STARTED (V5 - SUSTAINABLE)')
# DISABLED: Recovery code was causing infinite loop
# Auto-recover open positions from Binance on restart
logger.info('📥 Recovering trades from Binance...')
try:
for pair in ['BTCUSDT', 'ETHUSDT', 'SOLUSDT', 'BNBUSDT', 'XRPUSDT']:
orders = self.binance._client.get_open_orders(symbol=pair)
if orders:
o = orders[0]
self.current_trades[pair] = {
'qty': float(o['origQty']),
'buy_price': float(o['price']),
'buy_time': ''.join([str(i) for i in range(10)]),
'order_id': o['orderId'],
'peak_profit': 0.0
}
logger.info(f' ✅ Recovered {pair}: {o[origQty]} @ {o[price]}')
except Exception as e:
logger.debug(f'Recovery scan: {e}')
logger.info(f'✅ Recovered {len(self.current_trades)} trades from Binance')
# STARTUP: Load open orders from Binance so Bot knows its positions
logger.info('📥 Loading open positions from Binance...')