From dceec2cea9f3deee24722efa45b37624f1d38afd Mon Sep 17 00:00:00 2001 From: Marc Blatter Date: Sat, 4 Jul 2026 14:01:31 +0200 Subject: [PATCH] Bot auto-update: src/__pycache__/main_ml.cpython-310.pyc,src/main_ml.py --- src/__pycache__/main_ml.cpython-310.pyc | Bin 28097 -> 28097 bytes src/main_ml.py | 4 ++++ 2 files changed, 4 insertions(+) diff --git a/src/__pycache__/main_ml.cpython-310.pyc b/src/__pycache__/main_ml.cpython-310.pyc index 320cf5a867283317b0cd26867ffad83d7fe9644d..03369a82d4571a227d536901438e24e0e304e8fc 100644 GIT binary patch delta 205 zcmX?joAKanM!tMrUM>b85cuYirE_p2-wqu~CIKLnV3c4~Vifq!$7R9D(ZKYd=b?b& z=KDGu*cg*HPcUA=&A5BArTuJ1=E+y>Lz#~VIBeE+h+t;)+}!3|&BK^KnJM6~J`)fy zaxpRiAr~XhFDVW_CN@S1W(gJ{W{$rCtO7t$pbh_lrvKyFBjCCDO8^r)Bm3s>;fGil z!#3}Vxz5Shym?YuGb67qM+8GX2S0}zkd)l4l<|U@@%Lu#ob`b8nETNqOXR>tz8yM}i~>voOcIO|j7p3GKlnH;7&#i4{_{K% zP}qE5X9F8!(&h=qE4UeVO}4b3&B!$Qs(mQ)Q33nSx(*S{jP9G;oU3^lb0;$e9M)%K zVq#+CVq^kBE=HbTQXG6tY>X1j63jx(9DfB^1%RSJ8~y`L|HrdWzlxX#Ig|t#S^fh6 DT<14H diff --git a/src/main_ml.py b/src/main_ml.py index 4db7a0d..79752c6 100644 --- a/src/main_ml.py +++ b/src/main_ml.py @@ -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)