Automated Rebalancing Strategy Generator

Automated Rebalancing Strategy Generator

Estimated Annual Return: ${(avgReturn * 100).toFixed(2)}%

`; const ctx = document.getElementById("chart").getContext("2d"); if (window.portfolioChart) window.portfolioChart.destroy(); window.portfolioChart = new Chart(ctx, { type: "doughnut", data: { labels: Object.keys(weights), datasets: [{ data: Object.values(weights), backgroundColor: ['#4caf50','#2196f3','#ff9800','#9c27b0','#f44336'] }] }, options: { responsive: true } }); } async function downloadPDF() { const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.text("Strategy Report", 20, 20); const txt = document.getElementById("result").innerText; doc.text(doc.splitTextToSize(txt, 180), 20, 40); doc.save("strategy.pdf"); } function printStrategy() { const w = window.open("", "", "width=800,height=600"); w.document.write("Print Strategy"); w.document.write(document.getElementById("result").innerHTML); w.document.write(""); w.document.close(); w.print(); }
Scroll to Top