Gestão Lucrativa
Sistema Profissional de Gestão Financeira
Inicializando sistema...
0%
Crie sua conta gratuita
Configure suas credenciais de acesso
Desenvolvido para traders profissionais
Planejamento do Dia
Configure suas operações
Obrigatório
Recomendado
Percentual por Entrada
0.00%
Execução do Dia
Registre seus resultados
Simulador de Ganhos Futuros
Calcule seu crescimento com juros compostos
📊 Configuração do Dia
Capital (USD)
${formatUSD(capital)}
Capital (BRL)
${formatBRL(capital * dollarRate)}
% por Entrada
${pctEntry.toFixed(2)}%
Valor/Entrada
${formatUSD(valUSD)}
📈 Execuções do Dia
Total de Losses
${losses}
${entriesHtml}
💰 Resultado Final
Resultado do Dia
${resultPct >= 0 ? '+' : ''}${resultPct.toFixed(2)}%
${resultUSD >= 0 ? '+' : ''}${formatUSD(resultUSD)} (${resultBRL >= 0 ? '+' : ''}${formatBRL(resultBRL)})
`;
const blob = new Blob([htmlContent], { type: 'text/html' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `relatorio-gestao-lucrativa-${today.toISOString().split('T')[0]}.html`;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);
alert("Relatório baixado! Abra o arquivo no navegador e use Ctrl+P para salvar como PDF.");
}
// ========== SIMULATOR ==========
function clearSimulator() {
document.getElementById("simInitialValue").value = "";
document.getElementById("simPeriod").value = "";
document.getElementById("simResults").classList.add("hidden");
document.getElementById("simDownloadSection").classList.add("hidden");
window.lastSimData = null;
document.querySelectorAll(".sim-rate-btn").forEach(b => {
b.style.background = "#f5f5f5";
b.style.borderColor = "#e5e5e5";
b.style.color = "#666";
b.style.boxShadow = "none";
});
const tenBtn = document.querySelector('.sim-rate-btn[data-rate="10"]');
tenBtn.style.background = "linear-gradient(135deg,#daa520,#b8860b)";
tenBtn.style.borderColor = "#daa520";
tenBtn.style.color = "#fff";
tenBtn.style.boxShadow = "0 4px 12px rgba(218,165,32,0.3)";
simRate = "10";
document.querySelectorAll(".period-btn").forEach(b => {
b.style.background = "#f5f5f5";
b.style.borderColor = "#e5e5e5";
b.style.color = "#666";
b.style.boxShadow = "none";
});
const mesesBtn = document.querySelector('.period-btn[data-period="meses"]');
mesesBtn.style.background = "linear-gradient(135deg,#daa520,#b8860b)";
mesesBtn.style.borderColor = "#daa520";
mesesBtn.style.color = "#fff";
mesesBtn.style.boxShadow = "0 4px 12px rgba(218,165,32,0.3)";
simPeriodType = "meses";
document.getElementById("periodLabel").textContent = "MESES";
}
function calculateSimulator() {
const principal = parseFloat(document.getElementById("simInitialValue").value) || 0;
const rate = parseFloat(simRate) / 100;
const periods = parseInt(document.getElementById("simPeriod").value) || 0;
if (principal <= 0 || periods <= 0) {
alert("Preencha o valor inicial em USD e o período");
return;
}
let accumulated = principal;
let totalInterest = 0;
const tableData = [];
tableData.push({ period: 0, interest: 0, totalInvested: principal, totalInterest: 0, accumulated: principal });
for (let i = 1; i <= periods; i++) {
const interestAmount = accumulated * rate;
totalInterest += interestAmount;
accumulated += interestAmount;
tableData.push({
period: i,
interest: interestAmount,
totalInvested: principal,
totalInterest: totalInterest,
accumulated: accumulated
});
}
document.getElementById("simTotalInterest").textContent = formatBRL(totalInterest);
document.getElementById("simTotalInvested").textContent = formatBRL(principal);
document.getElementById("simFinalValue").textContent = formatBRL(accumulated);
document.getElementById("periodColHeader").textContent = simPeriodType === "dias" ? "Dias" : "Meses";
let tableHtml = "";
tableData.forEach((row, idx) => {
const bgStyle = idx % 2 === 0 ? "" : "background:#fafafa";
tableHtml += `
| ${row.period} |
${formatBRL(row.interest)} |
${formatBRL(row.totalInvested)} |
${formatBRL(row.totalInterest)} |
${formatBRL(row.accumulated)} |
`;
});
document.getElementById("simTableBody").innerHTML = tableHtml;
document.getElementById("simResults").classList.remove("hidden");
document.getElementById("simDownloadSection").classList.remove("hidden");
// Store data for download
window.lastSimData = { principal, rate: simRate, periods, tableData, totalInterest, accumulated, periodType: simPeriodType };
}
function downloadSimulator() {
if (!window.lastSimData) {
alert("Calcule a simulação primeiro");
return;
}
const { principal, rate, periods, tableData, totalInterest, accumulated, periodType } = window.lastSimData;
const today = new Date();
const dateStr = today.toLocaleDateString('pt-BR');
const timeStr = today.toLocaleTimeString('pt-BR', { hour: '2-digit', minute: '2-digit' });
const periodLabel = periodType === "dias" ? "Dias" : "Meses";
const tableRowsHtml = tableData.map((row, idx) => `
| ${row.period} |
${formatBRL(row.interest)} |
${formatBRL(row.totalInvested)} |
${formatBRL(row.totalInterest)} |
${formatBRL(row.accumulated)} |
`).join('');
const htmlContent = `
Simulação - Gestão Lucrativa
⚙️ Parâmetros da Simulação
Valor Inicial (USD)
$${principal.toFixed(2)}
Taxa de Rendimento
${rate}%
Período
${periods} ${periodLabel}
Total de Juros
${formatBRL(totalInterest)}
Total Investido
${formatBRL(principal * dollarRate)}
Valor Final
${formatBRL(accumulated)}
📊 Tabela de Crescimento
| ${periodLabel} |
Juros |
Total Investido |
Total Juros |
Total Acumulado |
${tableRowsHtml}
`;
const blob = new Blob([htmlContent], { type: 'text/html' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `simulacao-gestao-lucrativa-${today.toISOString().split('T')[0]}.html`;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);
alert("Simulação baixada! Abra o arquivo no navegador e use Ctrl+P para salvar como PDF.");
}
document.getElementById("simDownloadBtn").addEventListener("click", downloadSimulator);