OPEN-SOURCE SCRIPT

Simple Demand Indicator v2.1 (MA + RSI)

43
//version=5
indicator("Simple Demand Indicator v2.1 (MA + RSI)", 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")

// === CALCULATION ===
ma = ta.sma(close, maLength)
rsi = ta.rsi(close, rsiLength)

// BUY: harga cross up MA + RSI oversold
buySignal = ta.crossover(close, ma) and rsi < overSold

// SELL: harga cross down MA + RSI overbought
sellSignal = ta.crossunder(close, ma) and rsi > overBought

// === PLOT MA ===
plot(ma, color=color.orange, title="MA Trend")

// === PLOT SIGNAL ARROWS ===
plotshape(buySignal, title="BUY Signal", style=shape.labelup, color=color.green,
text="BUY", textcolor=color.white, size=size.small, location=location.belowbar)

plotshape(sellSignal, title="SELL Signal", style=shape.labeldown, color=color.red,
text="SELL", textcolor=color.white, size=size.small, location=location.abovebar)

// === ALERTS ===
alertcondition(buySignal, title="BUY Signal", message="📈 BUY Signal pada {{ticker}} TF {{interval}}")
alertcondition(sellSignal, title="SELL Signal", message="📉 SELL Signal pada {{ticker}} TF {{interval}}")

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.