OPEN-SOURCE SCRIPT

Simple Demand Indicator v2.1 (MA + RSI)

47
//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. اقرأ المزيد في شروط الاستخدام.