From e39c5586d767724af347387361ab5144955b8d08 Mon Sep 17 00:00:00 2001 From: Hermes Date: Fri, 22 May 2026 10:39:02 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20add=20patrim=C3=B4nio=20and=20dias=20ro?= =?UTF-8?q?dando=20to=20portfolio=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/script.js | 7 +++++++ templates/index.html | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) 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