Untitled

 avatar
unknown
plain_text
14 days ago
1.0 kB
11
Indexable
//@version=5
indicator("MA Crossover Signal", overlay=true, shorttitle="MA X Signal")

// Hareketli ortalamalar
ma21 = ta.sma(close, 21)
ma13 = ta.sma(close, 13)
ma8  = ta.sma(close, 8)

// Al ve Sat sinyalleri
goldenCross = ta.crossover(ma8, ma13) and close > ma21 // Al sinyali
deathCross  = ta.crossunder(ma8, ma13) and close > ma21 // Sat sinyali

// Sinyalleri çizdirme
plot(ma21, title="MA 21", color=color.blue)
plot(ma13, title="MA 13", color=color.green)
plot(ma8, title="MA 8", color=color.red)

// Al sinyali için işaretleme
plotshape(series=goldenCross, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY")

// Sat sinyali için işaretleme
plotshape(series=deathCross, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL")

// Sinyal üretme (AlertCondition)
alertcondition(goldenCross, title="Buy Signal", message="BUY signal triggered")
alertcondition(deathCross, title="Sell Signal", message="SELL signal triggered")
Editor is loading...
Leave a Comment