Bot auto-update: src/__pycache__/web_dashboard.cpython-310.pyc,src/web_dashboard.py
This commit is contained in:
parent
2fbc43ae97
commit
2695c6721f
Binary file not shown.
|
|
@ -32,7 +32,7 @@ trading_state = {
|
|||
'wins_today': 0,
|
||||
'losses_today': 0,
|
||||
'portfolio_value_usd': 0.0,
|
||||
'portfolio_value_chf': 0.0,
|
||||
'portfolio_value_': 0.0,
|
||||
'last_update': datetime.now().isoformat()
|
||||
}
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ async def clear_state():
|
|||
'wins_today': 0,
|
||||
'losses_today': 0,
|
||||
'portfolio_value_usd': 0.0,
|
||||
'portfolio_value_chf': 0.0,
|
||||
'portfolio_value_': 0.0,
|
||||
'last_update': datetime.now().isoformat()
|
||||
}
|
||||
await broadcast_update()
|
||||
|
|
@ -518,26 +518,22 @@ html_content = """
|
|||
}
|
||||
|
||||
function updateDashboard(data) {
|
||||
// Update key metrics - CHF PRIMARY, USD secondary
|
||||
// Update key metrics - PRIMARY, USD secondary
|
||||
const usdt = data.balance.USDT || 0;
|
||||
const usdt_chf = usdt * 0.84;
|
||||
document.getElementById('usdt').textContent = `$${usdt.toFixed(2)} / CHF ${usdt_chf.toFixed(2)}`;
|
||||
|
||||
|
||||
const portfolio_usd = data.portfolio_value_usd || 0;
|
||||
const portfolio_chf = data.portfolio_value_chf || (portfolio_usd * 0.84);
|
||||
document.getElementById('portfolio').textContent = `$${portfolio_usd.toFixed(2)} / CHF ${portfolio_chf.toFixed(2)}`;
|
||||
|
||||
// Update P&L with color - CHF primary
|
||||
|
||||
// Update P&L with color - primary
|
||||
const dailyPnl = data.daily_pnl || 0;
|
||||
const dailyPnl_chf = dailyPnl * 0.84;
|
||||
|
||||
const dailyPnlEl = document.getElementById('daily-pnl');
|
||||
dailyPnlEl.textContent = `$${dailyPnl >= 0 ? '+' : ''}${dailyPnl.toFixed(2)} / CHF ${dailyPnl_chf >= 0 ? '+' : ''}${dailyPnl_chf.toFixed(2)}`;
|
||||
dailyPnlEl.className = 'card-value ' + (dailyPnl >= 0 ? 'positive' : 'negative');
|
||||
|
||||
const totalPnl = data.total_pnl || 0;
|
||||
const totalPnl_chf = totalPnl * 0.84;
|
||||
|
||||
const totalPnlEl = document.getElementById('total-pnl');
|
||||
totalPnlEl.textContent = `$${totalPnl >= 0 ? '+' : ''}${totalPnl.toFixed(2)} / CHF ${totalPnl_chf >= 0 ? '+' : ''}${totalPnl_chf.toFixed(2)}`;
|
||||
totalPnlEl.className = 'card-value ' + (totalPnl >= 0 ? 'positive' : 'negative');
|
||||
|
||||
// Update performance
|
||||
|
|
|
|||
Loading…
Reference in New Issue