Untitled

user_5432013 avatar
user_5432013
plain_text
02/17/2026 2:34 PM
34.0 KB
42
Indexable
//@version=6
indicator("FiboAyna - MA - RSI  [FiboBorsa]", shorttitle = "FiboAyna", overlay=true)

var string mesaj = "⏰ -----| FIBONNACCI |----- ⏰\n\nHisse: {hisse}\nPeriod: {periyot}\nFiyat: {close}\nYön: {yon}\nA Noktası: {A:}\nB Noktası: {B:}\nSeviye: {seviye}\nMum: {mum}"
var string ho_mesaj = "⏰ ---| Hareketli Ortalama |--- ⏰\n\nHisse: {hisse}\nPeriod: {periyot}\nFiyat: {close}\nKesişim: --{ho}--"

var string sym = syminfo.ticker
var string periyot = timeframe.period

// pivots threshold
threshold_multiplier = 5 // input.float(title="Deviation", defval=5, minval=0, group = "Fibonnacci")
depth = 20 // input.int(title="Depth", defval=20, minval=2, group = "Fibonnacci")
reverse = false //input(false, "Reverse", display = display.data_window)
var extendLeft = input(false, "Extend Left    |    Extend Right", inline = "Extend Lines", group = "Fibonnacci")
var extendRight = input(false, "", inline = "Extend Lines", group = "Fibonnacci")
var bars_ahead = input.int(20, "Sağa Uzat", group = "Fibonnacci")
var extending = extend.none
if extendLeft and extendRight
    extending := extend.both
if extendLeft and not extendRight
    extending := extend.left
if not extendLeft and extendRight
    extending := extend.right
prices = input(true, "Show Prices", display = display.data_window, group = "Fibonnacci")
levels = input(true, "Show Levels", inline = "Levels", display = display.data_window, group = "Fibonnacci")
levelsFormat = input.string("Values", "", options = ["Values", "Percent"], inline = "Levels", display = display.data_window, active = levels, group = "Fibonnacci")
labelsPosition = input.string("Right", "Labels Position", options = ["Left", "Right"], display = display.data_window, group = "Fibonnacci")
var int backgroundTransparency = input.int(85, "Background Transparency", minval = 0, maxval = 100, display = display.data_window, group = "Fibonnacci")
var int ss = input.int(14, "Etiket Boyutu", minval = 0, maxval = 24, display = display.data_window, group = "Fibonnacci")

fiboyon = input.string("Dipten Tepe", "Alarm Yönü", ["Dipten Tepe", "Tepeden Dipe"], group = "Alarm Ayarları")

// Timeframe'i milisaniye cinsine çevir
tf_ms = timeframe.in_seconds() * 1000
future_time = time + (tf_ms * bars_ahead)


import TradingView/ZigZag/7 as zigzag

update()=>
    var settings = zigzag.Settings.new(threshold_multiplier, depth, color(na), false, false, false, false, "Absolute", true)
    var zigzag.ZigZag zigZag = zigzag.newInstance(settings)
    var zigzag.Pivot lastP = na
    var float startPrice = na
    var float height = na
    if barstate.islast and zigZag.pivots.size() < 2
        runtime.error("Not enough data to calculate Auto Fib Retracement on the current symbol. Change the chart's timeframe to a lower one or select a smaller calculation depth using the indicator's `Depth` settings.")
    settings.devThreshold := ta.atr(10) / close * 100 * threshold_multiplier
    if zigZag.update()
        lastP := zigZag.lastPivot()
        if not na(lastP)
            var line lineLast = na
            if na(lineLast)
                lineLast := line.new(lastP.start, lastP.end, xloc=xloc.bar_time, color=color.gray, width=1, style=line.style_dashed)
            else
                line.set_first_point(lineLast, lastP.start)
                line.set_second_point(lineLast, lastP.end)

            startPrice := reverse ? lastP.start.price : lastP.end.price
            endPrice = reverse ? lastP.end.price : lastP.start.price
            height := (startPrice > endPrice ? -1 : 1) * math.abs(startPrice - endPrice)
    [lastP, startPrice, height]

[lastP, startPrice, height] = update()

