From 17b94a904e69faee9f0e3ce6a8297f757fbb0274 Mon Sep 17 00:00:00 2001 From: Marc Blatter Date: Thu, 9 Jul 2026 19:55:01 +0200 Subject: [PATCH] Bot auto-update: src/web_dashboard.py --- src/web_dashboard.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/web_dashboard.py b/src/web_dashboard.py index b551923..7983678 100644 --- a/src/web_dashboard.py +++ b/src/web_dashboard.py @@ -84,11 +84,16 @@ async def get_state(): pnl_status = "🟢 PROFIT" if pnl_usdt > 0.01 else ("🔴 LOSS" if pnl_usdt < -0.01 else "⚪ BREAK") pnl_color = "accent" if pnl_usdt > 0.01 else ("negative" if pnl_usdt < -0.01 else "neutral") - # Count active positions = locked coins (NOT trades.json) - active_positions = 0 - for asset in ['BTC', 'ETH', 'SOL', 'BNB', 'XRP']: - if asset in balance and balance[asset]['locked'] > 0.00001: - active_positions += 1 + # Count active positions = open orders from Binance API + try: + open_orders = binance.get_open_orders() + active_positions = len(open_orders) + except: + # Fallback to locked coins if API fails + active_positions = 0 + for asset in ['BTC', 'ETH', 'SOL', 'BNB', 'XRP']: + if asset in balance and balance[asset]['locked'] > 0.00001: + active_positions += 1 trades = load_bot_state()