326
//version=5
strategy("WT + Divergence Sinyal Stratejisi", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

// === WT_CROSS_LB Hesaplaması ===
length = input.int(10, title="WT Length")
channelLen = input.int(21, title="Channel Length")
averageLen = input.int(4, title="Average Length")

ap = hlc3
esa = ta.ema(ap, length)
d = ta.ema(math.abs(ap - esa), length)
ci = (ap - esa) / (0.015 * d)
wt1 = ta.ema(ci, averageLen)
wt2 = ta.sma(wt1, channelLen)

plot(wt1, color=color.green, title="WT1")
plot(wt2, color=color.red, title="WT2")

// === Uyumsuzluk (Divergence) Göstergesi (Yer Tutucu - Simülasyon) ===
// NOT: TradingView üzerinde orijinal "Divergence for Many Indicators v4" koduna erişim gerekebilir.
// Geçici olarak RSI tabanlı uyumsuzluk tespiti yapılır (sinyallerle uyumlu olması için).
rsi = ta.rsi(close, 14)
bullishDiv = ta.lowest(close, 5) < ta.lowest(close[5], 5) and rsi > rsi[5]
bearishDiv = ta.highest(close, 5) > ta.highest(close[5], 5) and rsi < rsi[5]

// === Al / Sat Kuralları ===
longCondition = wt1 < -60 and bullishDiv
shortCondition = wt1 > 60 and bearishDiv

if (longCondition)
strategy.entry("AL", strategy.long)
if (shortCondition)
strategy.entry("SAT", strategy.short)

// === Alarm Koşulları ===
alertcondition(longCondition, title="AL Sinyali", message="AL sinyali oluştu!")
alertcondition(shortCondition, title="SAT Sinyali", message="SAT sinyali oluştu!")

plotshape(longCondition, title="AL Sinyali", location=location.belowbar, color=color.green, style=shape.labelup, text="AL")
plotshape(shortCondition, title="SAT Sinyali", location=location.abovebar, color=color.red, style=shape.labeldown, text="SAT")

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.