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}})")
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.