arkadaşlar tradingview kullanıp, "evet şu indikatör çok güzel sonuçlar veriyor" dedikleriniz neler? geçenlerde bolinger bandı kullanarak sinyal veren bir indikatör hazırladım fena gitmiyor da alternatif de yaratmak istedim. burada da paylaşırım düzenlemesini yaptıktan sonra, eğer fikrini söyleyenler olursa.
Bollinger olan için düzenlediğim kodu aşağıda paylaşayım. kullanmak isteyen, fikrini söylemek isteyen olursa açığım.
//@version=5
indicator(shorttitle="BB", title="Bollinger Bands with Signals", overlay=true, timeframe="", timeframe_gaps=true)
length = input.int(20, minval=1)
maType = input.string("SMA", "Basis MA Type", options = ["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"])
src = input(close, title="Source")
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev")
ma(source, length, _type) =>
switch _type
"SMA" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
basis = ma(src, length, maType)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
offset = input.int(0, "Offset", minval = -500, maxval = 500, display = display.data_window)
plot(basis, "Basis", color=#2962FF, offset = offset)
p1 = plot(upper, "Upper", color=#F23645, offset = offset)
p2 = plot(lower, "Lower", color=#089981, offset = offset)
fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))
// LONG ve SHORT sinyallerini belirlemek
longSignal = ta.crossover(src, lower)
shortSignal = ta.crossunder(src, upper)
// LONG ve SHORT sinyallerini grafikte göstermek
plotshape(series=longSignal, title="LONG", location=location.belowbar, color=color.green, style=shape.labelup, text="LONG", textcolor = color.white)
plotshape(series=shortSignal, title="SHORT", location=location.abovebar, color=color.red, style=shape.labeldown, text="SHORT", textcolor = color.white)
// Alarm durumları
alertcondition(longSignal, title="LONG Signal", message="LONG sinyali oluşturuldu")
alertcondition(shortSignal, title="SHORT Signal", message="SHORT sinyali oluşturuldu")