Bot auto-update: src/__pycache__/main_ml.cpython-310.pyc,src/main_ml.py
This commit is contained in:
parent
5127e9f5b5
commit
dceec2cea9
Binary file not shown.
|
|
@ -338,6 +338,7 @@ class MLTradingBot:
|
||||||
)
|
)
|
||||||
|
|
||||||
if result and result.get('status') in ['FILLED', 'NEW', 'PARTIALLY_FILLED']:
|
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")}')
|
logger.info(f'✅ BTC LIQUIDATED! Order ID: {result.get("orderId")}, Status: {result.get("status")}')
|
||||||
# Wait for balance to update
|
# Wait for balance to update
|
||||||
await asyncio.sleep(3)
|
await asyncio.sleep(3)
|
||||||
|
|
@ -532,6 +533,7 @@ class MLTradingBot:
|
||||||
)
|
)
|
||||||
|
|
||||||
if result and result.get('status') in ['FILLED', 'NEW', 'PARTIALLY_FILLED']:
|
if result and result.get('status') in ['FILLED', 'NEW', 'PARTIALLY_FILLED']:
|
||||||
|
# Ensure current_trades reflects completed trade
|
||||||
# ONLY record if order was actually EXECUTED
|
# ONLY record if order was actually EXECUTED
|
||||||
profit_usd = (current_qty * current_price) - (buy_qty * buy_price)
|
profit_usd = (current_qty * current_price) - (buy_qty * buy_price)
|
||||||
self.daily_pnl += profit_usd
|
self.daily_pnl += profit_usd
|
||||||
|
|
@ -736,6 +738,7 @@ class MLTradingBot:
|
||||||
|
|
||||||
# ONLY RECORD if order was SUCCESSFUL
|
# ONLY RECORD if order was SUCCESSFUL
|
||||||
if result and result.get('status') in ['FILLED', 'NEW', 'PARTIALLY_FILLED']:
|
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}')
|
logger.info(f'🔍 DEBUG: Storing BUY position {pair}: qty={qty}, price={price}')
|
||||||
self.open_positions[pair] = {
|
self.open_positions[pair] = {
|
||||||
'qty': qty,
|
'qty': qty,
|
||||||
|
|
@ -752,6 +755,7 @@ class MLTradingBot:
|
||||||
|
|
||||||
# BUY Alert disabled — user only wants profit notifications
|
# BUY Alert disabled — user only wants profit notifications
|
||||||
logger.info(f'✅ BUY FILLED & RECORDED! Order ID: {result.get("orderId", "unknown")}')
|
logger.info(f'✅ BUY FILLED & RECORDED! Order ID: {result.get("orderId", "unknown")}')
|
||||||
|
# Ensure current_trades reflects completed trade
|
||||||
|
|
||||||
# Send to dashboard
|
# Send to dashboard
|
||||||
await self.dashboard.record_buy(pair, qty, price)
|
await self.dashboard.record_buy(pair, qty, price)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue