From dab3a9d394916d1b397d16f98316af867a466215 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Tue, 15 Sep 2026 20:31:14 +0700 Subject: [PATCH] fix: saran portfolio utamakan konsentrasi sektor (financials 65%) --- web/src/pages/Portfolio.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/pages/Portfolio.tsx b/web/src/pages/Portfolio.tsx index 699d62d..6037bf4 100644 --- a/web/src/pages/Portfolio.tsx +++ b/web/src/pages/Portfolio.tsx @@ -22,10 +22,13 @@ export default function Portfolio() { const saran = () => { const c = conc(); if (!c.length) return ""; + // Sektor dulu (risiko sistemik) baru bobot single-ticker. + const perSek: Record = {}; + for (const x of c) perSek[x.sector] = (perSek[x.sector] || 0) + x.weight; + const [sekTop, wSek] = Object.entries(perSek).sort((a, b) => b[1] - a[1])[0]; + if (wSek > 0.4) return `Sektor ${sekTop} porsinya ${(wSek * 100).toFixed(0)}% — kalau sektor itu jatuh, semua ikut. Coba lirik sektor lain.`; const top = c[0]; if (top.weight > 0.4) return `${top.ticker} porsinya ${(top.weight * 100).toFixed(0)}% — kebanyakan telur di satu keranjang. Pertimbangkan tambah saham beda sektor.`; - const sek = [...new Set(c.map((x) => x.sector))]; - if (sek.length <= 2) return `Cuma ${sek.length} sektor (${sek.join(", ")}) — kalau sektor itu jatuh, semua ikut. Coba lirik sektor lain.`; return "Sebarannya sudah lumayan — tidak numpuk di satu tempat. Pertahankan. 👍"; }; const chartData = () => ({