Bot auto-update: src/web_dashboard.py
This commit is contained in:
parent
e7c8f425a2
commit
17b94a904e
|
|
@ -84,7 +84,12 @@ 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)
|
||||
# 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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue