1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
631 lines of Pine Script v6 from src/modules/01-base.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.
01-base.pine
//@version=6
// ═══════════════════════════════════════════════════════════════════
//
// SAHAM: PAPAN INSTRUMEN BY. AKHMFZ
// Versi 0.3.0-beta — Build 010 (Phase A+B)
//
// CHANGELOG BUILD 006 (ringkas)
// ✓ FITUR BARU: FAKTOR INDONESIA — dimensi ke-7 dalam skor keseluruhan.
// Menangkap karakteristik unik IDX: Likuiditas (volume/cap), Stabilitas
// (beta/volatility), dan Dukungan Makro (IDR/komoditas). Opt-in via
// toggle "Aktifkan Faktor Indonesia" — default OFF untuk backward
// compatibility. Bobot efektif 10-18% tergantung sektor.
// ✓ Data baru: FX_IDC:USDIDR (exchange rate), ta.beta() vs IDX Composite,
// IDX sector indices sebagai commodity proxy (fallback).
// ✓ UI: tampilIndonesia toggle, bobotIndonesia input kustom.
// ✓ Performance: 0 tambahan request.financial(), 1 tambahan
// request.security("FX_IDC:USDIDR").
//
// CHANGELOG BUILD 007 (ringkas)
// ✓ Render rows di-hide berdasarkan weight scoring (bukan hardcode sektor)
// — Quality: margin hanya tampil jika wGross/wOp/wNet/wEbitda/wFcfM > 0.
// — Health: leverage/liquidity hanya tampil jika wHDe/wHCR/wHAltman > 0.
// ✓ Interest Cover threshold: 2-20 → 5-50 (kurangi skor 100 untuk bank).
// ✓ Dividend Yield threshold: 0-5 → 3-8 (patokan BI Rate ~6%).
// ✓ Hapus 3 field jarang terisi IDX: Forward P/E, Buyback Yield/Ratio
// (hemat 3 request → total ~37 calls, safety margin terpenuhi).
// ✓ Fix multi-variable float declarations (split 7→16 baris).
// ✓ f_scoreLowerSafe: guard untuk rasio negatif (P/E, P/B, EV/EBITDA, dll).
// ✓ debtAssetScore threshold: 80% skala persen → 0.8 desimal.
// ✓ n/x denominators disinkronkan dengan ukuran array sungguhan.
// ✓ Income: f_avg5 (dengan na) → f_avg4 (4 komponen eksplisit).
//
// CHANGELOG BUILD 001 (ringkas — detail lengkap di changelog.md)
// ✓ Guard ekuitas negatif, hapus normalisasi magnitude, f_avg6,
// indikator kelengkapan data, toleransi siklikal Graham, modul
// Risiko Likuiditas & Gorengan.
//
// TIDAK DIUBAH DARI V2 (lihat architecture.md § Batasan Diketahui)
// ✗ Kalibrasi ambang momentum/RSI/volatilitas masih gaya pasar AS
// ✗ Belum ada normalisasi EPS multi-tahun sungguhan (keterbatasan
// teknis request.financial di Pine Script — lihat catatan di kode)
// ✗ Belum ada data broker summary / kepemilikan — modul risiko di
// bawah ini murni proxy statistik harga & volume, BUKAN
// "bandarmology" sungguhan.
//
// PERINGATAN
// Indikator ini adalah alat bantu analisis, BUKAN nasihat keuangan/
// investasi. Skor "Risiko Likuiditas & Gorengan" adalah proxy
// statistik berbasis harga & volume historis, bukan deteksi
// manipulasi pasar yang terverifikasi. Selalu lakukan riset mandiri.
//
// ═══════════════════════════════════════════════════════════════════
indicator(
title = "Saham: Papan Instrumen By. Akhmfz",
shorttitle = "PnInstrum",
overlay = true,
calc_bars_count = 300)
//══════════════════════════════
//
// MODUL 01
// PENGATURAN
//
//══════════════════════════════
grupUtama = "Pengaturan Utama"
simbolInput = input.symbol("", "Simbol Saham", group = grupUtama, display = display.data_window)
sym = simbolInput == "" ? syminfo.tickerid : simbolInput
indeksAcuan = input.symbol("IDX:COMPOSITE", "Indeks Acuan / Benchmark", group = grupUtama, display = display.data_window)
periodeLaporan = input.string("FQ", "Periode Laporan Keuangan", options = ["FQ", "FY", "TTM"], group = grupUtama, display = display.data_window)
posisiInput = input.string("Kanan Atas", "Posisi Tabel",
options = ["Kanan Atas", "Kiri Atas", "Kanan Bawah", "Kiri Bawah"], group = grupUtama, display = display.data_window)
ukuranTeksInput = input.string("Kecil Sekali", "Ukuran Teks",
options = ["Kecil Sekali", "Kecil", "Normal"], group = grupUtama, display = display.data_window)
warnaTema = input.string("Profesional Gelap", "Tema Warna",
options = ["Profesional Gelap", "Profesional Terang", "Bursa Hijau", "Biru Nusantara", "Emas Premium"],
group = grupUtama, display = display.data_window)
tampilLatarSkor = input.bool(true, "Gunakan Latar Skor Berwarna", group = grupUtama, display = display.data_window)
tampilBarSkor = input.bool(true, "Tampilkan Bar Skor", group = grupUtama, display = display.data_window)
barisSelangSeling = input.bool(true, "Baris Berselang-seling Halus", group = grupUtama, display = display.data_window)
headerBerwarna = input.bool(true, "Header Bagian Berwarna", group = grupUtama, display = display.data_window)
tampilSimbolStatus = input.bool(true, "Tampilkan Simbol ▲ ▼", group = grupUtama, display = display.data_window)
tampilKelengkapan = input.bool(true, "Tampilkan Indikator Kelengkapan Data (n/x)", group = grupUtama, display = display.data_window)
tampilCompact = input.bool(false, "Mode Ringkas (Compact Mode)", group = grupUtama,
tooltip = "Tampilkan hanya skor + risiko + ringkasan. Sembunyikan" +
" detail valuasi, kualitas, growth, kesehatan, dividen, " +
"momentum, dan Indonesia di kolom kanan. Default OFF — backward compatible.",
display = display.data_window)
bahasa = input.string("Indonesia", "Bahasa / Language",
options = ["Indonesia", "English"],
group = grupUtama,
tooltip = "Bahasa tampilan dashboard. Label teknis (ROE, P/E, P/B, dll.) " +
"tetap dalam bahasa Inggris karena bersifat universal.",
display = display.data_window)
tampilRingkasan = input.bool(true, "Tampilkan Ringkasan", group = grupUtama, display = display.data_window)
tampilValuasi = input.bool(true, "Tampilkan Valuasi", group = grupUtama, display = display.data_window)
tampilKualitas = input.bool(true, "Tampilkan Kualitas", group = grupUtama, display = display.data_window)
tampilPertumbuhan = input.bool(true, "Tampilkan Pertumbuhan", group = grupUtama, display = display.data_window)
tampilKesehatan = input.bool(true, "Tampilkan Kesehatan Keuangan", group = grupUtama, display = display.data_window)
tampilDividen = input.bool(true, "Tampilkan Dividen & Imbal Hasil", group = grupUtama, display = display.data_window)
tampilMomentum = input.bool(true, "Tampilkan Momentum", group = grupUtama, display = display.data_window)
tampilIndonesia = input.bool(false, "Aktifkan Faktor Indonesia (7th Factor)", group = grupUtama,
tooltip = "Menambahkan Faktor Indonesia sebagai dimensi ke-7 dalam skor " +
"keseluruhan. Mencakup Likuiditas IDX, Stabilitas Pasar (beta/vol), " +
"dan Dukungan Makro (IDR/komoditas). Default OFF — backward compatible.",
display = display.data_window)
// ── Sektor & Adaptasi (BARU di V2) ──
grupSektor = "Sektor & Adaptasi"
modeSektor = input.string("Otomatis", "Deteksi Sektor",
options = ["Otomatis",
"Finansial (Bank/Asuransi)", "Bank", "Asuransi", "Sekuritas",
"Konsumer (Makanan/Minuman)", "Industri (Manufaktur)", "Kesehatan (Farmasi)",
"Batubara", "CPO & Perkebunan",
"Siklikal (Komoditas/Energi)", "Properti", "Infrastruktur",
"Teknologi", "Transportasi", "Non-Finansial Umum"],
group = grupSektor,
tooltip = "Otomatis: mendeteksi dari syminfo.sector/industry + daftar ticker. " +
"Override manual jika auto-detect salah. Kelas BARU Build 009: Konsumer, " +
"Industri, Kesehatan, Batubara, CPO.",
display = display.data_window)
toleransiSiklikal = input.bool(true, "Longgarkan Graham Number untuk Sektor Siklikal", group = grupSektor,
tooltip = "Melebarkan pita skor Graham Number untuk saham komoditas/energi yang labanya naik-turun tajam. " +
"Ini BUKAN normalisasi EPS multi-tahun sungguhan — lihat architecture.md.",
display = display.data_window)
// ── Bobot Skor Keseluruhan (BARU di V2) ──
grupBobot = "Bobot Skor Keseluruhan"
gunakanBobotKustom = input.bool(false, "Gunakan Bobot Kustom (default: 6 faktor sama rata)", group = grupBobot, display = display.data_window)
presetBobot = input.string("Custom", "Preset Bobot",
options = ["Custom", "Equal Weight", "Value-biased", "Quality-biased",
"Growth-biased", "Conservative"],
group = grupBobot,
tooltip = "Preset mengisi bobot otomatis. Pilih 'Custom' untuk mengatur manual.",
display = display.data_window)
// Apply preset (overrides slider defaults)
bobotValue = input.float(1.0, "Bobot Value", minval = 0, step = 0.1, group = grupBobot, display = display.data_window)
bobotQuality = input.float(1.0, "Bobot Quality", minval = 0, step = 0.1, group = grupBobot, display = display.data_window)
bobotGrowth = input.float(1.0, "Bobot Growth", minval = 0, step = 0.1, group = grupBobot, display = display.data_window)
bobotHealth = input.float(1.0, "Bobot Health", minval = 0, step = 0.1, group = grupBobot, display = display.data_window)
bobotMomentum = input.float(1.0, "Bobot Momentum", minval = 0, step = 0.1, group = grupBobot, display = display.data_window)
bobotIncome = input.float(1.0, "Bobot Income", minval = 0, step = 0.1, group = grupBobot, display = display.data_window)
bobotIndonesia = input.float(1.0, "Bobot Indonesia Factor", minval = 0, step = 0.1, group = grupBobot,
tooltip = "Bobot untuk Faktor Indonesia (aktif hanya jika toggle ON). " +
"Default 1.0 = ~14%. Naikkan ke 1.5 = ~20%, turunkan ke 0.7 = ~10%.",
display = display.data_window)
// Preset bobot otomatis (override slider jika bukan Custom)
if presetBobot != "Custom"
if presetBobot == "Equal Weight"
bobotValue := 1.0
bobotQuality := 1.0
bobotGrowth := 1.0
bobotHealth := 1.0
bobotMomentum := 1.0
bobotIncome := 1.0
else if presetBobot == "Value-biased"
bobotValue := 2.0
bobotQuality := 1.0
bobotGrowth := 1.0
bobotHealth := 1.0
bobotMomentum := 0.5
bobotIncome := 0.5
else if presetBobot == "Quality-biased"
bobotValue := 1.0
bobotQuality := 2.0
bobotGrowth := 1.0
bobotHealth := 1.0
bobotMomentum := 0.5
bobotIncome := 0.5
else if presetBobot == "Growth-biased"
bobotValue := 1.0
bobotQuality := 1.0
bobotGrowth := 2.0
bobotHealth := 1.0
bobotMomentum := 0.5
bobotIncome := 0.5
else if presetBobot == "Conservative"
bobotValue := 1.2
bobotQuality := 1.5
bobotGrowth := 0.8
bobotHealth := 1.5
bobotMomentum := 0.5
bobotIncome := 1.0
pakaiBobotTertimbang = gunakanBobotKustom or presetBobot != "Custom"
// ── Risiko Likuiditas & Gorengan (BARU di V2) ──
grupRisiko = "Risiko Likuiditas & Gorengan"
tampilRisikoGorengan = input.bool(true, "Tampilkan Modul Risiko Likuiditas", group = grupRisiko, display = display.data_window)
ambangARA = input.float(24.0, "Ambang Deteksi ARA/ARB (%)", minval = 1, group = grupRisiko,
tooltip = "Persentase perubahan harga harian yang dianggap 'mendekati/kena batas ARA-ARB'. " +
"Aturan ARA/ARB IDX bertingkat menurut harga & pernah berubah — sesuaikan sendiri sesuai " +
"aturan yang berlaku saat ini. Ini adalah proxy, bukan aturan resmi bursa.",
display = display.data_window)
lookbackARA = input.int(20, "Lookback Hari untuk Hitung ARA/ARB", minval = 5, maxval = 60, group = grupRisiko, display = display.data_window)
kapKecilMiliar = input.float(1000, "Ambang Kapitalisasi 'Kecil' (Miliar Rp)", group = grupRisiko, display = display.data_window)
kapBesarMiliar = input.float(10000, "Ambang Kapitalisasi 'Besar' (Miliar Rp)", group = grupRisiko, display = display.data_window)
likuiditasRendahJt = input.float(500, "Ambang Nilai Transaksi Harian 'Rendah' (Juta Rp, avg 20D)", group = grupRisiko, display = display.data_window)
likuiditasTinggiJt = input.float(20000, "Ambang Nilai Transaksi Harian 'Tinggi' (Juta Rp, avg 20D)", group = grupRisiko, display = display.data_window)
hargaRecehan = input.float(50, "Ambang Harga 'Recehan' (Rp)", group = grupRisiko, display = display.data_window)
// ── Kesehatan Bank (P3-1) ──
grupBank = "Kesehatan Bank (Data Manual)"
carInput = input.float(-1.0, "CAR (%) — Rasio Kecukupan Modal", minval = -1.0, step = 0.1, group = grupBank,
tooltip = "Capital Adequacy Ratio. Isi manual — tidak tersedia dari TV. " +
"Data dari laporan keuangan bank. ≥ 12% = sehat. Nilai -1 = abaikan.",
display = display.data_window)
nplInput = input.float(-1.0, "NPL Gross (%) — Non-Performing Loan", minval = -1.0, step = 0.1, group = grupBank,
tooltip = "Non-Performing Loan ratio gross. Isi manual — tidak tersedia dari TV. " +
"Data dari laporan keuangan bank. ≤ 3% = sehat. Nilai -1 = abaikan.",
display = display.data_window)
ldrInput = input.float(-1.0, "LDR (%) — Loan-to-Deposit Ratio", minval = -1.0, step = 0.1, group = grupBank,
tooltip = "Loan to Deposit Ratio. Isi manual — tidak tersedia dari TV. " +
"Data dari laporan keuangan bank. 78-92% range ideal. Nilai -1 = abaikan.",
display = display.data_window)
posisiTabel = switch posisiInput
"Kiri Atas" => position.top_left
"Kanan Bawah" => position.bottom_right
"Kiri Bawah" => position.bottom_left
=> position.top_right
ukuranTeks = switch ukuranTeksInput
"Kecil Sekali" => size.tiny
"Normal" => size.normal
=> size.small
//══════════════════════════════
//
// MODUL 02
// TEMA WARNA
//
//══════════════════════════════
isLightTheme = warnaTema == "Profesional Terang"
isEmerald = warnaTema == "Bursa Hijau"
isRoyal = warnaTema == "Biru Nusantara"
isAmber = warnaTema == "Emas Premium"
isDarkTheme = not isLightTheme
tableBg = isLightTheme ? color.rgb(246, 247, 250) :
isEmerald ? color.rgb(5, 18, 15) :
isRoyal ? color.rgb(7, 12, 28) :
isAmber ? color.rgb(19, 15, 9) :
color.rgb(8, 14, 26)
altBg = isLightTheme ? color.rgb(235, 238, 243) :
isEmerald ? color.rgb(7, 27, 22) :
isRoyal ? color.rgb(10, 20, 45) :
isAmber ? color.rgb(29, 23, 13) :
color.rgb(10, 20, 36)
headerBg = isLightTheme ? color.rgb(215, 220, 228) :
isEmerald ? color.rgb(5, 64, 49) :
isRoyal ? color.rgb(14, 45, 105) :
isAmber ? color.rgb(95, 58, 14) :
color.rgb(15, 40, 78)
sectionBg = isLightTheme ? color.rgb(226, 230, 236) :
isEmerald ? color.rgb(8, 38, 31) :
isRoyal ? color.rgb(11, 28, 60) :
isAmber ? color.rgb(49, 34, 14) :
color.rgb(13, 27, 48)
gridCol = isLightTheme ? color.rgb(178, 184, 195) :
isEmerald ? color.rgb(23, 91, 74) :
isRoyal ? color.rgb(34, 69, 125) :
isAmber ? color.rgb(112, 78, 32) :
color.rgb(31, 59, 98)
mainTxt = isLightTheme ? color.rgb(24, 27, 33) : color.rgb(215, 224, 238)
mutedTxt = isLightTheme ? color.rgb(78, 84, 96) : color.rgb(142, 158, 182)
titleTxt = isLightTheme ? color.rgb(15, 35, 60) :
isEmerald ? color.rgb(95, 255, 197) :
isRoyal ? color.rgb(105, 190, 255) :
isAmber ? color.rgb(255, 197, 85) :
color.rgb(94, 190, 255)
bullTxt = isLightTheme ? color.rgb(24, 145, 91) : color.rgb(73, 220, 165)
bearTxt = isLightTheme ? color.rgb(205, 52, 68) : color.rgb(255, 92, 120)
purpleTxt = isLightTheme ? color.rgb(107, 79, 202) : color.rgb(160, 135, 255)
goldTxt = isLightTheme ? color.rgb(168, 123, 25) : color.rgb(238, 207, 92)
cyanTxt = isLightTheme ? color.rgb(34, 132, 156) : color.rgb(86, 204, 255)
neutralTxt = isLightTheme ? color.rgb(95, 101, 112) : color.rgb(164, 176, 195)
secValueBg = color.rgb(16, 80, 55)
secQualityBg = color.rgb(18, 70, 105)
secGrowthBg = color.rgb(105, 75, 20)
secHealthBg = color.rgb(105, 42, 50)
secMomentumBg = color.rgb(72, 55, 125)
secIncomeBg = color.rgb(95, 68, 18)
secSnapshotBg = color.rgb(55, 65, 82)
secCompositeBg = color.rgb(20, 87, 95)
secRiskBg = color.rgb(110, 30, 20)
secIndonesiaBg = color.rgb(140, 70, 20)
//══════════════════════════════
//
// MODUL 03
// UTILITAS
//
//══════════════════════════════
f_clamp(float x, float lo, float hi) =>
math.max(lo, math.min(x, hi))
f_safeDiv(float a, float b) =>
na(a) or na(b) or b == 0 ? na : a / b
f_scoreHigher(float v, float bad, float good) =>
na(v) ? na : f_clamp((v - bad) / (good - bad) * 100, 0, 100)
f_scoreLower(float v, float good, float bad) =>
na(v) ? na : f_clamp((bad - v) / (bad - good) * 100, 0, 100)
// Build 007 — guard untuk rasio yang penyebutnya bisa negatif
// (P/E, P/B, PEG, EV/EBITDA dll). Jika v <= 0, return 0
// (risiko tinggi), bukan skor 100 karena rumus linear pecah.
f_scoreLowerSafe(float v, float good, float bad) =>
na(v) ? na : v <= 0 ? 0.0 : f_scoreLower(v, good, bad)
f_scoreMid(float v, float loVal, float ideal, float hiVal) =>
na(v) ? na : v <= ideal ? f_clamp((v - loVal) / (ideal - loVal) * 100, 0, 100) : f_clamp((hiVal - v) / (hiVal - ideal) * 100, 0, 100)
f_scorePositive(float v) =>
na(v) ? na : v > 0 ? 100 : 0
// P3-2 — pengganti f_scorePositive untuk OCF/FCF:
// Bukan biner 0/100, graded berdasarkan rasio cash flow vs market cap
// (-2% -> 5%: dari negatif parah ke positif kuat)
f_scoreCashFlow(float cf, float mcapVal) =>
na(cf) or na(mcapVal) or mcapVal == 0 ? na : f_scoreHigher(cf / mcapVal * 100, -2, 5)
f_avg5(float a, float b, float c, float d, float e) =>
float sum = 0.0
int n = 0
if not na(a)
sum += a
n += 1
if not na(b)
sum += b
n += 1
if not na(c)
sum += c
n += 1
if not na(d)
sum += d
n += 1
if not na(e)
sum += e
n += 1
n == 0 ? na : sum / n
f_avg3(float a, float b, float c) =>
f_avg5(a, b, c, na, na)
// BARU V2 (Build 007) — rata-rata 4 komponen (Income)
f_avg4(float a, float b, float c, float d) =>
f_avg5(a, b, c, d, na)
// BARU V2 — pengganti eksplisit untuk kasus 6-faktor yang di V1
// "ditumpangkan" ke dalam f_avg5 (lihat critique bug #4).
f_avg6(float a, float b, float c, float d, float e, float f) =>
float sum = 0.0
int n = 0
if not na(a)
sum += a
n += 1
if not na(b)
sum += b
n += 1
if not na(c)
sum += c
n += 1
if not na(d)
sum += d
n += 1
if not na(e)
sum += e
n += 1
if not na(f)
sum += f
n += 1
n == 0 ? na : sum / n
// BARU V2 — rata-rata berbobot 6 faktor, melewati komponen na dan
// merenormalisasi bobot terhadap komponen yang tersedia saja.
f_wavg6(float a, float b, float c, float d, float e, float f,
float wa, float wb, float wc, float wd, float we, float wf) =>
float sum = 0.0
float wsum = 0.0
if not na(a) and wa > 0
sum += a * wa
wsum += wa
if not na(b) and wb > 0
sum += b * wb
wsum += wb
if not na(c) and wc > 0
sum += c * wc
wsum += wc
if not na(d) and wd > 0
sum += d * wd
wsum += wd
if not na(e) and we > 0
sum += e * we
wsum += we
if not na(f) and wf > 0
sum += f * wf
wsum += wf
wsum == 0 ? na : sum / wsum
// BARU V2 — indikator kelengkapan data (bug #6 di critique).
f_countValid5(float a, float b, float c, float d, float e) =>
int n = 0
if not na(a)
n += 1
if not na(b)
n += 1
if not na(c)
n += 1
if not na(d)
n += 1
if not na(e)
n += 1
n
f_countValid4(float a, float b, float c, float d) =>
f_countValid5(a, b, c, d, na)
f_countValid6(float a, float b, float c, float d, float e, float f) =>
f_countValid5(a, b, c, d, e) + (na(f) ? 0 : 1)
// BARU V2 (Build 006) — rata-rata 7 faktor (untuk Faktor Indonesia)
f_avg7(float a, float b, float c, float d, float e, float f, float g) =>
float sum = 0.0
int n = 0
if not na(a)
sum += a
n += 1
if not na(b)
sum += b
n += 1
if not na(c)
sum += c
n += 1
if not na(d)
sum += d
n += 1
if not na(e)
sum += e
n += 1
if not na(f)
sum += f
n += 1
if not na(g)
sum += g
n += 1
n == 0 ? na : sum / n
f_wavg7(float a, float b, float c, float d, float e, float f, float g,
float wa, float wb, float wc, float wd, float we, float wf, float wg) =>
float sum = 0.0
float wsum = 0.0
if not na(a) and wa > 0
sum += a * wa
wsum += wa
if not na(b) and wb > 0
sum += b * wb
wsum += wb
if not na(c) and wc > 0
sum += c * wc
wsum += wc
if not na(d) and wd > 0
sum += d * wd
wsum += wd
if not na(e) and we > 0
sum += e * we
wsum += we
if not na(f) and wf > 0
sum += f * wf
wsum += wf
if not na(g) and wg > 0
sum += g * wg
wsum += wg
wsum == 0 ? na : sum / wsum
f_countValid7(float a, float b, float c, float d, float e, float f, float g) =>
f_countValid6(a, b, c, d, e, f) + (na(g) ? 0 : 1)
// BARU V2 (Build 002) — rata-rata berbobot generik untuk array skor.
// Dipakai untuk Skor Valuasi supaya bobot tiap rasio bisa disesuaikan
// per model bisnis TANPA menduplikasi f_avgN/f_wavgN baru untuk setiap
// kombinasi sektor (prinsip "Avoid duplicated code" di system prompt
// reviewer). Komponen na atau berbobot 0 dilewati, sisanya dinormalisasi
// ulang terhadap total bobot yang valid.
f_wavgArr(array<float> vals, array<float> wts) =>
float sum = 0.0
float wsum = 0.0
for i = 0 to array.size(vals) - 1
v = array.get(vals, i)
w = array.get(wts, i)
if not na(v) and w > 0
sum += v * w
wsum += w
wsum == 0 ? na : sum / wsum
f_countValidArr(array<float> vals) =>
int n = 0
for i = 0 to array.size(vals) - 1
if not na(array.get(vals, i))
n += 1
n
pi_formatNumber(float v) =>
na(v) ? "—" : str.tostring(v, "#.##")
pi_formatPercent(float v) =>
na(v) ? "—" : str.tostring(v, "#.##") + "%"
pi_formatMoney(float v) =>
na(v) ? "—" :
math.abs(v) >= 1e12 ? str.tostring(v / 1e12, "#.##") + "T" :
math.abs(v) >= 1e9 ? str.tostring(v / 1e9, "#.##") + "M" :
math.abs(v) >= 1e6 ? str.tostring(v / 1e6, "#.##") + "Jt" :
str.tostring(v, "#.##")
pi_grade(float s) =>
isEN = bahasa == "English"
na(s) ? (isEN ? "N/A" : "N/A") :
s >= 85 ? (isEN ? "EXCELLENT" : "SANGAT BAIK") :
s >= 70 ? (isEN ? "GOOD" : "BAIK") :
s >= 55 ? (isEN ? "FAIR" : "CUKUP") :
s >= 40 ? (isEN ? "WEAK" : "LEMAH") :
(isEN ? "HIGH RISK" : "RISIKO TINGGI")
pi_overallBadge(float s) =>
isEN = bahasa == "English"
na(s) ? "N/A " :
s >= 85 ? (isEN ? "EXCELLENT " : "SANGAT BAIK ") :
s >= 70 ? (isEN ? "GOOD " : "BAIK ") :
s >= 55 ? (isEN ? "FAIR " : "CUKUP ") :
s >= 40 ? (isEN ? "WEAK " : "LEMAH ") :
(isEN ? "HIGH RISK " : "RISIKO TINGGI ")
// BARU V2 — grade khusus untuk skor keamanan likuiditas (arah makna
// terbalik dari grade fundamental: skor tinggi = risiko gorengan rendah).
pi_riskGrade(float s) =>
isEN = bahasa == "English"
na(s) ? "N/A" :
s >= 70 ? (isEN ? "LOW RISK" : "RISIKO RENDAH") :
s >= 40 ? (isEN ? "MODERATE RISK" : "RISIKO SEDANG") :
(isEN ? "HIGH RISK — CAUTION" : "RISIKO TINGGI — WASPADA")
pi_arrow(float v) =>
not tampilSimbolStatus or na(v) ? "" : v > 0 ? "▲ " : v < 0 ? "▼ " : "■ "
pi_scoreText(float score) =>
string result = "—"
if not na(score)
if tampilBarSkor
int filled = int(math.round(f_clamp(score, 0, 100) / 100 * 6))
string bar = ""
for i = 0 to 5
bar += i < filled ? "█" : "░"
result := bar + " " + str.tostring(score, "#")
else
result := str.tostring(score, "#")
result
f_rowBg(int row) =>
barisSelangSeling and row % 2 == 0 ? altBg : tableBg
f_scoreColor(float s) =>
na(s) ? neutralTxt :
s >= 80 ? bullTxt :
s >= 60 ? purpleTxt :
s >= 40 ? goldTxt :
bearTxt
// BARU V2 — skema warna terbalik untuk skor risiko (tinggi = aman = hijau)
f_riskColor(float s) =>
na(s) ? neutralTxt :
s >= 70 ? bullTxt :
s >= 40 ? goldTxt :
bearTxt
f_scoreBg(float s) =>
not tampilLatarSkor ? tableBg :
na(s) ? tableBg :
color.new(f_scoreColor(s), isLightTheme ? 86 : 84)
f_riskBg(float s) =>
not tampilLatarSkor ? tableBg :
na(s) ? tableBg :
color.new(f_riskColor(s), isLightTheme ? 86 : 84)
f_sectionBg(string title) =>
not headerBerwarna ? sectionBg :
str.contains(title, "SKOR KESELURUHAN") ? secCompositeBg :
str.contains(title, "RINGKASAN") ? secSnapshotBg :
str.contains(title, "VALUASI") ? secValueBg :
str.contains(title, "KUALITAS") ? secQualityBg :
str.contains(title, "PERTUMBUHAN") ? secGrowthBg :
str.contains(title, "KESEHATAN") ? secHealthBg :
str.contains(title, "MOMENTUM") ? secMomentumBg :
str.contains(title, "DIVIDEN") ? secIncomeBg :
str.contains(title, "RISIKO") ? secRiskBg :
str.contains(title, "INDONESIA") ? secIndonesiaBg :
sectionBg
f_categoryColor(string name, color fallback) =>
str.contains(name, "Momentum") or str.contains(name, "RSI") or str.contains(name, "Return") or str.contains(name, "RS vs") ? purpleTxt :
str.contains(name, "Growth") or str.contains(name, "Income") or str.contains(name, "Yield") or str.contains(name, "Payout") or str.contains(name, "Buyback") or str.contains(name, "Cash") or str.contains(name, "Health") or str.contains(name, "Debt") or str.contains(name, "Ratio") or str.contains(name, "Cover") or str.contains(name, "Altman") or str.contains(name, "OCF") or str.contains(name, "FCF") ? goldTxt :
str.contains(name, "Quality") or str.contains(name, "ROE") or str.contains(name, "ROA") or str.contains(name, "Asset") or str.contains(name, "Piotroski") or str.contains(name, "ROIC") or str.contains(name, "Margin") or str.contains(name, "Profit") ? cyanTxt :
str.contains(name, "Value") or str.contains(name, "P/E") or str.contains(name, "PEG") or str.contains(name, "P/S") or str.contains(name, "P/B") or str.contains(name, "EV/") or str.contains(name, "Graham") or str.contains(name, "EPS") or str.contains(name, "BVPS") or str.contains(name, "52W") ? bullTxt :
str.contains(name, "Liquiditas") or str.contains(name, "Turnover") or str.contains(name, "Beta") or str.contains(name, "IDR") ? goldTxt :
fallback
Overview
Akhmfz is a fundamental analysis dashboard tailored for Indonesian equities on the IDX. It calculates a multi-dimensional score across valuation, business quality, growth, financial health, dividend income, momentum, and an optional local macro factor. Sector-aware logic adapts thresholds across fifteen industry classifications and includes a statistical liquidity and speculative risk filter. Users can adjust benchmark indices, customize factor weight presets, toggle individual scoring dimensions, and change themes or language. It renders directly on the price chart as a comprehensive table.
Seven-factor fundamental scoring dashboard
Fifteen Indonesian sector classifications with auto-detection
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Simbol Saham
symbol
simbolInput
Indeks Acuan / Benchmark
symbol
IDX:COMPOSITE
indeksAcuan
Periode Laporan Keuangan
string
FQ
periodeLaporan
Posisi Tabel
string
Kanan Atas
posisiInput
Ukuran Teks
string
Kecil Sekali
ukuranTeksInput
Tema Warna
string
Profesional Gelap
warnaTema
Gunakan Latar Skor Berwarna
bool
true
tampilLatarSkor
Tampilkan Bar Skor
bool
true
tampilBarSkor
Baris Berselang-seling Halus
bool
true
barisSelangSeling
Header Bagian Berwarna
bool
true
headerBerwarna
Tampilkan Simbol ▲ ▼
bool
true
tampilSimbolStatus
Tampilkan Indikator Kelengkapan Data (n/x)
bool
true
tampilKelengkapan
Show all 40 settings
Setting
Type
Default
Variable
Mode Ringkas (Compact Mode)
bool
false
tampilCompact
Bahasa / Language
string
Indonesia
bahasa
Tampilkan Ringkasan
bool
true
tampilRingkasan
Tampilkan Valuasi
bool
true
tampilValuasi
Tampilkan Kualitas
bool
true
tampilKualitas
Tampilkan Pertumbuhan
bool
true
tampilPertumbuhan
Tampilkan Kesehatan Keuangan
bool
true
tampilKesehatan
Tampilkan Dividen & Imbal Hasil
bool
true
tampilDividen
Tampilkan Momentum
bool
true
tampilMomentum
Aktifkan Faktor Indonesia (7th Factor)
bool
false
tampilIndonesia
Deteksi Sektor
string
Otomatis
modeSektor
Longgarkan Graham Number untuk Sektor Siklikal
bool
true
toleransiSiklikal
Gunakan Bobot Kustom (default: 6 faktor sama rata)
bool
false
gunakanBobotKustom
Preset Bobot
string
Custom
presetBobot
Bobot Value
float
1.0
bobotValue
Bobot Quality
float
1.0
bobotQuality
Bobot Growth
float
1.0
bobotGrowth
Bobot Health
float
1.0
bobotHealth
Bobot Momentum
float
1.0
bobotMomentum
Bobot Income
float
1.0
bobotIncome
Bobot Indonesia Factor
float
1.0
bobotIndonesia
Tampilkan Modul Risiko Likuiditas
bool
true
tampilRisikoGorengan
Ambang Deteksi ARA/ARB (%)
float
24.0
ambangARA
Lookback Hari untuk Hitung ARA/ARB
int
20
lookbackARA
Ambang Kapitalisasi 'Kecil' (Miliar Rp)
float
1000
kapKecilMiliar
Ambang Kapitalisasi 'Besar' (Miliar Rp)
float
10000
kapBesarMiliar
Ambang Nilai Transaksi Harian 'Rendah' (Juta Rp, avg 20D)
float
500
likuiditasRendahJt
Ambang Nilai Transaksi Harian 'Tinggi' (Juta Rp, avg 20D)
float
20000
likuiditasTinggiJt
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This overlay indicator screens a pasted list of up to forty symbols and draws a table on the price chart. It classifies bullish or bearish setups from the percent change between the current candle and the candle 250 bars back, then shows RSI with a simple movi
This multi-symbol indicator evaluates a combined trading condition across up to 40 user-defined symbols. It processes MACD bullish crossovers, RSI thresholds, Bollinger Band boundaries, and DMI/ADX trend filters using security calls. When buy or sell criteria
TradersPost Trading Checklist is an overlay indicator that evaluates a suite of popular technical conditions for long and short trade setups. It checks session-anchored VWAP, fast and slow EMA alignments and crosses, 200 SMA, RSI overbought or oversold conditi
The 8zz Contrarian Indicator plots reverse sentiment trading signals directly on the price chart based on tracked retail post activity. It generates bullish signals during retail panic and bearish signals during market euphoria. The indicator features adjustab
This indicator colors the chart background using a full-screen single-cell table based on the 20-period Relative Strength Index (RSI). When the RSI is above 50, the table applies a bullish background color, and when below 50, a bearish color. The background up
This indicator analyzes historical candle direction and price range over a configurable lookback window to gauge market trend. It categorizes trend direction using candle count, price range sum, or both. Signals are filtered using a Simple Moving Average to en