OPEN-SOURCE SCRIPT
Multi-Indicator Buy/Sell Signals (EMA, RSI, MACD)

// This source code is subject to the terms of the Mozilla Public License 2.0
// mozilla.org/MPL/2.0/
// © buy and sell signals gio1
//version=5
indicator("Multi-Indicator Buy/Sell Signals (EMA, RSI, MACD)", overlay=true)
// --- Inputs for Moving Averages ---
fastMALen = input.int(10, title="Fast EMA Length", minval=1)
slowMALen = input.int(20, title="Slow EMA Length", minval=1)
// --- Inputs for RSI ---
rsiLength = input.int(14, title="RSI Length", minval=1)
rsiOB = input.int(70, title="RSI Overbought Level", minval=50, maxval=90)
rsiOS = input.int(30, title="RSI Oversold Level", minval=10, maxval=50)
// --- Inputs for MACD ---
macdFastLen = input.int(12, title="MACD Fast Length", minval=1)
macdSlowLen = input.int(26, title="MACD Slow Length", minval=1)
macdSigLen = input.int(9, title="MACD Signal Length", minval=1)
// --- Calculate Indicators ---
// EMA
fastMA = ta.ema(close, fastMALen)
slowMA = ta.ema(close, slowMALen)
// RSI
rsi = ta.rsi(close, rsiLength)
// MACD
[macdLine, signalLine, hist] = ta.macd(close, macdFastLen, macdSlowLen, macdSigLen)
// --- Define Buy and Sell Conditions ---
// EMA Crossover Condition
emaBuy = ta.crossover(fastMA, slowMA)
emaSell = ta.crossunder(fastMA, slowMA)
// RSI Condition
rsiBuy = rsi[1] < rsiOS and rsi > rsiOS // Crossing up from oversold
rsiSell = rsi[1] > rsiOB and rsi < rsiOB // Crossing down from overbought
// MACD Condition
macdBuy = ta.crossover(macdLine, signalLine)
macdSell = ta.crossunder(macdLine, signalLine)
// --- Combine Conditions for Final Signals ---
buySignal = emaBuy and rsiBuy and macdBuy
sellSignal = emaSell and rsiSell and macdSell
// --- Plot Signals on Chart ---
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// --- Add Alert Conditions ---
alertcondition(buySignal, title="Buy Alert", message="🔔 BUY signal triggered!")
alertcondition(sellSignal, title="Sell Alert", message="🔔 SELL signal triggered!")
// mozilla.org/MPL/2.0/
// © buy and sell signals gio1
//version=5
indicator("Multi-Indicator Buy/Sell Signals (EMA, RSI, MACD)", overlay=true)
// --- Inputs for Moving Averages ---
fastMALen = input.int(10, title="Fast EMA Length", minval=1)
slowMALen = input.int(20, title="Slow EMA Length", minval=1)
// --- Inputs for RSI ---
rsiLength = input.int(14, title="RSI Length", minval=1)
rsiOB = input.int(70, title="RSI Overbought Level", minval=50, maxval=90)
rsiOS = input.int(30, title="RSI Oversold Level", minval=10, maxval=50)
// --- Inputs for MACD ---
macdFastLen = input.int(12, title="MACD Fast Length", minval=1)
macdSlowLen = input.int(26, title="MACD Slow Length", minval=1)
macdSigLen = input.int(9, title="MACD Signal Length", minval=1)
// --- Calculate Indicators ---
// EMA
fastMA = ta.ema(close, fastMALen)
slowMA = ta.ema(close, slowMALen)
// RSI
rsi = ta.rsi(close, rsiLength)
// MACD
[macdLine, signalLine, hist] = ta.macd(close, macdFastLen, macdSlowLen, macdSigLen)
// --- Define Buy and Sell Conditions ---
// EMA Crossover Condition
emaBuy = ta.crossover(fastMA, slowMA)
emaSell = ta.crossunder(fastMA, slowMA)
// RSI Condition
rsiBuy = rsi[1] < rsiOS and rsi > rsiOS // Crossing up from oversold
rsiSell = rsi[1] > rsiOB and rsi < rsiOB // Crossing down from overbought
// MACD Condition
macdBuy = ta.crossover(macdLine, signalLine)
macdSell = ta.crossunder(macdLine, signalLine)
// --- Combine Conditions for Final Signals ---
buySignal = emaBuy and rsiBuy and macdBuy
sellSignal = emaSell and rsiSell and macdSell
// --- Plot Signals on Chart ---
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// --- Add Alert Conditions ---
alertcondition(buySignal, title="Buy Alert", message="🔔 BUY signal triggered!")
alertcondition(sellSignal, title="Sell Alert", message="🔔 SELL signal triggered!")
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.