diff --git a/static/script.js b/static/script.js index 97c6f1f..7fa3977 100644 --- a/static/script.js +++ b/static/script.js @@ -436,6 +436,13 @@ function loadPortfolio() { pnlEl.textContent = `P&L: ${pnl >= 0 ? '+' : ''}$${pnl.toLocaleString('pt-BR',{minimumFractionDigits:2})} (${pnlPct >= 0 ? '+' : ''}${pnlPct.toFixed(1)}%)`; pnlEl.style.color = pnl >= 0 ? '#69f0ae' : '#ff6b6b'; document.getElementById('pfTrades').textContent = `${trades} trades | ${wins}W/${losses}L | WR: ${wr}%`; + + const total = data.total_value || init; + const daysRunning = data.chart_data ? data.chart_data.length : 0; + const pfTotalEl = document.getElementById('pfTotal'); + if (pfTotalEl) pfTotalEl.textContent = `Patrimônio: $${total.toLocaleString('pt-BR', {minimumFractionDigits:2})}`; + const pfDaysEl = document.getElementById('pfDays'); + if (pfDaysEl) pfDaysEl.textContent = `Dias Rodando: ${daysRunning}`; // Draw chart drawChart(data.chart_data || [], init, bal); diff --git a/templates/index.html b/templates/index.html index 74b6746..cb4367e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -184,9 +184,11 @@

💹 Portfolio Simulado

- $10.000,00 + $10.000,00 P&L: $0,00 (0%) 0 trades | 0% Win Rate + Patrimônio: $10.000,00 + Dias: 0