//version=4
study("Custom Indicator", overlay=true)

// Moving Average
ma_short = sma(close, 10)
ma_long = sma(close, 50)
plot(ma_short, color=color.blue)
plot(ma_long, color=color.red)

// RSI
rsi = rsi(close, 14)
hline(70, "Overbought", color=color.red)
hline(30, "Oversold", color=color.green)
plot(rsi, color=color.purple)

// MACD
[macdLine, signalLine, _] = macd(12, 26, 9)
plot(macdLine, color=color.blue)
plot(signalLine, color=color.red)
bgcolor(macdLine > signalLine ? color.green : color.red, transp=90)

// Bollinger Bands
basis = sma(close, 20)
dev = stdev(close, 20)
upper = basis + dev * 2
lower = basis - dev * 2
plot(upper, color=color.green)
plot(lower, color=color.green)
Trend Analysis

คำจำกัดสิทธิ์ความรับผิดชอบ