_draw_line(price, col) =>
    var id = line.new(lastP.start.time, lastP.start.price, time, price, xloc=xloc.bar_time, color=col, width=1, extend=extending)
    line.set_xy1(id, lastP.start.time, price)
    line.set_xy2(id, future_time, price)
	id


_draw_label(price, txt, txtColor) =>
    x = labelsPosition == "Left" ? lastP.start.time : not extendRight ? future_time : time
    labelStyle = labelsPosition == "Left" ? label.style_label_right : label.style_label_left
    align = labelsPosition == "Left" ? text.align_right : text.align_left
    labelsAlignStrLeft = txt
    labelsAlignStrRight = txt
    labelsAlignStr = labelsPosition == "Left" ? labelsAlignStrLeft : labelsAlignStrRight
    var id = label.new(x=x, y=price, xloc=xloc.bar_time, text=labelsAlignStr, textcolor=txtColor, style=labelStyle, size=ss, textalign=align, color=#00000000)
    label.set_xy(id, x, price)
    label.set_text(id, labelsAlignStr)
    label.set_textcolor(id, txtColor)

_wrap(txt) =>
    "(" + str.tostring(txt, format.mintick) + ")"

_label_txt(level, price) =>
    l = levelsFormat == "Values" ? str.tostring(level) : str.tostring(level * 100) + "%"
    (levels ? l : "") + (prices ? _wrap(price) : "")

_crossing_level(series float sr, series float r) =>
    (r > sr and r < sr[1]) or (r < sr and r > sr[1])


method placeholders(string str, float a = 0, float b = 0, float level = 0, string ho = "") =>
    mum = close < open ? "🔴" : "🚀"
    yon = not na(lastP) ? lastP.start.price > lastP.end.price ? "↘️ Tepe - Dip ↘️" : "↗️ Dip - Tepe ↗️" : ""
    msg = str

    msg := str.replace(msg, '{hisse}', syminfo.ticker)
    msg := str.replace(msg, '{close}',    str.tostring(close))
    msg := str.replace(msg, '{open}',     str.tostring(open))
    msg := str.replace(msg, '{high}',     str.tostring(high))
    msg := str.replace(msg, '{low}',      str.tostring(low))
    msg := str.replace(msg, '{periyot}',  timeframe.period)
    msg := str.replace(msg, '{A:}',  str.tostring(a))
    msg := str.replace(msg, '{B:}',  str.tostring(b))
    msg := str.replace(msg, '{seviye}',  str.tostring(level))
    msg := str.replace(msg, '{ho}',  str.tostring(ho))
    msg := str.replace(msg, '{yon}', yon)
    msg := str.replace(msg, '{mum}', mum)

    msg

eksiKosulu(seviye, sifir)=>
    seviye < 0 and close > sifir

alarmYonu(string val)=>
    val == "Dipten Tepe" ? lastP.end.price > lastP.start.price : lastP.start.price > lastP.end.price

processLevel(bool show, float value, color colorL, line lineIdOther) =>
    float m = value
	r = startPrice + height * m
    crossed = _crossing_level(close, r)
    if show and not na(lastP)
		lineId = _draw_line(r, colorL)
        _draw_label(r, _label_txt(m, r), colorL)
        if crossed and not eksiKosulu(m, lastP.end.price) and alarmYonu(fiboyon)
            alertMsg = mesaj.placeholders(a = lastP.start.price, b = lastP.end.price, level = value)
            alert(alertMsg)
        if not na(lineIdOther)
            linefill.new(lineId, lineIdOther, color = color.new(colorL, backgroundTransparency))
		lineId
    else
		lineIdOther

// === 30 Input Set ===
// --- Liste Yapısı Korunmuş Gökkuşağı Spektrumu (Mor -> Kızıl) ---

show_1  = input(true,  "",  inline = "Level1",  display = display.data_window)
value_1 = input(-0.886,   "", inline = "Level1",  display = display.data_window, active = show_1)
color_1 = input(color.new(#2E0854, 0), "", inline = "Level1", display = display.data_window, active = show_1) // Derin Mor

show_2  = input(true,  "",  inline = "Level1",  display = display.data_window)
value_2 = input(-0.786,   "", inline = "Level1",  display = display.data_window, active = show_2)
color_2 = input(color.new(#4B0082, 0), "", inline = "Level1", display = display.data_window, active = show_2) // İndigo

show_3  = input(true,  "",  inline = "Level2",  display = display.data_window)
value_3 = input(-0.685,   "", inline = "Level2",  display = display.data_window, active = show_3)
color_3 = input(color.new(#6A0DAD, 0), "", inline = "Level2", display = display.data_window, active = show_3) // Parlak Mor

show_4  = input(true,  "",  inline = "Level2",  display = display.data_window)
value_4 = input(-0.618,   "", inline = "Level2",  display = display.data_window, active = show_4)
color_4 = input(color.new(#8B00FF, 0), "", inline = "Level2", display = display.data_window, active = show_4) // Menekşe

show_5  = input(true,  "",  inline = "Level3",  display = display.data_window)
value_5 = input(-0.5,   "", inline = "Level3",  display = display.data_window, active = show_5)
color_5 = input(color.new(#9370DB, 0), "", inline = "Level3", display = display.data_window, active = show_5) // Orta Mor

show_6  = input(true,  "",  inline = "Level3",  display = display.data_window)
value_6 = input(-0.382,   "", inline = "Level3",  display = display.data_window, active = show_6)
color_6 = input(color.new(#8A2BE2, 0), "", inline = "Level3", display = display.data_window, active = show_6) // Mavi-Mor

show_7  = input(true,  "",  inline = "Level4",  display = display.data_window)
value_7 = input(-0.315,   "", inline = "Level4",  display = display.data_window, active = show_7)
color_7 = input(color.new(#4169E1, 0), "", inline = "Level4", display = display.data_window, active = show_7) // Kraliyet Mavisi

show_8  = input(true,  "",  inline = "Level4",  display = display.data_window)
value_8 = input(-0.214,   "", inline = "Level4",  display = display.data_window, active = show_8)
color_8 = input(color.new(#0000FF, 0), "", inline = "Level4", display = display.data_window, active = show_8) // Saf Mavi

show_9  = input(true,  "",  inline = "Level5",  display = display.data_window)
value_9 = input(-0.114,   "", inline = "Level5",  display = display.data_window, active = show_9)
color_9 = input(color.new(#00BFFF, 0), "", inline = "Level5", display = display.data_window, active = show_9) // Gök Mavisi

show_10  = input(true, "", inline = "Level5", display = display.data_window)
value_10 = input(0,  "", inline = "Level5", display = display.data_window, active = show_10)
color_10 = input(color.new(#00FFFF, 0), "", inline = "Level5", display = display.data_window, active = show_10) // Turkuaz

show_11  = input(true, "", inline = "Level6", display = display.data_window)
value_11 = input(0.114,  "", inline = "Level6", display = display.data_window, active = show_11)
color_11 = input(color.new(#00FA9A, 0), "", inline = "Level6", display = display.data_window, active = show_11) // Bahar Yeşili

show_12  = input(true, "", inline = "Level6", display = display.data_window)
value_12 = input(0.214,  "", inline = "Level6", display = display.data_window, active = show_12)
color_12 = input(color.new(#00FF00, 0), "", inline = "Level6", display = display.data_window, active = show_12) // Saf Yeşil

show_13  = input(true, "", inline = "Level7", display = display.data_window)
value_13 = input(0.315,  "", inline = "Level7", display = display.data_window, active = show_13)
color_13 = input(color.new(#32CD32, 0), "", inline = "Level7", display = display.data_window, active = show_13) // Kireç Yeşili

show_14  = input(true, "", inline = "Level7", display = display.data_window)
value_14 = input(0.382,  "", inline = "Level7", display = display.data_window, active = show_14)
color_14 = input(color.new(#ADFF2F, 0), "", inline = "Level7", display = display.data_window, active = show_14) // Sarı-Yeşil

show_15  = input(true, "", inline = "Level8", display = display.data_window)
value_15 = input(0.5,  "", inline = "Level8", display = display.data_window, active = show_15)
color_15 = input(color.new(#FFFF00, 0), "", inline = "Level8", display = display.data_window, active = show_15) // Saf Sarı

show_16  = input(true, "", inline = "Level8", display = display.data_window)
value_16 = input(0.618,  "", inline = "Level8", display = display.data_window, active = show_16)
color_16 = input(color.new(#FFD700, 0), "", inline = "Level8", display = display.data_window, active = show_16) // Altın

show_17  = input(true, "", inline = "Level9", display = display.data_window)
value_17 = input(0.685,  "", inline = "Level9", display = display.data_window, active = show_17)
color_17 = input(color.new(#FFA500, 0), "", inline = "Level9", display = display.data_window, active = show_17) // Turuncu

show_18  = input(true, "", inline = "Level9", display = display.data_window)
value_18 = input(0.786,  "", inline = "Level9", display = display.data_window, active = show_18)
color_18 = input(color.new(#FF8C00, 0), "", inline = "Level9", display = display.data_window, active = show_18) // Koyu Turuncu

show_19  = input(true, "", inline = "Level10", display = display.data_window)
value_19 = input(0.886,  "", inline = "Level10", display = display.data_window, active = show_19)
color_19 = input(color.new(#FF4500, 0), "", inline = "Level10", display = display.data_window, active = show_19) // Turuncu-Kızıl

show_20  = input(true, "", inline = "Level10", display = display.data_window)
value_20 = input(1,  "", inline = "Level10", display = display.data_window, active = show_20)
color_20 = input(color.new(#FF0000, 0), "", inline = "Level10", display = display.data_window, active = show_20) // Saf Kızıl

show_21  = input(true, "", inline = "Level11", display = display.data_window)
value_21 = input(1.114,  "", inline = "Level11", display = display.data_window, active = show_21)
color_21 = input(color.new(#E60000, 0), "", inline = "Level11", display = display.data_window, active = show_21) // Canlı Kırmızı

show_22  = input(true, "", inline = "Level11", display = display.data_window)
value_22 = input(1.214,  "", inline = "Level11", display = display.data_window, active = show_22)
color_22 = input(color.new(#CC0000, 0), "", inline = "Level11", display = display.data_window, active = show_22) // Koyu Kırmızı

show_23  = input(true, "", inline = "Level12", display = display.data_window)
value_23 = input(1.315,  "", inline = "Level12", display = display.data_window, active = show_23)
color_23 = input(color.new(#B22222, 0), "", inline = "Level12", display = display.data_window, active = show_23) // Ateş Tuğlası

show_24  = input(true, "", inline = "Level12", display = display.data_window)
value_24 = input(1.382,  "", inline = "Level12", display = display.data_window, active = show_24)
color_24 = input(color.new(#A52A2A, 0), "", inline = "Level12", display = display.data_window, active = show_24) // Kahverengi-Kızıl

show_25  = input(true, "", inline = "Level13", display = display.data_window)
value_25 = input(1.5,  "", inline = "Level13", display = display.data_window, active = show_25)
color_25 = input(color.new(#8B0000, 0), "", inline = "Level13", display = display.data_window, active = show_25) // Koyu Kan Rengi

show_26  = input(true, "", inline = "Level13", display = display.data_window)
value_26 = input(1.618,  "", inline = "Level13", display = display.data_window, active = show_26)
color_26 = input(color.new(#800000, 0), "", inline = "Level13", display = display.data_window, active = show_26) // Bordo

show_27  = input(true, "", inline = "Level14", display = display.data_window)
value_27 = input(1.685,  "", inline = "Level14", display = display.data_window, active = show_27)
color_27 = input(color.new(#660000, 0), "", inline = "Level14", display = display.data_window, active = show_27) // Derin Bordo

show_28  = input(true, "", inline = "Level14", display = display.data_window)
value_28 = input(1.786,  "", inline = "Level14", display = display.data_window, active = show_28)
color_28 = input(color.new(#4D0000, 0), "", inline = "Level14", display = display.data_window, active = show_28) // Çok Koyu Kızıl

show_29  = input(true, "", inline = "Level15", display = display.data_window)
value_29 = input(1.886,  "", inline = "Level15", display = display.data_window, active = show_29)
color_29 = input(color.new(#330000, 0), "", inline = "Level15", display = display.data_window, active = show_29) // Siyaha Yakın Kızıl

show_30  = input(true, "", inline = "Level15", display = display.data_window)
value_30 = input(2.0,    "", inline = "Level15", display = display.data_window, active = show_30)
color_30 = input(color.new(#1A0000, 0), "", inline = "Level15", display = display.data_window, active = show_30) // En Koyu Kızıl


lineId1  = processLevel(show_1,  value_1,  color_1,  line(na))
lineId2  = processLevel(show_2,  value_2,  color_2,  lineId1)
lineId3  = processLevel(show_3,  value_3,  color_3,  lineId2)
lineId4  = processLevel(show_4,  value_4,  color_4,  lineId3)
lineId5  = processLevel(show_5,  value_5,  color_5,  lineId4)
lineId6  = processLevel(show_6,  value_6,  color_6,  lineId5)
lineId7  = processLevel(show_7,  value_7,  color_7,  lineId6)
lineId8  = processLevel(show_8,  value_8,  color_8,  lineId7)
lineId9  = processLevel(show_9,  value_9,  color_9,  lineId8)
lineId10 = processLevel(show_10, value_10, color_10, lineId9)
lineId11 = processLevel(show_11, value_11, color_11, lineId10)
lineId12 = processLevel(show_12, value_12, color_12, lineId11)
lineId13 = processLevel(show_13, value_13, color_13, lineId12)
lineId14 = processLevel(show_14, value_14, color_14, lineId13)
lineId15 = processLevel(show_15, value_15, color_15, lineId14)
lineId16 = processLevel(show_16, value_16, color_16, lineId15)
lineId17 = processLevel(show_17, value_17, color_17, lineId16)
lineId18 = processLevel(show_18, value_18, color_18, lineId17)
lineId19 = processLevel(show_19, value_19, color_19, lineId18)
lineId20 = processLevel(show_20, value_20, color_20, lineId19)
lineId21 = processLevel(show_21, value_21, color_21, lineId20)
lineId22 = processLevel(show_22, value_22, color_22, lineId21)
lineId23 = processLevel(show_23, value_23, color_23, lineId22)
lineId24 = processLevel(show_24, value_24, color_24, lineId23)
lineId25 = processLevel(show_25, value_25, color_25, lineId24)
lineId26 = processLevel(show_26, value_26, color_26, lineId25)
lineId27 = processLevel(show_27, value_27, color_27, lineId26)
lineId28 = processLevel(show_28, value_28, color_28, lineId27)
lineId29 = processLevel(show_29, value_29, color_29, lineId28)
lineId30 = processLevel(show_30, value_30, color_30, lineId29)

// Hareketli Ortalamalar
h_show_1  = input.bool(true,  "", inline = "h0", display = display.data_window, group = "Hareketli Ortalamalar")
h_value_1 = input.int(5,      "", inline = "h0", display = display.data_window, active = h_show_1, group = "Hareketli Ortalamalar")
h_color_1 = input.color(color.red, "", inline = "h0", display = display.data_window, active = h_show_1, group = "Hareketli Ortalamalar")
cross_1 =   input.string("Yukarı", "Kesişim", options = ["Yukarı", "Aşağı"], inline = "h0", display = display.data_window, group = "Hareketli Ortalamalar", active = h_show_1)

h_show_2  = input.bool(true,  "", inline = "h1", display = display.data_window, group = "Hareketli Ortalamalar")
h_value_2 = input.int(8,      "", inline = "h1", display = display.data_window, active = h_show_2, group = "Hareketli Ortalamalar")
h_color_2 = input.color(color.lime, "", inline = "h1", display = display.data_window, active = h_show_2, group = "Hareketli Ortalamalar")
cross_2 =   input.string("Yukarı", "Kesişim", options = ["Yukarı", "Aşağı"], inline = "h1", display = display.data_window, group = "Hareketli Ortalamalar", active = h_show_1)

h_show_3  = input.bool(true,  "", inline = "h2", display = display.data_window, group = "Hareketli Ortalamalar")
h_value_3 = input.int(14,     "", inline = "h2", display = display.data_window, active = h_show_3, group = "Hareketli Ortalamalar")
h_color_3 = input.color(color.blue, "", inline = "h2", display = display.data_window, active = h_show_3, group = "Hareketli Ortalamalar")
cross_3 =   input.string("Yukarı", "Kesişim", options = ["Yukarı", "Aşağı"], inline = "h2", display = display.data_window, group = "Hareketli Ortalamalar", active = h_show_1)

h_show_4  = input.bool(true,  "", inline = "h3", display = display.data_window, group = "Hareketli Ortalamalar")
h_value_4 = input.int(21,     "", inline = "h3", display = display.data_window, active = h_show_4, group = "Hareketli Ortalamalar")
h_color_4 = input.color(color.orange, "", inline = "h3", display = display.data_window, active = h_show_4, group = "Hareketli Ortalamalar")
cross_4 =   input.string("Yukarı", "Kesişim", options = ["Yukarı", "Aşağı"], inline = "h3", display = display.data_window, group = "Hareketli Ortalamalar", active = h_show_1)

h_show_5  = input.bool(true,  "", inline = "h4", display = display.data_window, group = "Hareketli Ortalamalar")
h_value_5 = input.int(34,     "", inline = "h4", display = display.data_window, active = h_show_5, group = "Hareketli Ortalamalar")
h_color_5 = input.color(color.purple, "", inline = "h4", display = display.data_window, active = h_show_5, group = "Hareketli Ortalamalar")
cross_5 =   input.string("Yukarı", "Kesişim", options = ["Yukarı", "Aşağı"], inline = "h4", display = display.data_window, group = "Hareketli Ortalamalar", active = h_show_1)

h_show_6  = input.bool(true,  "", inline = "h5", display = display.data_window, group = "Hareketli Ortalamalar")
h_value_6 = input.int(55,     "", inline = "h5", display = display.data_window, active = h_show_6, group = "Hareketli Ortalamalar")
h_color_6 = input.color(color.aqua, "", inline = "h5", display = display.data_window, active = h_show_6, group = "Hareketli Ortalamalar")
cross_6 =   input.string("Yukarı", "Kesişim", options = ["Yukarı", "Aşağı"], inline = "h5", display = display.data_window, group = "Hareketli Ortalamalar", active = h_show_1)

h_show_7  = input.bool(true,  "", inline = "h6", display = display.data_window, group = "Hareketli Ortalamalar")
h_value_7 = input.int(89,     "", inline = "h6", display = display.data_window, active = h_show_7, group = "Hareketli Ortalamalar")
h_color_7 = input.color(color.yellow, "", inline = "h6", display = display.data_window, active = h_show_7, group = "Hareketli Ortalamalar")
cross_7 =   input.string("Yukarı", "Kesişim", options = ["Yukarı", "Aşağı"], inline = "h6", display = display.data_window, group = "Hareketli Ortalamalar", active = h_show_1)

h_show_8  = input.bool(true,  "", inline = "h7", display = display.data_window, group = "Hareketli Ortalamalar")
h_value_8 = input.int(144,    "", inline = "h7", display = display.data_window, active = h_show_8, group = "Hareketli Ortalamalar")
h_color_8 = input.color(color.fuchsia, "", inline = "h7", display = display.data_window, active = h_show_8, group = "Hareketli Ortalamalar")
cross_8 =   input.string("Yukarı", "Kesişim", options = ["Yukarı", "Aşağı"], inline = "h7", display = display.data_window, group = "Hareketli Ortalamalar", active = h_show_1)

rsilenght = input.int(34, "RSI", group = "RSI Kesişim")
rsicross = input.int(50, "Kesişim", group = "RSI Kesişim")

var string rsi_mesaj = "⏰ ---| RSI Kesişim |--- ⏰\n\nHisse: {hisse}\nPeriod: {periyot}\nFiyat: {close}\nRSI: "+ str.tostring(rsicross)

// RSI
rsi = ta.rsi(close, rsilenght)
if ta.cross(rsi, rsicross) and rsi > rsi[1]
    alertMsg = rsi_mesaj.placeholders()       
    alert(alertMsg)

// --- V HESAPLAMA BÖLÜMÜ ---
// V için Gerekli Girdiler
v_src = close
fixCMO = 9
select_logic = true

// V hesaplama fonksiyonları
f1(m) =>
    m >= 0.0 ? m : 0.0
f2(m) =>
    m >= 0.0 ? 0.0 : -m
percent(nom, div) =>
    div == 0 ? 0 : 100 * nom / div // Sıfıra bölme hatasını önle

// V'yi belirli bir kaynak (source) ve periyot (pds) için hesaplayan fonksiyon
calc_v(src_series, pds) =>
    alpha = 2 / (pds + 1)
    momm = ta.change(src_series)
    m1 = f1(momm)
    m2 = f2(momm)
    sm1 = fixCMO > 0 ? math.sum(m1, fixCMO) : math.sum(m1, pds)
    sm2 = fixCMO > 0 ? math.sum(m2, fixCMO) : math.sum(m2, pds)
    chandeMO = percent(sm1 - sm2, sm1 + sm2)
    k = select_logic ? math.abs(chandeMO) / 100 : ta.stdev(src_series, pds)
    var float v = 0.0
    v := nz(src_series[1]) // Başlangıç değeri olarak bir önceki barın kaynağını kullan
    v := nz(alpha * k * src_series) + (1 - alpha * k) * nz(v[1])
    v


v_1 = calc_v(close, h_value_1)
v_2 = calc_v(close, h_value_2)
v_3 = calc_v(close, h_value_3)
v_4 = calc_v(close, h_value_4)
v_5 = calc_v(close, h_value_5)
v_6 = calc_v(close, h_value_6)
v_7 = calc_v(close, h_value_7)
v_8 = calc_v(close, h_value_8)

check_cross(cross_type, v_value) =>
    cross_type == "Yukarı" ? close > v_value and close[1] < v_value : close < v_value and close[1] > v_value


plot(h_show_1 ? v_1 : na, title = "HO 1", color = h_color_1)
if h_show_1 and check_cross(cross_1, v_1)
    alertMsg = ho_mesaj.placeholders(ho = str.tostring(h_value_1))        
    alert(alertMsg)


plot(h_show_2 ? v_2 : na, title = "HO 2", color = h_color_2)
if h_show_2 and check_cross(cross_2, v_2)
    alertMsg = ho_mesaj.placeholders(ho = str.tostring(h_value_2))        
    alert(alertMsg)


plot(h_show_3 ? v_3 : na, title = "HO 3", color = h_color_3)
if h_show_3 and check_cross(cross_3, v_3)
    alertMsg = ho_mesaj.placeholders(ho = str.tostring(h_value_3))        
    alert(alertMsg)


plot(h_show_4 ? v_4 : na, title = "HO 4", color = h_color_4)
if h_show_4 and check_cross(cross_4, v_4)
    alertMsg = ho_mesaj.placeholders(ho = str.tostring(h_value_4))        
    alert(alertMsg)


plot(h_show_5 ? v_5 : na, title = "HO 5", color = h_color_5)
if h_show_5 and check_cross(cross_5, v_5)
    alertMsg = ho_mesaj.placeholders(ho = str.tostring(h_value_5))        
    alert(alertMsg)


plot(h_show_6 ? v_6 : na, title = "HO 6", color = h_color_6)
if h_show_6 and check_cross(cross_6, v_6)
    alertMsg = ho_mesaj.placeholders(ho = str.tostring(h_value_6))        
    alert(alertMsg)


plot(h_show_7 ? v_7 : na, title = "HO 7", color = h_color_7)
if h_show_7 and check_cross(cross_7, v_7)
    alertMsg = ho_mesaj.placeholders(ho = str.tostring(h_value_7))        
    alert(alertMsg)


plot(h_show_8 ? v_8 : na, title = "HO 8", color = h_color_8)
if h_show_8 and check_cross(cross_8, v_8)
    alertMsg = ho_mesaj.placeholders(ho = str.tostring(h_value_8))        
    alert(alertMsg)


// Tek hücrelik tablo: 1 sütun, 1 satır
var table myTable = table.new(position.bottom_right, 1, 1, border_width=1)

if barstate.islast
    string yin = lastP.start.price > lastP.end.price ? "↘️" : "↗️"
    table.cell(myTable, 0, 0, text="FiboAyna v11 | Yön: " + yin + "\n\nFiboBorsa | Mr_Rakun", text_color=color.fuchsia, bgcolor=color.new(color.fuchsia, 70))
Editor is loading...
Leave a Comment