OPEN-SOURCE SCRIPT

EMA Tabanlı Al-Sat Sinyalleri

//version=5
indicator("EMA Tabanlı Al-Sat Sinyalleri", overlay=true)

// Kullanıcı ayarları
emaLength = input.int(50, minval=1, title="EMA Uzunluğu")
smaLength = input.int(14, minval=1, title="SMA Uzunluğu")
atrLength = input.int(14, minval=1, title="ATR Uzunluğu")
stochRsiLength = input.int(14, minval=1, title="Stoch RSI Uzunluğu")
adxLength = input.int(14, minval=1, title="ADX Uzunluğu")
adxSmoothing = input.int(14, minval=1, title="ADX Smoothing")
mfiLength = input.int(14, minval=1, title="MFI Uzunluğu")

// EMA Hesaplama
ema = ta.ema(close, emaLength)

// ATR Hesaplama
atr = ta.atr(atrLength)

// Stoch RSI Hesaplama
k = ta.sma(ta.stoch(close, high, low, stochRsiLength), 3)
d = ta.sma(k, 3)

// ADX Hesaplama
[diPlus, diMinus, adx] = ta.dmi(adxLength, adxSmoothing)

// Al-Sat Şartları
alSinyali = ta.crossover(close, ema) and k > d and adx > 25
satSinyali = ta.crossunder(close, ema) and k < d and adx > 25

// Grafik İşaretçileri
plot(ema, color=color.blue, title="EMA")
plotshape(alSinyali, style=shape.labelup, location=location.belowbar, color=color.green, title="Al Sinyali")
plotshape(satSinyali, style=shape.labeldown, location=location.abovebar, color=color.red, title="Sat Sinyali")

// Al-Sat Sinyallerini Göster
if (alSinyali)
label.new(bar_index, low, "AL", style=label.style_label_up, color=color.green, textcolor=color.white)
if (satSinyali)
label.new(bar_index, high, "SAT", style=label.style_label_down, color=color.red, textcolor=color.white)

// Al ve Sat Sinyallerini İşaretle
bgcolor(alSinyali ? color.new(color.green, 90) : na)
bgcolor(satSinyali ? color.new(color.red, 90) : na)

// Al ve Sat Bildirimleri
alertcondition(alSinyali, title="Al Sinyali", message="Al Sinyali Tetiklendi!")
alertcondition(satSinyali, title="Sat Sinyali", message="Sat Sinyali Tetiklendi!")

Aviso legal