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:01:31 +02:00
parent 5127e9f5b5
commit dceec2cea9
2 changed files with 4 additions and 0 deletions

View File

@ -338,6 +338,7 @@ class MLTradingBot:
)
if result and result.get('status') in ['FILLED', 'NEW', 'PARTIALLY_FILLED']:
# Ensure current_trades reflects completed trade
logger.info(f'✅ BTC LIQUIDATED! Order ID: {result.get("orderId")}, Status: {result.get("status")}')
# Wait for balance to update
await asyncio.sleep(3)
@ -532,6 +533,7 @@ class MLTradingBot:
)
if result and result.get('status') in ['FILLED', 'NEW', 'PARTIALLY_FILLED']:
# Ensure current_trades reflects completed trade
# ONLY record if order was actually EXECUTED
profit_usd = (current_qty * current_price) - (buy_qty * buy_price)
self.daily_pnl += profit_usd
@ -736,6 +738,7 @@ class MLTradingBot:
# ONLY RECORD if order was SUCCESSFUL
if result and result.get('status') in ['FILLED', 'NEW', 'PARTIALLY_FILLED']:
# Ensure current_trades reflects completed trade
logger.info(f'🔍 DEBUG: Storing BUY position {pair}: qty={qty}, price={price}')
self.open_positions[pair] = {
'qty': qty,
@ -752,6 +755,7 @@ class MLTradingBot:
# BUY Alert disabled — user only wants profit notifications
logger.info(f'✅ BUY FILLED & RECORDED! Order ID: {result.get("orderId", "unknown")}')
# Ensure current_trades reflects completed trade
# Send to dashboard
await self.dashboard.record_buy(pair, qty, price)