feat: add patrimônio and dias rodando to portfolio header

This commit is contained in:
Hermes
2026-05-22 10:39:02 +00:00
parent 3a7b371838
commit e39c5586d7
2 changed files with 10 additions and 1 deletions
+7
View File
@@ -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);