Bot auto-update: src/__pycache__/main_ml.cpython-310.pyc,src/main_ml.py
This commit is contained in:
parent
b3a681861b
commit
daab8bc7d4
Binary file not shown.
|
|
@ -917,25 +917,8 @@ class MLTradingBot:
|
||||||
"""Main bot loop"""
|
"""Main bot loop"""
|
||||||
logger.info('🤖 BOT STARTED (V5 - SUSTAINABLE)')
|
logger.info('🤖 BOT STARTED (V5 - SUSTAINABLE)')
|
||||||
|
|
||||||
|
# DISABLED: Recovery code was causing infinite loop
|
||||||
# Auto-recover open positions from Binance on restart
|
# 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
|
# STARTUP: Load open orders from Binance so Bot knows its positions
|
||||||
logger.info('📥 Loading open positions from Binance...')
|
logger.info('📥 Loading open positions from Binance...')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue