İSTANBUL

“Biz istiyoruz ki, bu memlekette yapılan her iş, üç beş kişinin çıkarına değil, bu toprakları dolduran milyonların yararına olsun!”


Adaptive Oscillator Threshold (BAT)

Francesco Bufi tarafından geliştirilen ve geleneksel RSI göstergesinin alım/satım sinyallerini daha dinamik ve piyasa koşullarına duyarlı hale getiren bir teknik analiz aracıdır. Bu gösterge, trend yönüne göre alım seviyesini ayarlayarak ve fiyatın ortalamadan ne kadar uzaklaştığını dikkate alarak, volatiliteyi hesaba katarak daha etkili sinyaller üretir.

//@version=5
indicator(“TASC 2024.10 Adaptive Oscillator Threshold”, overlay=true)

// Parametreler
length = input.int(14, “Length”)
src = input.source(close, “Source”)

// Linear Regression Slope
lr_slope(src, period) =>
x = array.new_float(period)
y = array.new_float(period)
for i = 0 to period – 1
array.set(x, i, i)
array.set(y, i, src[i])
slope = math.cov(x, y) / math.var(x)
slope

// Standart Sapma
std_dev(src, period) =>
math.stdev(src, period)

// Adaptive Threshold (BAT) Hesaplama
adaptive_threshold(src, period) =>
slope = lr_slope(src, period)
deviation = std_dev(src, period)
threshold = slope / deviation
threshold := math.min(threshold, 0.5)
threshold := math.max(threshold, -0.5)
threshold

// BAT Hesaplaması
threshold = adaptive_threshold(src, length)

// RSI Hesaplaması
rsi_val = ta.rsi(src, length)

// Alım/Satım Sinyalleri
buy_signal = rsi_val < 30 and threshold > 0
sell_signal = rsi_val > 70 and threshold < 0

// Grafik Üzerinde Gösterim
plot(rsi_val, “RSI”, color=color.blue)
hline(30, “Oversold”, color=color.green)
hline(70, “Overbought”, color=color.red)
plotshape(buy_signal, “Buy Signal”, shape.triangleup, location.belowbar, color=color.green, size=size.small)
plotshape(sell_signal, “Sell Signal”, shape.triangledown, location.abovebar, color=color.red, size=size.small)



Yorum bırakın