OPEN-SOURCE SCRIPT
Multi-Condition Alert System d

//version=5
indicator("Multi-Condition Alert System", shorttitle="MC Alert", overlay=false)
// Timeframe check - Set to 10 minutes
isCorrectTF = timeframe.isintraday and timeframe.multiplier == 10
// EMA Calculations
ema9 = ta.ema(close, 9)
ema21 = ta.ema(close, 21)
ema50 = ta.ema(close, 50)
// MACD Calculations
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
// RSI Calculations
rsiValue = ta.rsi(close, 14)
// Define RSI levels (you can adjust these based on your violet/yellow lines)
// Assuming violet is above 50 and yellow is below 50
rsiVioletLevel = 50 // Adjust based on your actual levels
rsiYellowLevel = 50 // Adjust based on your actual levels
// Conditions
emaCondition = ema9 > ema21 and ema9 > ema50
macdCondition = macdLine > signalLine
rsiCondition = rsiValue > rsiVioletLevel and rsiValue > rsiYellowLevel
// All conditions must be true
buySignal = emaCondition and macdCondition and rsiCondition and isCorrectTF
// Plotting for visualization
plot(ema9, color=color.blue, title="EMA 9")
plot(ema21, color=color.orange, title="EMA 21")
plot(ema50, color=color.red, title="EMA 50")
plot(macdLine, color=color.blue, title="MACD Line", style=plot.style_line)
plot(signalLine, color=color.orange, title="Signal Line", style=plot.style_line)
hline(rsiVioletLevel, "RSI Violet Level", color=color.purple)
hline(rsiYellowLevel, "RSI Yellow Level", color=color.yellow)
plot(rsiValue, color=color.white, title="RSI")
// Plot buy signals
plotshape(buySignal ? 1 : na, title="Buy Signal", location=location.bottom,
color=color.green, style=shape.triangleup, size=size.small)
// Alert condition
if buySignal
alert("BUY SIGNAL: EMA 9 > EMA 21 & 50, MACD blue > orange, RSI above levels", alert.freq_once_per_bar)
// Table display
var table signalTable = table.new(position.top_right, 1, 5, bgcolor=color.black,
border_width=1)
if barstate.islast
table.cell(signalTable, 0, 0, "10min TF Check:",
text_color=isCorrectTF ? color.green : color.red)
table.cell(signalTable, 0, 1, "EMA 9 > 21 & 50:",
text_color=emaCondition ? color.green : color.red)
table.cell(signalTable, 0, 2, "MACD Blue > Orange:",
text_color=macdCondition ? color.green : color.red)
table.cell(signalTable, 0, 3, "RSI Condition:",
text_color=rsiCondition ? color.green : color.red)
table.cell(signalTable, 0, 4, "BUY SIGNAL:",
text_color=buySignal ? color.green : color.red)
indicator("Multi-Condition Alert System", shorttitle="MC Alert", overlay=false)
// Timeframe check - Set to 10 minutes
isCorrectTF = timeframe.isintraday and timeframe.multiplier == 10
// EMA Calculations
ema9 = ta.ema(close, 9)
ema21 = ta.ema(close, 21)
ema50 = ta.ema(close, 50)
// MACD Calculations
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
// RSI Calculations
rsiValue = ta.rsi(close, 14)
// Define RSI levels (you can adjust these based on your violet/yellow lines)
// Assuming violet is above 50 and yellow is below 50
rsiVioletLevel = 50 // Adjust based on your actual levels
rsiYellowLevel = 50 // Adjust based on your actual levels
// Conditions
emaCondition = ema9 > ema21 and ema9 > ema50
macdCondition = macdLine > signalLine
rsiCondition = rsiValue > rsiVioletLevel and rsiValue > rsiYellowLevel
// All conditions must be true
buySignal = emaCondition and macdCondition and rsiCondition and isCorrectTF
// Plotting for visualization
plot(ema9, color=color.blue, title="EMA 9")
plot(ema21, color=color.orange, title="EMA 21")
plot(ema50, color=color.red, title="EMA 50")
plot(macdLine, color=color.blue, title="MACD Line", style=plot.style_line)
plot(signalLine, color=color.orange, title="Signal Line", style=plot.style_line)
hline(rsiVioletLevel, "RSI Violet Level", color=color.purple)
hline(rsiYellowLevel, "RSI Yellow Level", color=color.yellow)
plot(rsiValue, color=color.white, title="RSI")
// Plot buy signals
plotshape(buySignal ? 1 : na, title="Buy Signal", location=location.bottom,
color=color.green, style=shape.triangleup, size=size.small)
// Alert condition
if buySignal
alert("BUY SIGNAL: EMA 9 > EMA 21 & 50, MACD blue > orange, RSI above levels", alert.freq_once_per_bar)
// Table display
var table signalTable = table.new(position.top_right, 1, 5, bgcolor=color.black,
border_width=1)
if barstate.islast
table.cell(signalTable, 0, 0, "10min TF Check:",
text_color=isCorrectTF ? color.green : color.red)
table.cell(signalTable, 0, 1, "EMA 9 > 21 & 50:",
text_color=emaCondition ? color.green : color.red)
table.cell(signalTable, 0, 2, "MACD Blue > Orange:",
text_color=macdCondition ? color.green : color.red)
table.cell(signalTable, 0, 3, "RSI Condition:",
text_color=rsiCondition ? color.green : color.red)
table.cell(signalTable, 0, 4, "BUY SIGNAL:",
text_color=buySignal ? color.green : color.red)
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.