0% found this document useful (0 votes)
6 views1 page

Multi-Condition Trading Indicator

Uploaded by

Rana Naveen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Multi-Condition Trading Indicator

Uploaded by

Rana Naveen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

//@version=5

indicator("Contoh Indikator Multi-Kondisi", shorttitle="MultiCon", overlay=true)

// Input Pengguna
lenFastEMA = [Link](12, title="Panjang EMA Cepat")
lenSlowEMA = [Link](26, title="Panjang EMA Lambat")
lenRSI = [Link](14, title="Panjang RSI")
rsiBuyLevel = [Link](50, title="Level RSI Beli (Cross Above)")
rsiSellLevel = [Link](50, title="Level RSI Jual (Cross Below)")
rsiOverbought = [Link](70, title="RSI Overbought")
rsiOversold = [Link](30, title="RSI Oversold")
useVolumeFilter = [Link](true, title="Gunakan Filter Volume?")
volumeLookback = [Link](20, title="Periode Rata-rata Volume")

// Kalkulasi Indikator
fastEMA = [Link](close, lenFastEMA)
slowEMA = [Link](close, lenSlowEMA)
rsi = [Link](close, lenRSI)
avgVolume = [Link](volume, volumeLookback)

// Plot EMA untuk visualisasi


plot(fastEMA, title="EMA Cepat", color=[Link]([Link], 0))
plot(slowEMA, title="EMA Lambat", color=[Link]([Link], 0))

// Kondisi Tren
isUptrend = fastEMA > slowEMA
isDowntrend = fastEMA < slowEMA

// Kondisi Volume (jika diaktifkan)


volumeConfirmed = not useVolumeFilter or (volume > avgVolume)

// Kondisi Sinyal Beli


// 1. Tren sedang naik
// 2. RSI baru saja melewati level beli (misal 50) ke atas ATAU RSI sudah di atas
level beli dan belum overbought
// 3. Volume terkonfirmasi (jika diaktifkan)
buySignalCondition = isUptrend and ([Link](rsi, rsiBuyLevel) or (rsi >
rsiBuyLevel and rsi < rsiOverbought)) and volumeConfirmed

// Kondisi Sinyal Jual


// 1. Tren sedang turun
// 2. RSI baru saja melewati level jual (misal 50) ke bawah ATAU RSI sudah di bawah
level jual dan belum oversold
// 3. Volume terkonfirmasi (jika diaktifkan)
sellSignalCondition = isDowntrend and ([Link](rsi, rsiSellLevel) or (rsi <
rsiSellLevel and rsi > rsiOversold)) and volumeConfirmed

// Plot Sinyal pada Chart


plotshape(buySignalCondition, title="Sinyal Beli", location=[Link],
color=[Link]([Link], 0), style=[Link], size=[Link])
plotshape(sellSignalCondition, title="Sinyal Jual", location=[Link],
color=[Link]([Link], 0), style=[Link], size=[Link])

// Alerts (opsional)
alertcondition(buySignalCondition, title="Sinyal Beli Terdeteksi", message="Potensi
sinyal BELI untuk {{ticker}} pada {{close}}")
alertcondition(sellSignalCondition, title="Sinyal Jual Terdeteksi",
message="Potensi sinyal JUAL untuk {{ticker}} pada {{close}}")

You might also like