OPEN-SOURCE SCRIPT
Simple Demand Indicator v3.1 (MA + RSI Kombinasi)

//version=5
indicator("Simple Demand Indicator v3.1 (MA + RSI Kombinasi)", overlay=true)
// Input
maLength = input.int(50, "Moving Average Length")
rsiLength = input.int(14, "RSI Length")
overSold = input.int(30, "RSI Oversold")
overBought = input.int(70, "RSI Overbought")
// Hitung MA & RSI
ma = ta.sma(close, maLength)
rsi = ta.rsi(close, rsiLength)
// Sinyal dasar crossing MA
buySignal = ta.crossover(close, ma)
sellSignal = ta.crossunder(close, ma)
// Warna panah sesuai RSI
buyColor = (rsi < overSold) ? color.lime : color.green
sellColor = (rsi > overBought)? color.red : color.orange
// Plot MA
plot(ma, color=color.orange, title="MA Trend")
// Plot panah BUY
plotshape(buySignal, title="BUY", style=shape.labelup,
color=buyColor, text="BUY", textcolor=color.white,
location=location.belowbar, size=size.small)
// Plot panah SELL
plotshape(sellSignal, title="SELL", style=shape.labeldown,
color=sellColor, text="SELL", textcolor=color.white,
location=location.abovebar, size=size.small)
// Alerts
alertcondition(buySignal, title="BUY Signal",
message="📈 BUY Signal pada {{ticker}} TF {{interval}} (RSI={{rsi}})")
alertcondition(sellSignal, title="SELL Signal",
message="📉 SELL Signal pada {{ticker}} TF {{interval}} (RSI={{rsi}})")
indicator("Simple Demand Indicator v3.1 (MA + RSI Kombinasi)", overlay=true)
// Input
maLength = input.int(50, "Moving Average Length")
rsiLength = input.int(14, "RSI Length")
overSold = input.int(30, "RSI Oversold")
overBought = input.int(70, "RSI Overbought")
// Hitung MA & RSI
ma = ta.sma(close, maLength)
rsi = ta.rsi(close, rsiLength)
// Sinyal dasar crossing MA
buySignal = ta.crossover(close, ma)
sellSignal = ta.crossunder(close, ma)
// Warna panah sesuai RSI
buyColor = (rsi < overSold) ? color.lime : color.green
sellColor = (rsi > overBought)? color.red : color.orange
// Plot MA
plot(ma, color=color.orange, title="MA Trend")
// Plot panah BUY
plotshape(buySignal, title="BUY", style=shape.labelup,
color=buyColor, text="BUY", textcolor=color.white,
location=location.belowbar, size=size.small)
// Plot panah SELL
plotshape(sellSignal, title="SELL", style=shape.labeldown,
color=sellColor, text="SELL", textcolor=color.white,
location=location.abovebar, size=size.small)
// Alerts
alertcondition(buySignal, title="BUY Signal",
message="📈 BUY Signal pada {{ticker}} TF {{interval}} (RSI={{rsi}})")
alertcondition(sellSignal, title="SELL Signal",
message="📉 SELL Signal pada {{ticker}} TF {{interval}} (RSI={{rsi}})")
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.