OPEN-SOURCE SCRIPT
ROC / VWAP / ATR / RSI / MACD Combo

//version=5
indicator("ROC / VWAP / ATR / RSI / MACD Combo", overlay=true)
// === INPUTS ===
showROC = input.bool(true, "Show ROC")
rocLength = input.int(14, "ROC Length")
showVWAP = input.bool(true, "Show VWAP")
showATR = input.bool(true, "Show ATR")
atrLength = input.int(14, "ATR Length")
showRSI = input.bool(true, "Show RSI")
rsiLength = input.int(14, "RSI Length")
showMACD = input.bool(true, "Show MACD")
fastLen = input.int(12, "MACD Fast Length")
slowLen = input.int(26, "MACD Slow Length")
sigLen = input.int(9, "MACD Signal Length")
// === CALCULATIONS ===
// ROC
roc = ta.roc(close, rocLength)
// VWAP
vwap = ta.vwap
// ATR
atr = ta.atr(atrLength)
// RSI
rsi = ta.rsi(close, rsiLength)
// MACD
macdLine = ta.ema(close, fastLen) - ta.ema(close, slowLen)
signal = ta.ema(macdLine, sigLen)
hist = macdLine - signal
// === PLOTTING ===
// ROC (separate scale)
plot(showROC ? roc : na, title="ROC", color=color.aqua, display=display.none)
// VWAP (on chart)
plot(showVWAP ? vwap : na, title="VWAP", color=color.orange, linewidth=2)
// ATR (separate scale)
plot(showATR ? atr : na, title="ATR", color=color.red, display=display.none)
// RSI (separate scale, 0-100)
plot(showRSI ? rsi : na, title="RSI", color=color.blue, display=display.none)
hline(70, "RSI Overbought", color=color.gray, linestyle=hline.style_dotted)
hline(30, "RSI Oversold", color=color.gray, linestyle=hline.style_dotted)
// MACD (separate scale)
plot(showMACD ? macdLine : na, title="MACD Line", color=color.green, display=display.none)
plot(showMACD ? signal : na, title="Signal Line", color=color.red, display=display.none)
plot(showMACD ? hist : na, title="MACD Histogram", style=plot.style_columns, color=hist>=0 ? color.new(color.green,50) : color.new(color.red,50), display=display.none)
indicator("ROC / VWAP / ATR / RSI / MACD Combo", overlay=true)
// === INPUTS ===
showROC = input.bool(true, "Show ROC")
rocLength = input.int(14, "ROC Length")
showVWAP = input.bool(true, "Show VWAP")
showATR = input.bool(true, "Show ATR")
atrLength = input.int(14, "ATR Length")
showRSI = input.bool(true, "Show RSI")
rsiLength = input.int(14, "RSI Length")
showMACD = input.bool(true, "Show MACD")
fastLen = input.int(12, "MACD Fast Length")
slowLen = input.int(26, "MACD Slow Length")
sigLen = input.int(9, "MACD Signal Length")
// === CALCULATIONS ===
// ROC
roc = ta.roc(close, rocLength)
// VWAP
vwap = ta.vwap
// ATR
atr = ta.atr(atrLength)
// RSI
rsi = ta.rsi(close, rsiLength)
// MACD
macdLine = ta.ema(close, fastLen) - ta.ema(close, slowLen)
signal = ta.ema(macdLine, sigLen)
hist = macdLine - signal
// === PLOTTING ===
// ROC (separate scale)
plot(showROC ? roc : na, title="ROC", color=color.aqua, display=display.none)
// VWAP (on chart)
plot(showVWAP ? vwap : na, title="VWAP", color=color.orange, linewidth=2)
// ATR (separate scale)
plot(showATR ? atr : na, title="ATR", color=color.red, display=display.none)
// RSI (separate scale, 0-100)
plot(showRSI ? rsi : na, title="RSI", color=color.blue, display=display.none)
hline(70, "RSI Overbought", color=color.gray, linestyle=hline.style_dotted)
hline(30, "RSI Oversold", color=color.gray, linestyle=hline.style_dotted)
// MACD (separate scale)
plot(showMACD ? macdLine : na, title="MACD Line", color=color.green, display=display.none)
plot(showMACD ? signal : na, title="Signal Line", color=color.red, display=display.none)
plot(showMACD ? hist : na, title="MACD Histogram", style=plot.style_columns, color=hist>=0 ? color.new(color.green,50) : color.new(color.red,50), display=display.none)
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.