OPEN-SOURCE SCRIPT

Multi-Condition Alert System d

24
//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)

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.