Artan
Azalan
οΏ½οΏ½lem
BIST 30
BIST 50
BIST 100
NASDAQ 100
Hisse Fiyat Fark% Hacim (TL) DοΏ½οΏ½οΏ½k / YοΏ½ksek
9,68 10% 789,89 Mn 8,60 / 9,68
80,30 10% 41,42 Mn 80,30 / 80,30
80,30 10% 2,14 Mr 72,10 / 80,30
19,48 9.99% 1,34 Mr 17,70 / 19,48
155,40 9.98% 1,72 Mr 140,30 / 155,40
Hisse Fiyat Fark% Hacim (TL) DοΏ½οΏ½οΏ½k / YοΏ½ksek
2.431.800,00 -10% 2,43 Mn 2.431.800,00 / 2.431.800,00
355,75 -9.99% 429,56 Mn 355,75 / 386,50
2.498,00 -9.98% 5,27 Mr 2.498,00 / 2.780,00
11,18 -9.98% 1,93 Mr 11,18 / 12,59
55,35 -9.93% 218,80 Mn 55,35 / 61,40
Hisse Fiyat Fark% Hacim (TL) DοΏ½οΏ½οΏ½k / YοΏ½ksek
3,52 5.71% 31,52 Mr 3,34 / 3,58
311,00 -0.48% 16,35 Mr 306,75 / 314,75
326,00 1.64% 11,68 Mr 315,00 / 334,00
41,26 7.22% 10,79 Mr 38,30 / 41,30
75,25 0.07% 9,91 Mr 73,90 / 76,15
Hisse Fiyat Fark% Hacim (TL) DοΏ½οΏ½οΏ½k / YοΏ½ksek
20,46 -0.39% 605,89 Mn 20,16 / 20,72
75,25 0.07% 9,91 Mr 73,90 / 76,15
428,50 0.12% 7,72 Mr 426,25 / 434,50
326,00 1.64% 11,68 Mr 315,00 / 334,00
790,00 0.77% 3,13 Mr 777,00 / 802,50
Hisse Fiyat Fark% Hacim (TL) DοΏ½οΏ½οΏ½k / YοΏ½ksek
20,46 -0.39% 605,89 Mn 20,16 / 20,72
75,25 0.07% 9,91 Mr 73,90 / 76,15
99,15 -0.8% 503,79 Mn 98,00 / 100,00
114,20 -0.7% 209,55 Mn 113,40 / 115,40
428,50 0.12% 7,72 Mr 426,25 / 434,50
Hisse Fiyat Fark% Hacim (TL) DοΏ½οΏ½οΏ½k / YοΏ½ksek
20,46 -0.39% 605,89 Mn 20,16 / 20,72
35,06 -2.61% 288,12 Mn 35,06 / 36,86
75,25 0.07% 9,91 Mr 73,90 / 76,15
11,20 0.99% 680,06 Mn 10,85 / 11,45
86,70 -1.81% 469,42 Mn 86,40 / 89,00

Masrafsύz Bankacύlύk + 1.000 TL Nakit! Enpara’dan Ηifte Avantaj

Masrafsύz Bankacύlύk + 1.000 TL Nakit! Enpara’dan Ηifte Avantaj
Sayfa 415/418 έlkέlk ... 315365405413414415416417 ... SonSon
Arama sonucu : 3337 madde; 3,313 - 3,320 arasύ.

Konu: Tradingview




  1. okuyanlar iηin... paylaώύlan φrneklerden... beπendiπiniz kύsύmlarύ... alύp...
    birleώtirme yaparsanύz....

    buna benzer... grafikler όretmiώ olursunuz....

    paylaώύlan kodlarύn iηinde... ώu ana kadar TW gibi platformlarda... benzeri olmayan kodlar vardύr....

    gόzel birleώtirmelerinizi... burada paylaώύrsanύz....

    sevinirim....

    bilen paylaώύr...

    selamlar.....

    not: isteyen burdaki kod ηalύώmalarύnύ....TW de paylaώabilir... Ηόnkό hepsi Aέ tarafύndan yazύlmύώ...
    eπitim ηalύώmasύndan ibarettir....
    16.07.2024 - 10.12.2024

  2. bir kalύp gibi dόώόnόn... beπenmediπiniz her yeri silin geηin...
    PHP Code:
    // © Kinetik Komuta Merkezi [Masterpiece V6.9 Terminal + Z-Vortex + Z-Div]
    //@version=6
    indicator("yφrόk"shorttitle="."overlay=truemax_labels_count=50max_lines_count=50)

    // ─────────────────────────────────────────────────────────────────
    // 7. SAR HESAPLAMALARI VE ΗέZέMLER
    // ─────────────────────────────────────────────────────────────────
    float roSarSlow     ta.sar(0.010.010.2)
    float roSarModerate ta.sar(0.010.020.2)
    float roSarFast     ta.sar(0.010.030.2)

    plot(roSarSlow,     title="C"style=plot.style_crosscolor=color.yellow,  linewidth=1)
    plot(roSarModeratetitle="B",  style=plot.style_crosscolor=color.yellowlinewidth=1)
    plot(roSarFast,     title="A"style=plot.style_crosscolor=color.yellow,   linewidth=1)

    float sarMavi ta.sar(0.00.0030.02), sarSari ta.sar(0.00.0010.02), sarFusya ta.sar(0.0010.00050.02)
    plot(sarMavi"X"color.new(#040cfb, 0), 1, plot.style_cross)
    plot(sarSari"Y"color.new(#040cfb, 0), 1, plot.style_cross)
    plot(sarFusya"Z"color.new(#040cfb, 0), 1, plot.style_cross)
    // 1. GέRDέLER
    // ─────────────────────────────────────────────────────────────────
    group_l1 "1. Kinetik Motor (Yφrόk)"
    int atrLen input.int(20"L1 Hafύza (ATR)"group=group_l1)
    float atrMult input.float(3.5"L1 Gόrόltό Duvarύ"step=0.1group=group_l1)
    float mu input.float(0.6"L1 Yakύnsaklύk (μ)"step=0.1group=group_l1)


    group_holy "3. Kurumsal S-TWAP Filtresi"
    float maxTension input.float(2.0"Maksimum Gerginlik Sύnύrύ"step=0.1group=group_holy)

    // ─────────────────────────────────────────────────────────────────
    // 2. ARKA PLAN HESAPLAMALARI (SAF YΦRάK VE TWAP)
    // ─────────────────────────────────────────────────────────────────
    f_yoruk_pure() =>
        
    float threshold ta.atr(atrLen) * atrMult
        
    var float z na
        
    var float v 0.0
        
    if bar_index == 0
            z 
    := hl2
        
    else
            
    float zPrev z[1], float vPrev v[1]
            
    float zPred zPrev vPrev
            float zTemp 
    zPred mu * (hl2 zPred)
            
    float diff zTemp zPrev
            
    if math.abs(diff) > threshold
                v 
    := math.sign(diff) * (math.abs(diff) - threshold)
            else
                
    := 0.0
            z 
    := zPrev v
        z

    bool isNew15m 
    ta.change(time("15")) != 0
    var float sumPrice15m 0.0, var float barCount15m 0.0
    if isNew15m or bar_index == 0
        sumPrice15m 
    := hl2barCount15m := 1.0
    else
        
    sumPrice15m += hl2barCount15m += 1.0
    float curTwap15m 
    sumPrice15m barCount15m

    bool isNewHour 
    ta.change(time("60")) != 0
    var float sumPriceH 0.0, var float barCountH 0.0
    if isNewHour or bar_index == 0
        sumPriceH 
    := hl2barCountH := 1.0
    else
        
    sumPriceH += hl2barCountH += 1.0
    float curTwapH 
    sumPriceH barCountH

    bool isNewDay 
    ta.change(time("D")) != 0
    var float sumPriceD 0.0, var float barCountD 0.0
    if isNewDay or bar_index == 0
        sumPriceD 
    := hl2barCountD := 1.0
    else
        
    sumPriceD += hl2barCountD += 1.0
    float curTwapD 
    sumPriceD barCountD

    // ─────────────────────────────────────────────────────────────────
    // GέRDέLER VE RENKLER
    // ─────────────────────────────────────────────────────────────────
    int len input.int(89"Maliyet Uzunluπu")

    color col_up  input.color(#00e676, "Yόkseliώ Rengi (Yeώil)")
    color col_dn  input.color(#ff1744, "Dόώόώ Rengi (Kύrmύzύ)")
    color col_mid input.color(color.fuchsia"Merkez Ηizgi Rengi")

    // ─────────────────────────────────────────────────────────────────
    // HESAPLAMA (Sύfύr Gecikmeli Pόrόzsόz Merkez)
    // ─────────────────────────────────────────────────────────────────
    float mid ta.hma(ta.median(hl2len 2), 233)

    // ─────────────────────────────────────────────────────────────────
    // ΗέZέM VE BOYA
    // ─────────────────────────────────────────────────────────────────
    // Tek beyaz merkez hattύ
    plot(midtitle "Maliyet"color col_midlinewidth 1)

    // Sadece Kύrmύzύ ve Yeώil mantύπύ
    color bar_col close mid col_up close mid col_dn color.gray

    // Mumlarύ ve sύnύrlarύ boya
    //plotcandle(open, high, low, close, title='Renk Mumlarύ', color = bar_col, wickcolor=bar_col, bordercolor = bar_col)
    barcolor(bar_col)
    // 4. ήELALE ΗέZέMLERέ (Yφrόk MTF)
    // ─────────────────────────────────────────────────────────────────
    float y1   f_yoruk_pure() 
    float y3   request.security(syminfo.tickerid"3",   f_yoruk_pure(), lookahead=barmerge.lookahead_off)
    float y5   request.security(syminfo.tickerid"5",   f_yoruk_pure(), lookahead=barmerge.lookahead_off)
    float y15  request.security(syminfo.tickerid"15",  f_yoruk_pure(), lookahead=barmerge.lookahead_off)
    float y60  request.security(syminfo.tickerid"60",  f_yoruk_pure(), lookahead=barmerge.lookahead_off)
    float y240 request.security(syminfo.tickerid"240"f_yoruk_pure(), lookahead=barmerge.lookahead_off
    float yD   request.security(syminfo.tickerid"D",   f_yoruk_pure(), lookahead=barmerge.lookahead_off

    plot(y1,   "1m Yφrόk",  color=color.new(#03d3f8, 0), linewidth=1, style=plot.style_stepline)


    // ─────────────────────────────────────────────────────────────────
    // 5. MέKRO ATEήLEME & MANYETέK HEDEFLEME MANTIΠI
    // ─────────────────────────────────────────────────────────────────
    float safeAtr math.max(ta.atr(14), syminfo.mintick)
    bool isIgnition = (high low) >= (safeAtr 1.5)

    float atrH request.security(syminfo.tickerid"60"ta.atr(14), lookahead=barmerge.lookahead_off)
    float twapDistAtr atrH math.abs(close curTwapH) / atrH 0
    bool tensionOk 
    twapDistAtr <= maxTension

    bool breakBull 
    close y1 and close y3 and (open y1 or open y3 or close[1] < y1)
    bool breakBear close y1 and close y3 and (open y1 or open y3 or close[1] > y1)

    bool fireBull breakBull and isIgnition and close curTwapH and close open and tensionOk
    bool fireBear 
    breakBear and isIgnition and close curTwapH and close open and tensionOk

    //bgcolor(fireBull ? color.new(#00e676, 85) : fireBear ? color.new(#ff1744, 85) : na, title="Ateώleme Zemin Flaώύ")

    var int   activeSide   0
    var float entryPrice   na
    var bool  hasMagnet    false 

    var line lineEntry na, var label lblEntry na

    if (fireBull and activeSide != 1)
        
    activeSide := 1entryPrice := closehasMagnet := y60 close
        
    if not na(lineEntry)
            
    line.delete(lineEntry), label.delete(lblEntry)
        
    lineEntry := line.new(bar_indexentryPricebar_index 5entryPricecolor=color.new(#00e676, 0), width=2)
        
    lblEntry  := label.new(bar_index 5entryPrice"GέRέή: " str.tostring(math.round(entryPrice2)), color=color.new(#00e676, 80), textcolor=color.white, style=label.style_label_left, size=size.small)

    else if (fireBear and activeSide != -1)
        
    activeSide := -1entryPrice := closehasMagnet := y60 close
        
    if not na(lineEntry)
            
    line.delete(lineEntry), label.delete(lblEntry)
        
    lineEntry := line.new(bar_indexentryPricebar_index 5entryPricecolor=color.new(#ff1744, 0), width=2)
        
    lblEntry  := label.new(bar_index 5entryPrice"GέRέή: " str.tostring(math.round(entryPrice2)), color=color.new(#ff1744, 80), textcolor=color.white, style=label.style_label_left, size=size.small)

    if activeSide != 0
        line
    .set_x2(lineEntrybar_index 5), label.set_x(lblEntrybar_index 5)
        
        
    bool magnetHitBull activeSide == and hasMagnet and high >= y60
        bool magnetHitBear 
    activeSide == -and hasMagnet and low <= y60
        bool microStopBull 
    activeSide == and close y1
        bool microStopBear 
    activeSide == -and close y1
        
        
    if magnetHitBull or magnetHitBear
            activeSide 
    := 0
            line
    .set_color(lineEntrycolor.new(color.gray60)), label.set_color(lblEntrycolor.new(color.gray60))
            
        else if 
    microStopBull or microStopBear
            activeSide 
    := 0
            line
    .set_color(lineEntrycolor.new(color.gray60)), label.set_color(lblEntrycolor.new(color.gray60))

    // ─────────────────────────────────────────────────────────────────
    // 6. TERMINAL PUSULASI (TAM KONTROL HUD)
    // ─────────────────────────────────────────────────────────────────
    var table terminal table.new(position.bottom_right211bgcolor=color.new(color.black60), border_color=color.new(color.gray80), border_width=1)
    f_col(val) => close val #00e676 : close < val ? #ff1744 : color.silver

    if barstate.islast
        table
    .cell(terminal00"KKM MICRO SNIPER PRO"text_color=color.graytext_size=size.smallbgcolor=color.new(color.black40))
        
    table.merge_cells(terminal0010)
        
        
    string entryState activeSide == " (AKTέF/AL)" activeSide == -" (AKTέF/SAT)" " (KAPALI)"
        
    string entryStr not na(entryPrice) ? str.tostring(math.round(entryPrice2)) + entryState "BEKLENέYOR"
        
    color entryCol activeSide == #00e676 : activeSide == -1 ? #ff1744 : color.silver
        
        
    table.cell(terminal01"SON GέRέή"text_color=color.whitetext_size=size.small)
        
    table.cell(terminal11entryStrtext_color=entryColtext_size=size.small)
        
        
    float stopAvg = (y1 y3) / 2
        table
    .cell(terminal02"STOP (1m+3m)"text_color=color.whitetext_size=size.small)
        
    table.cell(terminal12str.tostring(math.round(stopAvg2)), text_color=color.orangetext_size=size.small)

        
    table.cell(terminal03"1m Yφrόk"text_color=color.whitetext_size=size.small)
        
    table.cell(terminal13str.tostring(math.round(y12)), text_color=f_col(y1), text_size=size.small)
        
    table.cell(terminal04"3m Yφrόk"text_color=color.whitetext_size=size.small)
        
    table.cell(terminal14str.tostring(math.round(y32)), text_color=f_col(y3), text_size=size.small)
        
    table.cell(terminal05"5m Yφrόk"text_color=color.whitetext_size=size.small)
        
    table.cell(terminal15str.tostring(math.round(y52)), text_color=f_col(y5), text_size=size.small)
        
    table.cell(terminal06"15m Yφrόk"text_color=color.whitetext_size=size.small)
        
    table.cell(terminal16str.tostring(math.round(y152)), text_color=f_col(y15), text_size=size.small)
        
    table.cell(terminal07"60m Yφrόk"text_color=color.whitetext_size=size.small)
        
    table.cell(terminal17str.tostring(math.round(y602)), text_color=f_col(y60), text_size=size.small)
        
    table.cell(terminal08"4S Yφrόk"text_color=color.whitetext_size=size.small)
        
    table.cell(terminal18str.tostring(math.round(y2402)), text_color=f_col(y240), text_size=size.small)
        
    table.cell(terminal09"1G Yφrόk"text_color=color.whitetext_size=size.small)
        
    table.cell(terminal19str.tostring(math.round(yD2)), text_color=f_col(yD), text_size=size.small)

        
    table.cell(terminal010"YTD"text_color=color.graytext_size=size.tiny)
        
    table.merge_cells(terminal010110)
    //////////////

    // ─────────────────────────────────────────────────────────────────
    //  1. TEK KAYNAK DNA'SI VE GέRDέLER
    // ─────────────────────────────────────────────────────────────────
    k_start input.float(0.0,  "Kaynak Baώlangύη"step=0.01)
    k_inc   input.float(0.02"Kaynak έvme"step=0.01)
    k_max   input.float(0.20"Kaynak Max"step=0.01)

    grp_vol "έstatistiksel Hedef (Sigma)"
    volLength   input.int(20,  "Oynaklύk Uzunluπu"minval 5)
    projBars    input.int(5,   "έleriye Projeksiyon (Yakύnlύk)"minval 1
    barsPerYear input.int(50,  "Yύllύk Mum Ηarpanύ"minval 50)

    // ─────────────────────────────────────────────────────────────────
    //  2. OTONOM BEYέN (FIBONACCI YAήLANMA VE ΗARPIήMA MOTORU)
    // ─────────────────────────────────────────────────────────────────
    type SARState
        float sar_value
        float extreme_point
        float accel_factor
        bool  isLong
        int   trend_age 
        int   bounce_count 
        bool  was_touching 

    method f_updateState
    (SARState statefloat high_valfloat low_valfloat close_valfloat accel_startfloat accel_incfloat accel_maxfloat decay_limitfloat atr_val) =>
        
    bool isInitialTrend false
        bool trend_changed 
    false

        
    if na(state.sar_value)
            if 
    close_val close_val[1]
                
    state.isLong        := true
                state
    .extreme_point := high_val
                state
    .sar_value     := low_val[1]
            else
                
    state.isLong        := false
                state
    .extreme_point := low_val
                state
    .sar_value     := high_val[1]
            
    isInitialTrend          := true
            state
    .accel_factor      := accel_start
            state
    .trend_age         := 0
        
    else
            
    state.trend_age += 1
            
        state
    .sar_value += state.accel_factor * (state.extreme_point state.sar_value)
        
        if 
    state.isLong
            
    if state.sar_value low_val
                isInitialTrend      
    := true
                trend_changed       
    := true
                state
    .isLong        := false
                state
    .sar_value     := math.max(high_valstate.extreme_point)
                
    state.extreme_point := low_val
                state
    .accel_factor  := accel_start
                state
    .trend_age     := 
        
    else
            if 
    state.sar_value high_val
                isInitialTrend      
    := true
                trend_changed       
    := true
                state
    .isLong        := true
                state
    .sar_value     := math.min(low_valstate.extreme_point)
                
    state.extreme_point := high_val
                state
    .accel_factor  := accel_start
                state
    .trend_age     := 
                
        
    if trend_changed
            state
    .bounce_count := 
            state
    .was_touching := false
        
    else
            
    float tol atr_val 0.2 
            bool is_touch 
    state.isLong ? (low_val <= state.sar_value tol) : (high_val >= state.sar_value tol)
            if 
    is_touch and not state.was_touching
                state
    .bounce_count += 
            state
    .was_touching := is_touch

        float decay_factor 
    math.max(0.011.0 - (state.trend_age decay_limit))
        
    float yasli_inc    accel_inc decay_factor

        
    if not isInitialTrend
            
    if state.isLong
                
    if high_val state.extreme_point
                    state
    .extreme_point := high_val
                    state
    .accel_factor  := math.min(state.accel_factor yasli_incaccel_max)
            else
                if 
    low_val state.extreme_point
                    state
    .extreme_point := low_val
                    state
    .accel_factor  := math.min(state.accel_factor yasli_incaccel_max)
                    
        if 
    bar_index 1
            
    if state.isLong
                state
    .sar_value := math.min(state.sar_valuelow_val[1])
                if 
    bar_index 2
                    state
    .sar_value := math.min(state.sar_valuelow_val[2])
            else
                
    state.sar_value := math.max(state.sar_valuehigh_val[1])
                if 
    bar_index 2
                    state
    .sar_value := math.max(state.sar_valuehigh_val[2])
        
    state

    // ─────────────────────────────────────────────────────────────────
    //  3. 9 PARALEL EVRENέN YARATILIήI VE KRAL SEΗέMέ
    // ─────────────────────────────────────────────────────────────────
    var float[] fibs = array.from(1.02.03.05.08.013.021.034.055.0)
    var 
    states = array.new<SARState>()

    if 
    barstate.isfirst
        
    for 0 to 8
            states
    .push(SARState.new(nanak_startfalse00false))

    float gercek_oynaklik ta.atr(14)

    for 
    0 to 8
        SARState s 
    states.get(i)
        
    s.f_updateState(highlowclosek_startk_inck_maxfibs.get(i), gercek_oynaklik)

    var 
    int king_idx 
    int new_king 
    = -1

    for 0 to 8
        
    if states.get(i).bounce_count >= 2
            new_king 
    := i
            
    break 

    if 
    new_king != -1
        king_idx 
    := new_king 

    float kral_sar 
    states.get(king_idx).sar_value
    bool  kral_yon 
    states.get(king_idx).isLong
    float kral_ayna
    close + (close kral_sar)

    // ─────────────────────────────────────────────────────────────────
    //  4. KRALIN HAFIZASI (DέNAMέK KANALLAR)
    // ─────────────────────────────────────────────────────────────────
    var float channel_support na
    var float channel_resist  na

    bool king_long_break  
    ta.crossover(closekral_sar)
    bool king_short_break ta.crossunder(closekral_sar)

    if 
    king_long_break
        channel_support 
    := kral_sar 
    if king_short_break
        channel_resist 
    := kral_sar 

    // ─────────────────────────────────────────────────────────────────
    //  5. ANA YΦN SέNYALLERέ VE REFERANS (YΦRάK)
    // ─────────────────────────────────────────────────────────────────
    bool al_sinyali  kral_yon and not kral_yon[1]
    bool sat_sinyali not kral_yon and kral_yon[1]

    cc ta.sar(0.00.010.3

    color col_kral kral_yon color.new(color.lime0) : color.new(color.red0)
    color col_ayna kral_yon color.new(color.lime50) : color.new(color.red50)


    p_sup plot(channel_supporttitle="Destek (Long Stop)"color=color.new(color.green20), style=plot.style_linebrlinewidth=2)
    p_res plot(channel_resist,  title="Direnη (Short Stop)"color=color.new(color.red20), style=plot.style_linebrlinewidth=2)
    fill(p_supp_rescolor=color.new(color.gray70), title="Dinamik Trade Kanalύ")

    // ─────────────────────────────────────────────────────────────────
    //  6. MULTI-TIMEFRAME (MTF) GΦSTERGE PANeli (DASHBOARD)
    // ─────────────────────────────────────────────────────────────────
    // HATA BURADAYDI: lookahead_ignore yerine lookahead_off kullanύldύ.
    [s_5ma_5mc_sup_5mc_res_5my_5myon_5m] = request.security(syminfo.tickerid"5",  [kral_sarkral_aynachannel_supportchannel_resistcckral_yon], lookahead=barmerge.lookahead_off)
    [
    s_1ha_1hc_sup_1hc_res_1hy_1hyon_1h] = request.security(syminfo.tickerid"60", [kral_sarkral_aynachannel_supportchannel_resistcckral_yon], lookahead=barmerge.lookahead_off)
    [
    s_1da_1dc_sup_1dc_res_1dy_1dyon_1d] = request.security(syminfo.tickerid"D",  [kral_sarkral_aynachannel_supportchannel_resistcckral_yon], lookahead=barmerge.lookahead_off)

    f_konum_haritasi(float sar_vfloat ayna_vfloat sup_vfloat res_vfloat yoruk_v) =>
        
    float v_min math.min(nz(sar_vclose), nz(ayna_vclose), nz(sup_vclose), nz(res_vclose), nz(yoruk_vclose))
        
    float v_max math.max(nz(sar_vclose), nz(ayna_vclose), nz(sup_vclose), nz(res_vclose), nz(yoruk_vclose))
        
    float aralik math.max(v_max v_min0.0001)

        
    int p_s int(math.round(10 * (nz(sar_vclose) - v_min) / aralik))
        
    int p_a int(math.round(10 * (nz(ayna_vclose) - v_min) / aralik))
        
    int p_y int(math.round(10 * (nz(yoruk_vclose) - v_min) / aralik))

        
    string harita ""
        
    for 0 to 10
            
    if == p_y
                harita 
    += "⚪"
            
    else if == p_s
                harita 
    += "🟣"
            
    else if == p_a
                harita 
    += "🔶"
            
    else
                
    harita += "▬"
        
    harita

    var table dash table.new(position.top_right84border_width=1border_color=color.grayframe_color=color.grayframe_width=1)

    f_satir_doldur(int rowstring tffloat sfloat afloat supfloat resfloat ybool yon) =>
        
    color c_yon yon color.new(color.lime70) : color.new(color.red70)
        
    string t_yon yon "AL" "SAT"
        
        
    table.cell(dash0rowtfbgcolor=color.new(color.gray80), text_color=color.whitetext_size=size.small)
        
    table.cell(dash1rowt_yonbgcolor=c_yontext_color=color.whitetext_size=size.small)
        
    table.cell(dash2rowstr.tostring(aformat.mintick), bgcolor=c_yontext_color=color.whitetext_size=size.small)
        
    table.cell(dash3rowstr.tostring(sformat.mintick), bgcolor=c_yontext_color=color.whitetext_size=size.small)
        
    table.cell(dash4rowstr.tostring(supformat.mintick), bgcolor=color.new(color.green80), text_color=color.whitetext_size=size.small)
        
    table.cell(dash5rowstr.tostring(resformat.mintick), bgcolor=color.new(color.red80), text_color=color.whitetext_size=size.small)
        
    table.cell(dash6rowstr.tostring(yformat.mintick), bgcolor=color.new(color.gray80), text_color=color.whitetext_size=size.small)
        
    table.cell(dash7rowf_konum_haritasi(sasupresy), bgcolor=color.new(color.black60), text_color=color.whitetext_size=size.small)

    if 
    barstate.islast
        table
    .cell(dash00"Zaman",  bgcolor=color.new(color.navy10), text_color=color.whitetext_size=size.small)
        
    table.cell(dash10"Durum",  bgcolor=color.new(color.navy10), text_color=color.whitetext_size=size.small)
        
    table.cell(dash20"Ayna🔶"bgcolor=color.new(color.navy10), text_color=color.whitetext_size=size.small)
        
    table.cell(dash30"SAR🟣",  bgcolor=color.new(color.navy10), text_color=color.whitetext_size=size.small)
        
    table.cell(dash40"Destek"bgcolor=color.new(color.navy10), text_color=color.whitetext_size=size.small)
        
    table.cell(dash50"Direnη"bgcolor=color.new(color.navy10), text_color=color.whitetext_size=size.small)
        
    table.cell(dash60"Yφrόk⚪"bgcolor=color.new(color.navy10), text_color=color.whitetext_size=size.small)
        
    table.cell(dash70"Konum Radarύ"bgcolor=color.new(color.navy10), text_color=color.whitetext_size=size.small)

        
    f_satir_doldur(1"5Dak"s_5ma_5mc_sup_5mc_res_5my_5myon_5m)
        
    f_satir_doldur(2"1Saat"s_1ha_1hc_sup_1hc_res_1hy_1hyon_1h)
        
    f_satir_doldur(3"1Gόn"s_1da_1dc_sup_1dc_res_1dy_1dyon_1d)

    // ─────────────────────────────────────────────────────────────────
    //  7. έSTATέSTέKSEL VOLATέLέTE (%68)
    // ─────────────────────────────────────────────────────────────────
    logReturn math.log(close close[1])
    rawVol    ta.stdev(logReturnvolLength)
    annualVol rawVol math.sqrt(barsPerYear)

    conePrice(float basePricefloat volint tfloat sigmaMultiplierint direction) =>
        
    drift direction sigmaMultiplier vol math.sqrt(float(t) / float(barsPerYear))
        
    basePrice math.exp(drift)

    var 
    label[] sigmaLabels = array.new<label>()

    if 
    barstate.islast
        
    if sigmaLabels.size() > 0
            
    for 0 to sigmaLabels.size() - 1
                label
    .delete(sigmaLabels.get(i))
            
    sigmaLabels.clear()

        
    float tip1up conePrice(closeannualVolprojBars1.0,  1)
        
    float tip1dn conePrice(closeannualVolprojBars1.0, -1)
        
    int tipX bar_index projBars 

        
    if kral_yon
            sigmaLabels
    .push(label.new(tipXtip1up"(YTD)\n" str.tostring(tip1upformat.mintick), color=color.new(color.lime80), textcolor=color.limestyle=label.style_label_leftsize=size.small))
        else
            
    sigmaLabels.push(label.new(tipXtip1dn"(YTD)\n" str.tostring(tip1dnformat.mintick), color=color.new(color.red80), textcolor=color.redstyle=label.style_label_leftsize=size.small))

    ////
    // έMZA
    var table ytd_table table.new(position.bottom_center11)
    if 
    barstate.islast
        table
    .cell(ytd_table00"(Aέ, (Gemini Pro) ile tasarlanmύώ OTONOM grafik, Eπitim ηalύώmasύdύr.) Yatύrύm tavsiyesi olarak KULLANILAMAZ."text_color=color.new(color.white00), text_size=size.normal)
    /////////////////
    // 3. MOTOR: 3'Lά SAR ΗAKIήMASI (YAKIN TAKέP ELMAS TETέK)
    // ─────────────────────────────────────────────────────────────────
    // Fiyatύ ensesinden takip eden 3 hiper-aktif SAR (Step ve Max deπerleri yόkseltildi)
    roSar1 ta.sar(0.030.0030.3// Hύzlύ Avcύ
    roSar2 ta.sar(0.050.0050.5// Yakύn Gφlge
    roSar3 ta.sar(0.100.0101.0// Vakum (Fiyata yapύώύk)

    // Kuantum Tolerans Motoru
    isEq(v1v2) => math.abs(v1 v2) <= syminfo.mintick
    isEq3
    (v1v2v3) => isEq(v1v2) and isEq(v1v3)

    // Sadece bu 3 SAR'ύn aynύ anda όst όste binme (ηakύώma) durumu
    all3Match isEq3(roSar1roSar2roSar3)

    float matchVal all3Match roSar1 na

    trigger 
    all3Match and not all3Match[1]
    isSupport close matchVal
    diamondColor 
    isSupport color.rgb(023011820) : color.rgb(255236820)

    plotshape(trigger matchVal na"3'lό SAR Elmasύ"shape.diamondlocation.absolutecolor=diamondColorsize=size.smalldisplay=display.pane)
    ///////////////
    // ─────────────────────────────────────────────────────────────────
    // 1. ASYMMETRIC TREND ENGINE (GΦRάNMEZ HESAPLAYICI)
    // ─────────────────────────────────────────────────────────────────
    // Komutan Talimatύ: hl2 Kaynak, 30 Lookback, 3.5 Mult
    float asy_src        hl2
    int   asy_lookback   
    180
    float asy_mult       
    3.5

    float asy_vol_threshold 
    ta.stdev(asy_srcasy_lookback) * asy_mult

    var float asy_trend_line na
    var int   asy_trend_dir  0
    var int   asy_prev_dir   0

    if na(asy_trend_line)
        
    asy_trend_line := asy_src
    else
        
    asy_prev_dir := asy_trend_dir
        
    if asy_trend_dir >= 0
            
    if asy_src asy_trend_line asy_vol_threshold 0.5
                asy_trend_line 
    := math.max(asy_trend_lineasy_src asy_vol_threshold 0.25)
                
    asy_trend_dir  := 1
            
    else if asy_src asy_trend_line asy_vol_threshold
                asy_trend_line 
    := asy_src asy_vol_threshold 0.25
                asy_trend_dir  
    := -1
        
    else
            if 
    asy_src asy_trend_line asy_vol_threshold 0.5
                asy_trend_line 
    := math.min(asy_trend_lineasy_src asy_vol_threshold 0.25)
                
    asy_trend_dir  := -1
            
    else if asy_src asy_trend_line asy_vol_threshold
                asy_trend_line 
    := asy_src asy_vol_threshold 0.25
                asy_trend_dir  
    := 1

    // Dφnόώ Teyitleri
    bool turned_bullish asy_trend_dir == 1  and asy_trend_dir[1] == -1
    bool turned_bearish 
    asy_trend_dir == -and asy_trend_dir[1] == 1
    bool is_reversal    
    asy_trend_dir != asy_prev_dir and bar_index 0

    // ─────────────────────────────────────────────────────────────────


    // ─────────────────────────────────────────────────────────────────
    // 3. SAF QUANT GΦRSELLEήTέRME (SADECE DΦNάήLER)
    // ─────────────────────────────────────────────────────────────────
    // Trend ηizgisi plot edilmiyor, sadece dφnόώ anύnda hedef belirleniyor
    color rev_color asy_trend_dir == #00ffaa48 : #ff00003c

    // Reversal Noktasύ: Sadece trend yφn deπiώtirdiπinde o barύn altύna/όstόne '⦿' koyar
    plotchar(is_reversal ? (asy_trend_dir == low high) : na
             
    "KKM Reversal""⦿"location location.absolute
             
    color rev_colorsize size.huge)

    // //////
    // 0. MERKEZέ FONKSέYONLAR (Sύfύr Gecikme Motoru)
    // ─────────────────────────────────────────────────────────────────
    f_zlema(series float srcsimple int len) =>
        
    float ema1 ta.ema(srclen)
        
    float ema2 ta.ema(ema1len)
        
    ema1 + (ema1 ema2)

    // ─────────────────────────────────────────────────────────────────



    // ─────────────────────────────────────────────────────────────────
    // 1. DέNAMέK YOΠUNLUK MOTORU (Zamanύ Deπil, Maddeyi Φlηer)
    // ─────────────────────────────────────────────────────────────────
    // Bu motor aynύ 1m verisini alύr ama ona farklύ kutle direnηleri uygular.
    f_kutu_kutle(int _atrLenfloat _atrMultfloat _mu) =>
        
    float threshold ta.atr(_atrLen) * _atrMult
        
    var float z na
        
    var float v 0.0
        
    if bar_index == 0
            z 
    := hl2
        
    else
            
    float zPrev z[1], float vPrev v[1]
            
    float zPred zPrev vPrev
            float zTemp 
    zPred _mu * (hl2 zPred)
            
    float diff zTemp zPrev
            
    if math.abs(diff) > threshold
                v 
    := math.sign(diff) * (math.abs(diff) - threshold)
            else
                
    := 0.0
            z 
    := zPrev v
        z

    // ─────────────────────────────────────────────────────────────────
    // 2. KάTLE MATRέSέ (Camdan Ηeliπe Kurumsal Maliyetler)
    // ─────────────────────────────────────────────────────────────────
    // Aynύ 1 dakikalύk grafikte, merminin (fiyatύn) deleceπi katmanlar:
    float cam   f_kutu_kutle(11.00.05)   // CAM: Ηok kύrύlgan, mermi anύnda deler.

    float celik f_kutu_kutle(1,  0.010.01)  // ΗELέK: Komutanύn Tank Zύrhύ! (Delinmesi en zor)

    // ─────────────────────────────────────────────────────────────────
    // 3. YOΠUNLUK ΗέZέMLERέ (Ekranύ Kirletmeden)
    // ─────────────────────────────────────────────────────────────────
    plot(celik"Ηelik"color=color.new(#d500f9, 0), linewidth=1, style=plot.style_stepline) // Mor

    plot(cam,   "Cam",   color=color.new(#ffeb3b, 0), linewidth=1, style=plot.style_stepline) // Beyaz

    // ─────────────────────────────────────────────────────────────────

    group_motor "Kinetik Zeminler (Trinity)"
    int len_fast input.int(5"Hύzlύ Zemin (Zemin 1)"group=group_motor)
    int len_slow input.int(20"Yavaώ Zemin (Zemin 2)"group=group_motor)

    group_dash "Gφsterge Paneli"
    bool show_dash input.bool(true"Paneli Gφster"group=group_dash)
    string dash_pos input.string("Top Right""Panel Konumu"options=["Top Right""Top Left""Bottom Right""Bottom Left"], group=group_dash)

    group_kin "Renk Paleti"

    col_flat input.color(#787b86, "Flat (Nφtr)", group=group_kin)
    col_eq input.color(#ff9800, "Merkez Pivot (Turuncu Denge)", group=group_kin)

    // ─────────────────────────────────────────────────────────────────
    // 1. MOTOR: L1 KέNETέK FέLTRE (ANA BASELINE)
    // ─────────────────────────────────────────────────────────────────
    float threshold ta.atr(atrLen) * atrMult
    var float z na
    var float v 0.0

    if bar_index == 0
        z 
    := close
    else
        
    float zPrev z[1], float vPrev v[1]
        
    float zPred zPrev vPrev
        float zTemp 
    zPred mu * (close zPred)
        
    float diff zTemp zPrev
        
    if math.abs(diff) > threshold
            v 
    := math.sign(diff) * (math.abs(diff) - threshold)
        else
            
    := 0.0
        z 
    := zPrev v

    //plot(z, "0", color=color.new(color.fuchsia, 0), linewidth=1, style=plot.style_stepline)

    // ─────────────────────────────────────────────────────────────────
    // 2. MOTOR: TRINITY ZEMέNLER (5 - 20)
    // ─────────────────────────────────────────────────────────────────
    float fast_floor ta.hma(zlen_fast)
    float slow_floor ta.hma(zlen_slow)

    //p_fast = plot(fast_floor, color=color.rgb(223, 64, 251, 100), linewidth=1, title="1")
    //p_slow = plot(slow_floor, color=color.new(color.fuchsia, 100), linewidth=1, title="2")

    // Kinetik Bulut
    bool is_bull fast_floor slow_floor
    //fill(p_fast, p_slow, is_bull ? color.new(col_up, 85) : color.new(col_dn, 85), title="Kinetik Bulut")



    // ─────────────────────────────────────────────────────────────────
    // 3. ANALέZ: άΗLά KAVUήUM (YάZEN PέVOT AΠI) VE SέNYAL TAKέBέ
    // ─────────────────────────────────────────────────────────────────
    isEq55(v1v2) => math.abs(v1 v2) <= syminfo.mintick
    bool trinity_aligned 
    isEq55(zfast_floor) and isEq55(zslow_floor)

    var 
    float last_eq_val na
    var float last_eq_step na

    // Ηizgi ve Etiket Deπiώkenleri
    var line line_p na,  var label lbl_p na
    var line line_r1 na, var label lbl_r1 na
    var line line_r2 na, var label lbl_r2 na
    var line line_r3 na, var label lbl_r3 na
    var line line_s1 na, var label lbl_s1 na
    var line line_s2 na, var label lbl_s2 na
    var line line_s3 na, var label lbl_s3 na

    if trinity_aligned
        last_eq_val 
    := z
        last_eq_step 
    := threshold // L1'in kendi gόrόltό duvarύ mesafesi

    // Kavuώum (Denge) deπeri varsa, yόzen aπύ her an gόncelle
    if not na(last_eq_val)
        
    int ext 10 // Ηizgilerin uzayacaπύ bar sayύsύ
        
        
    float val_p  last_eq_val
        float val_r1 
    last_eq_val last_eq_step 1
        float val_r2 
    last_eq_val last_eq_step 2
        float val_r3 
    last_eq_val last_eq_step 3
        float val_s1 
    last_eq_val last_eq_step 1
        float val_s2 
    last_eq_val last_eq_step 2
        float val_s3 
    last_eq_val last_eq_step 3

        
    if na(line_p)
            
    // Ηizgiler
            
    line_p  := line.new(bar_indexval_p,  bar_index extval_p,  color=col_eqwidth=2style=line.style_dotted)
            
    line_r1 := line.new(bar_indexval_r1bar_index extval_r1color=color.new(col_dn30), width=1style=line.style_dotted)
            
    line_r2 := line.new(bar_indexval_r2bar_index extval_r2color=color.new(col_dn30), width=1style=line.style_dotted)
            
    line_r3 := line.new(bar_indexval_r3bar_index extval_r3color=color.new(col_dn30), width=1style=line.style_dotted)
            
    line_s1 := line.new(bar_indexval_s1bar_index extval_s1color=color.new(col_up30), width=1style=line.style_dotted)
            
    line_s2 := line.new(bar_indexval_s2bar_index extval_s2color=color.new(col_up30), width=1style=line.style_dotted)
            
    line_s3 := line.new(bar_indexval_s3bar_index extval_s3color=color.new(col_up30), width=1style=line.style_dotted)
            
            
    // Etiketler
            
    lbl_p  := label.new(bar_index extval_p,  "P: " str.tostring(val_pformat.mintick),  color=color.new(color.white100), textcolor=col_eqstyle=label.style_label_leftsize=size.normal)
            
    lbl_r1 := label.new(bar_index extval_r1"R1: " str.tostring(val_r1format.mintick), color=color.new(color.white100), textcolor=col_dnstyle=label.style_label_leftsize=size.normal)
            
    lbl_r2 := label.new(bar_index extval_r2"R2: " str.tostring(val_r2format.mintick), color=color.new(color.white100), textcolor=col_dnstyle=label.style_label_leftsize=size.normal)
            
    lbl_r3 := label.new(bar_index extval_r3"R3: " str.tostring(val_r3format.mintick), color=color.new(color.white100), textcolor=col_dnstyle=label.style_label_leftsize=size.normal)
            
    lbl_s1 := label.new(bar_index extval_s1"S1: " str.tostring(val_s1format.mintick), color=color.new(color.white100), textcolor=col_upstyle=label.style_label_leftsize=size.normal)
            
    lbl_s2 := label.new(bar_index extval_s2"S2: " str.tostring(val_s2format.mintick), color=color.new(color.white100), textcolor=col_upstyle=label.style_label_leftsize=size.normal)
            
    lbl_s3 := label.new(bar_index extval_s3"S3: " str.tostring(val_s3format.mintick), color=color.new(color.white100), textcolor=col_upstyle=label.style_label_leftsize=size.normal)
        else
            
    // Aπύ ve etiketleri her bar saπa kaydύr
            
    line.set_xy1(line_p,  bar_indexval_p),  line.set_xy2(line_p,  bar_index extval_p)
            
    line.set_xy1(line_r1bar_indexval_r1), line.set_xy2(line_r1bar_index extval_r1)
            
    line.set_xy1(line_r2bar_indexval_r2), line.set_xy2(line_r2bar_index extval_r2)
            
    line.set_xy1(line_r3bar_indexval_r3), line.set_xy2(line_r3bar_index extval_r3)
            
    line.set_xy1(line_s1bar_indexval_s1), line.set_xy2(line_s1bar_index extval_s1)
            
    line.set_xy1(line_s2bar_indexval_s2), line.set_xy2(line_s2bar_index extval_s2)
            
    line.set_xy1(line_s3bar_indexval_s3), line.set_xy2(line_s3bar_index extval_s3)
            
            
    label.set_xy(lbl_p,  bar_index extval_p),  label.set_text(lbl_p,  "P: " str.tostring(val_pformat.mintick))
            
    label.set_xy(lbl_r1bar_index extval_r1), label.set_text(lbl_r1"R1: " str.tostring(val_r1format.mintick))
            
    label.set_xy(lbl_r2bar_index extval_r2), label.set_text(lbl_r2"R2: " str.tostring(val_r2format.mintick))
            
    label.set_xy(lbl_r3bar_index extval_r3), label.set_text(lbl_r3"R3: " str.tostring(val_r3format.mintick))
            
    label.set_xy(lbl_s1bar_index extval_s1), label.set_text(lbl_s1"S1: " str.tostring(val_s1format.mintick))
            
    label.set_xy(lbl_s2bar_index extval_s2), label.set_text(lbl_s2"S2: " str.tostring(val_s2format.mintick))
            
    label.set_xy(lbl_s3bar_index extval_s3), label.set_text(lbl_s3"S3: " str.tostring(val_s3format.mintick))

    // Sinyal Takibi (L1 Yφn Deπiώimi)
    var int trendL1 0
    if z[1]
        
    trendL1 := 1
    else if z[1]
        
    trendL1 := -1

    var string last_sig_type "-"
    var float last_sig_price na

    if ta.change(trendL1) != 0
        last_sig_type 
    := trendL1 == "AL" "SAT"
        
    last_sig_price := close

    // ─────────────────────────────────────────────────────────────────
    // 4. GΦRSEL TERMέNAL (DASHBOARD)
    // ─────────────────────────────────────────────────────────────────
    var pos dash_pos == "Top Right" position.bottom_left dash_pos == "Top Left" position.top_left dash_pos == "Bottom Right" position.bottom_right position.bottom_left
    var table dash55 table.new(pos27bgcolor=color.new(#131722, 10), border_width=1, border_color=color.new(#363a45, 50), frame_color=color.new(#363a45, 50), frame_width=1)

    if show_dash and barstate.islast
        
    // Baώlύk
        
    table.cell(dash5500"@yφrόk@ 2026 Gemini Pro Eπitim Ηalύώmasύdύr."bgcolor=color.new(#2962ff, 50), text_color=color.white, text_size=size.normal, text_halign=text.align_center)
        
    table.merge_cells(dash550010)
        
        
    // Deπerler
        
    table.cell(dash5501"Fiyat"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5511str.tostring(closeformat.mintick), text_color=color.whitetext_size=size.normal)
        
        
    table.cell(dash5502"0"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5512str.tostring(zformat.mintick), text_color=color.silvertext_size=size.normal)
        
        
    table.cell(dash5503"(1) | (2)"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5513str.tostring(fast_floorformat.mintick) + " | " str.tostring(slow_floorformat.mintick), text_color=color.aquatext_size=size.normal)
        
        
    // άηlό Kavuώum (Denge Noktasύ)
        
    table.cell(dash5504"(Denge)"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5514na(last_eq_val) ? "-" str.tostring(last_eq_valformat.mintick), text_color=col_eqtext_size=size.normal)
        
        
    // Son Sinyal
        
    color sig_col last_sig_type == "AL" col_up last_sig_type == "SAT" col_dn color.gray
        table
    .cell(dash5505"Son Sinyal"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5515last_sig_type " (" str.tostring(last_sig_priceformat.mintick) + ")"text_color=sig_coltext_size=size.normal)

        
    // Alt Bilgi
        
    table.cell(dash5506" Yatύrύm tavsiyesi DEΠέLDέR."text_color=color.new(color.white0), text_size=size.normal)
        
    table.merge_cells(dash550616)
    ///////////////////////////
    group_pt "Gόvenli Bφlge (8-34 PT Filtresi)"
    bool show_pt_bg input.bool(true"Yeώil Arka Planύ Gφster"group=group_pt)
    int pt_ema_len input.int(21"PT Hύzlύ (EMA)"group=group_pt)
    int pt_sma_len input.int(89"PT Yavaώ (SMA)"group=group_pt)

    // ─────────────────────────────────────────────────────────────────
    // 4. MOTOR: GάVENLέ BΦLGE (8-34 POWER TREND FέLTRESέ)
    // ─────────────────────────────────────────────────────────────────
    float emaPT ta.ema(closept_ema_len), float smaPT ta.sma(closept_sma_len)
    var 
    int cL 0
    cL 
    := (low emaPT) ? nz(cL[1]) + 0
    var bool ptOn false
    ptOn 
    := ta.crossunder(emaPTsmaPT) ? false : (cL >= and emaPT smaPT true ptOn)
    bgcolor(show_pt_bg and ptOn color.new(color.gray68) : natitle="Gόvenli Bφlge Arka Planύ")
    ////////////////////////////////////

    color col_cloud_up1 color.new(#00e676, 0)
    color col_cloud_dn1 color.new(#ff1744, 0)

    group_ayna "Makro Duvarlar (Yin-Yang Ayna)"
    float h_start input.float(0.06"Hύzlύ SAR Baώlangύη"step=0.01group=group_ayna)
    float h_inc   input.float(0.06"Hύzlύ SAR έvme"step=0.01group=group_ayna)
    float h_max   input.float(0.30"Hύzlύ SAR Max"step=0.1group=group_ayna)
    int pivot_len input.int(10"Duvar Tespiti (Pivot Uzunluπu)"group=group_ayna)


    // ─────────────────────────────────────────────────────────────────
    // 5. MOTOR: YέN-YANG AYNASI VE MAKRO DUVARLAR
    // ─────────────────────────────────────────────────────────────────
    f_ozel_sar(src_hsrc_l_start_inc_max_reset_hiz) =>
        var 
    int trend 0
        
    var float sar_val 0.0
        
    var float ep 0.0
        
    var float af 0.0
        
    if trend == and not na(src_h[1])
            
    trend   := src_h >= src_h[1] or src_l >= src_l[1] ? : -1
            sar_val 
    := trend src_l[1] : src_h[1]
            
    ep      := trend src_h[1] : src_l[1]
            
    af      := _start
        
    else 
            if 
    _reset_hiz
                af 
    := _start
            float nextsar 
    sar_val
            
    if trend 0
                
    if src_h[1] > ep
                    ep 
    := src_h[1]
                    
    af := math.min(_maxaf _inc)
                
    nextsar := sar_val af * (ep sar_val)
                
    nextsar := math.min(math.min(src_l[1], src_l[2]), nextsar)
                if 
    nextsar src_l
                    trend   
    := -1
                    nextsar 
    := ep
                    ep      
    := src_l
                    af      
    := _start
            
    else 
                if 
    src_l[1] < ep
                    ep 
    := src_l[1]
                    
    af := math.min(_maxaf _inc)
                
    nextsar := sar_val af * (ep sar_val)
                
    nextsar := math.max(math.max(src_h[1], src_h[2]), nextsar)
                if 
    nextsar src_h
                    trend   
    := 1
                    nextsar 
    := ep
                    ep      
    := src_h
                    af      
    := _start
            sar_val 
    := nextsar
        
    [sar_valtrend]

    bool yeni_gun ta.change(time("W")) != 0
    [sar_hizlitrend_hizli] = f_ozel_sar(highlowh_starth_inch_maxyeni_gun)

    float ayna_hizli trend_hizli close math.abs(close sar_hizli) : close math.abs(close sar_hizli)

    float ph_ayna ta.pivothigh(ayna_hizlipivot_lenpivot_len)
    float pl_ayna ta.pivotlow(ayna_hizlipivot_lenpivot_len)

    var array<
    linemacro_up_walls = array.new<line>()
    var array<
    linemacro_dn_walls = array.new<line>()

    // ZARέF DOKUNUή: style=line.style_dotted olarak deπiώtirildi
    if not na(ph_ayna)
        
    line w_up line.new(bar_index[pivot_len], ph_aynabar_indexph_aynacolor=col_cloud_up1width=1style=line.style_dottedextend=extend.right)
        array.
    push(macro_up_wallsw_up)
        if array.
    size(macro_up_walls) > 2
            line
    .delete(array.shift(macro_up_walls))

    if 
    not na(pl_ayna)
        
    line w_dn line.new(bar_index[pivot_len], pl_aynabar_indexpl_aynacolor=col_cloud_dn1width=1style=line.style_dottedextend=extend.right)
        array.
    push(macro_dn_wallsw_dn)
        if array.
    size(macro_dn_walls) > 2
            line
    .delete(array.shift(macro_dn_walls))

    plot(ayna_hizli"Ayna"color=color.new(color.gray100), linewidth=1display=display.pane)

    // ─────────────────────────────────────────────────────────────────

    grp_pos "PENCERE VE BOYUT AYARLARI"
    i_bars    input.int(50,    "Gφsterilecek Mum Sayύsύ"group=grp_posminval=10)
    i_width   input.int(100,   "Pencere Geniώliπi (Bar)"group=grp_posminval=20)
    i_offset  input.int(10,    "Yatay Uzaklύk (Saπa)",    group=grp_pos)
    i_vScale  input.float(35.0"Dikey Φlηekleme (%)",    group=grp_posstep=1.0)

    grp_style "RENKLER VE GΦRSELLέK"
    c_up      input.color(color.new(#00e676, 0), "Yόkseliώ Mumu", group=grp_style)
    c_down    input.color(color.new(#ff1744, 0), "Dόώόώ Mumu",    group=grp_style)
    c_bg      input.color(color.new(#0b0e14, 20), "Arka Plan Kutusu",group=grp_style)
    c_border  input.color(color.new(#ffffff, 80), "Pencere Ηerηevesi",group=grp_style)

    c_fillUp  input.color(color.new(#26a69a, 60), "Bulut (Yόkseliώ)", group=grp_style)
    c_fillDn  input.color(color.new(#ef5350, 60), "Bulut (Dόώόώ)",    group=grp_style)
    c_fillRng input.color(color.new(#888888, 60), "Bulut (Yatay)",     group=grp_style)

    // ========================================================================= //
    // ================== ICS 21 MATEMATέΠέ (YERLEήέK HESAPLAMA) =============== //
    // ========================================================================= //
    // Dizi (Array) kullanmadan, doπrudan zaman serisi όzerinden ηalύώύr. Ηφkmez.

    f_yz_sigma(len) =>
        
    float _yzOR math.log(open nz(close[1], open))
        
    float _yzCO math.log(close open)
        
    float _yzHO math.log(high open)
        
    float _yzHC math.log(high close)
        
    float _yzLO math.log(low  open)
        
    float _yzLC math.log(low  close)
        
    float _sqOR ta.variance(_yzORlen)
        
    float _sqCO ta.variance(_yzCOlen)
        
    float _sqRS ta.sma(_yzHO _yzHC _yzLO _yzLClen)
        
    float _k    0.34 / (1.34 + (len 1.0) / math.max(len 1.01.0))
        
    float _sq   nz(_sqOR) + _k nz(_sqCO) + (1.0 _k) * nz(_sqRS)
        
    math.max(math.sqrt(math.max(_sq0.0)), 1e-10)

    f_icsLine(p1x1p2x2targetXsig) =>
        
    float out p1
        
    if x1 != x2 and p1 and p2 and sig 1e-10
            float y1 
    math.log(p1) / sig
            float y2 
    math.log(p2) / sig
            float yT 
    y1 + (y2 y1) * (targetX x1) / (x2 x1)
            
    out := math.exp(yT sig)
        
    out

    f_icsAngle
    (p1x1p2x2sig) =>
        
    float out 0.0
        
    if x1 != x2 and p1 and p2 and sig 1e-10
            float y1 
    math.log(p1) / sig
            float y2 
    math.log(p2) / sig
            out 
    := math.atan((y2 y1) / (x2 x1)) * 180.0 math.pi
        out

    f_ics_calc
    () =>
        
    int P 21
        float sig 
    f_yz_sigma(20)
        
        
    float h0 ta.highest(highP), float l0 ta.lowest(lowP)
        
        if 
    bar_index 5
            
    [h0l00.0]
        else
            
    float h1 h0[P],   float l1 l0[P]
            
    float h2 h0[P*2], float l2 l0[P*2]
            
    float h3 h0[P*3], float l3 l0[P*3]
            
    float h4 h0[P*4], float l4 l0[P*4]

            
    float g0 = (h0 and l0 0) ? math.exp((math.log(h0) + math.log(l0)) / 2.0) : na
            float g1 
    = (h1 and l1 0) ? math.exp((math.log(h1) + math.log(l1)) / 2.0) : na
            float g2 
    = (h2 and l2 0) ? math.exp((math.log(h2) + math.log(l2)) / 2.0) : na
            float g3 
    = (h3 and l3 0) ? math.exp((math.log(h3) + math.log(l3)) / 2.0) : na
            float g4 
    = (h4 and l4 0) ? math.exp((math.log(h4) + math.log(l4)) / 2.0) : na

            int pd 
    g0 g1 : -1
            int seg 
    1
            
    if g0 != g1
                
    if (g1 g2 : (g1 g2 ? -0)) == pd
                    seg 
    := 2
                    
    if (g2 g3 : (g2 g3 ? -0)) == pd
                        seg 
    := 3
                        
    if (g3 g4 : (g3 g4 ? -0)) == pd
                            seg 
    := 4

            int cx0 
    int(-P/2), int cx1 cx0 Pint cx2 cx1 Pint cx3 cx2 Pint cx4 cx3 P

            float fHH 
    h0float fLH h0float fHL l0float fLL l0
            int xHH 
    cx0int xLH cx0int xHL cx0int xLL cx0

            
    if seg >= 1
                
    if h1 fHH
                    fHH 
    := h1xHH := cx1
                
    if h1 fLH
                    fLH 
    := h1xLH := cx1
                
    if l1 fHL
                    fHL 
    := l1xHL := cx1
                
    if l1 fLL
                    fLL 
    := l1xLL := cx1
            
    if seg >= 2
                
    if h2 fHH
                    fHH 
    := h2xHH := cx2
                
    if h2 fLH
                    fLH 
    := h2xLH := cx2
                
    if l2 fHL
                    fHL 
    := l2xHL := cx2
                
    if l2 fLL
                    fLL 
    := l2xLL := cx2
            
    if seg >= 3
                
    if h3 fHH
                    fHH 
    := h3xHH := cx3
                
    if h3 fLH
                    fLH 
    := h3xLH := cx3
                
    if l3 fHL
                    fHL 
    := l3xHL := cx3
                
    if l3 fLL
                    fLL 
    := l3xLL := cx3
            
    if seg >= 4
                
    if h4 fHH
                    fHH 
    := h4xHH := cx4
                
    if h4 fLH
                    fLH 
    := h4xLH := cx4
                
    if l4 fHL
                    fHL 
    := l4xHL := cx4
                
    if l4 fLL
                    fLL 
    := l4xLL := cx4

            int sLx 
    seg == cx1 seg == cx2 seg == cx3 cx4
            int sRx 
    cx0

            float endG 
    seg == g1 seg == g2 seg == g3 g4
            float ang 
    f_icsAngle(endGsLxg0sRxsig)

            
    int dir math.abs(ang) <= 0.5 pd

            float uY1 
    fHHfloat uY2 fHHfloat lY1 fLLfloat lY2 fLL
            
    if dir == 1
                uY1 
    := f_icsLine(fLHxLHfHHxHHsLxsig), uY2 := f_icsLine(fLHxLHfHHxHHsRxsig)
                
    lY1 := f_icsLine(fLLxLLfHLxHLsLxsig), lY2 := f_icsLine(fLLxLLfHLxHLsRxsig)
            else if 
    dir == -1
                uY1 
    := f_icsLine(fHHxHHfLHxLHsLxsig), uY2 := f_icsLine(fHHxHHfLHxLHsRxsig)
                
    lY1 := f_icsLine(fHLxHLfLLxLLsLxsig), lY2 := f_icsLine(fHLxHLfLLxLLsRxsig)

            
    float uYa f_icsLine(uY1sLxuY2sRx0sig)
            
    float lYa f_icsLine(lY1sLxlY2sRx0sig)

            [
    uYalYafloat(dir)]

    // O anki mumun bulut deπerlerini global olarak alύyoruz
    [uYalYabulut_yon] = f_ics_calc()

    // ========================================================================= //
    // =========================== ΗέZέM MOTORU (HέYERARήέ) ==================== //
    // ========================================================================= //

    var box[]   kutu_bg     = array.new_box()
    var 
    line[]  cizgi_merkez= array.new_line()
    var 
    box[]   kutu_bulut  = array.new_box()
    var 
    line[]  cizgi_mum   = array.new_line()
    var 
    box[]   kutu_mum    = array.new_box()
    var 
    label[] etiketler   = array.new_label()

    f_temizle() =>
        for 
    b in kutu_bg
            box
    .delete(b)
        for 
    l in cizgi_merkez
            line
    .delete(l)
        for 
    b in kutu_bulut
            box
    .delete(b)
        for 
    l in cizgi_mum
            line
    .delete(l)
        for 
    b in kutu_mum
            box
    .delete(b)
        for 
    lbl in etiketler
            label
    .delete(lbl)
        array.
    clear(kutu_bg), array.clear(cizgi_merkez), array.clear(kutu_bulut)
        array.
    clear(cizgi_mum), array.clear(kutu_mum), array.clear(etiketler)

    if 
    barstate.islast
        f_temizle
    ()
        
        
    // --- 1. ADIM: EKRANIN GENEL MATEMATέΠέ VE SINIRLARI ---
        
    float max_val high
        float min_val 
    low
        
        
    // Son 'i_bars' kadar mumu geηmiώe doπru tarayύp o bφlgenin Max ve Min deπerlerini buluyoruz
        
    for 0 to i_bars 1
            float _h 
    high[i], float _l low[i]
            
    float _u uYa[i],  float _d lYa[i]
            
            
    max_val := math.max(max_val_h)
            
    min_val := math.min(min_val_l)
            if 
    not na(_u)
                
    max_val := math.max(max_val_u), min_val := math.min(min_val_u)
            if 
    not na(_d)
                
    max_val := math.max(max_val_d), min_val := math.min(min_val_d)
                
        
    // Pencereyi nereye ηizeceπiz? Ekranύn mevcut yόksekliπini referans alύyoruz
        
    float hv ta.highest(high300)
        
    float lv ta.lowest(low300)
        
    float cr hv lv == syminfo.mintick 100 hv lv
        float my 
    = (hv lv) / 2
        
        float er 
    cr * (i_vScale 100)
        
    float top_y my er 2
        float bot_y 
    my er 2
        float mid_y 
    = (top_y bot_y) / 2

        int start_x 
    bar_index i_offset
        int end_x   
    start_x i_width
        int mid_x   
    = (start_x end_x) / 2
        
        float hr 
    max_val min_val == syminfo.mintick max_val min_val
        float ir 
    top_y bot_y
        
        
    // Mumlar arasύ geniώlik hesaplamasύ
        
    float bs float(i_width) / i_bars
        int box_w 
    math.max(1int(bs 2))

        
    // --- 2. ADIM: HέYERARήέK ΗέZέM ---
        
        // Hiyerarώi 1: Ana Pencere (Zemin)
        
    array.push(kutu_bgbox.new(start_xtop_yend_xbot_yborder_color=c_borderbgcolor=c_bg))
        
        
    // Hiyerarώi 2: Merkez Denge Ηizgisi
        
    array.push(cizgi_merkezline.new(start_xmid_yend_xmid_ycolor=color.graystyle=line.style_dashed))

        
    // Hiyerarώi 3: Alt ve άst Max/Min Etiketleri
        
    array.push(etiketlerlabel.new(mid_xtop_y"Max: " str.tostring(max_valformat.mintick), color=color.new(color.black100), textcolor=color.graystyle=label.style_label_downsize=size.small))
        array.
    push(etiketlerlabel.new(mid_xbot_y"Min: " str.tostring(min_valformat.mintick), color=color.new(color.black100), textcolor=color.graystyle=label.style_label_upsize=size.small))

        
    // Hiyerarώi 4 & 5: Bulutlar (Arkada) ve Mumlar (Φnde)
        
    for 0 to i_bars 1
            int idx 
    i
            
            float _o 
    open[idx], float _h high[idx], float _l low[idx], float _c close[idx]
            
    float _u uYa[idx],  float _d lYa[idx],  float _dir bulut_yon[idx]
            
            
    // Fiyatlarύ mini ekranύn y-koordinatlarύna dφnόώtόrόyoruz
            
    float so bot_y + ((_o min_val) / hr) * ir
            float sh 
    bot_y + ((_h min_val) / hr) * ir
            float sl 
    bot_y + ((_l min_val) / hr) * ir
            float sc 
    bot_y + ((_c min_val) / hr) * ir
            
            int xp 
    end_x int(bs)
            
            
    // A) Φnce Bulutu Ηiz (Arkada kalmasύ iηin ilk bu ηizilir)
            
    if not na(_u) and not na(_d)
                
    float sy_u bot_y + ((_u min_val) / hr) * ir
                float sy_d 
    bot_y + ((_d min_val) / hr) * ir
                color cCloud 
    _dir == c_fillUp _dir == -c_fillDn c_fillRng
                
    array.push(kutu_bulutbox.new(xp box_wsy_uxp box_wsy_dborder_color=nabgcolor=cCloud))
            
            
    // B) Sonra Mumu Ηiz (άste biner)
            
    color col _c >= _o c_up c_down
            
    array.push(cizgi_mumline.new(xpshxpslcolor=col))
            
            
    float box_top math.max(sosc)
            
    float box_bot math.min(sosc)
            if 
    box_top == box_bot
                
    // Mum doji ise ηizgi ηek
                
    array.push(cizgi_mumline.new(xp 1box_topxp 1box_botcolor=colwidth=2))
            else
                
    // Normal mum gφvdesi
                
    array.push(kutu_mumbox.new(xp 1box_topxp 1box_botborder_color=colbgcolor=col)) 
    16.07.2024 - 10.12.2024

  3. PHP Code:
    // © Kinetik Komuta Merkezi [Masterpiece V6.9 - Z-RS Gφreceli Gόη]
    //@version=6

    indicator('Korelasyon'overlay truemax_boxes_count=500max_lines_count=500max_labels_count=50)


    /////////////
    // ========================================================================= //
    // =============================== GέRDέLER ================================ //
    // ========================================================================= //

    grp_pos "PENCERE VE BOYUT AYARLARI"
    i_bars    input.int(50,    "Gφsterilecek Mum Sayύsύ"group=grp_posminval=10)
    i_width   input.int(100,   "Pencere Geniώliπi (Bar)"group=grp_posminval=20)
    i_offset  input.int(10,    "Yatay Uzaklύk (Saπa)",    group=grp_pos)
    i_vScale  input.float(35.0"Dikey Φlηekleme (%)",    group=grp_posstep=1.0)

    grp_style "RENKLER VE GΦRSELLέK"
    c_up      input.color(color.new(#00e676, 0), "Yόkseliώ Mumu", group=grp_style)
    c_down    input.color(color.new(#ff1744, 0), "Dόώόώ Mumu",    group=grp_style)
    c_bg      input.color(color.new(#0b0e14, 20), "Arka Plan Kutusu",group=grp_style)
    c_border  input.color(color.new(#ffffff, 80), "Pencere Ηerηevesi",group=grp_style)

    c_fillUp  input.color(color.new(#26a69a, 60), "Bulut (Yόkseliώ)", group=grp_style)
    c_fillDn  input.color(color.new(#ef5350, 60), "Bulut (Dόώόώ)",    group=grp_style)
    c_fillRng input.color(color.new(#888888, 60), "Bulut (Yatay)",     group=grp_style)

    // ========================================================================= //
    // ================== ICS 21 MATEMATέΠέ (YERLEήέK HESAPLAMA) =============== //
    // ========================================================================= //
    // Dizi (Array) kullanmadan, doπrudan zaman serisi όzerinden ηalύώύr. Ηφkmez.

    f_yz_sigma(len) =>
        
    float _yzOR math.log(open nz(close[1], open))
        
    float _yzCO math.log(close open)
        
    float _yzHO math.log(high open)
        
    float _yzHC math.log(high close)
        
    float _yzLO math.log(low  open)
        
    float _yzLC math.log(low  close)
        
    float _sqOR ta.variance(_yzORlen)
        
    float _sqCO ta.variance(_yzCOlen)
        
    float _sqRS ta.sma(_yzHO _yzHC _yzLO _yzLClen)
        
    float _k    0.34 / (1.34 + (len 1.0) / math.max(len 1.01.0))
        
    float _sq   nz(_sqOR) + _k nz(_sqCO) + (1.0 _k) * nz(_sqRS)
        
    math.max(math.sqrt(math.max(_sq0.0)), 1e-10)

    f_icsLine(p1x1p2x2targetXsig) =>
        
    float out p1
        
    if x1 != x2 and p1 and p2 and sig 1e-10
            float y1 
    math.log(p1) / sig
            float y2 
    math.log(p2) / sig
            float yT 
    y1 + (y2 y1) * (targetX x1) / (x2 x1)
            
    out := math.exp(yT sig)
        
    out

    f_icsAngle
    (p1x1p2x2sig) =>
        
    float out 0.0
        
    if x1 != x2 and p1 and p2 and sig 1e-10
            float y1 
    math.log(p1) / sig
            float y2 
    math.log(p2) / sig
            out 
    := math.atan((y2 y1) / (x2 x1)) * 180.0 math.pi
        out

    f_ics_calc
    () =>
        
    int P 21
        float sig 
    f_yz_sigma(20)
        
        
    float h0 ta.highest(highP), float l0 ta.lowest(lowP)
        
        if 
    bar_index 5
            
    [h0l00.0]
        else
            
    float h1 h0[P],   float l1 l0[P]
            
    float h2 h0[P*2], float l2 l0[P*2]
            
    float h3 h0[P*3], float l3 l0[P*3]
            
    float h4 h0[P*4], float l4 l0[P*4]

            
    float g0 = (h0 and l0 0) ? math.exp((math.log(h0) + math.log(l0)) / 2.0) : na
            float g1 
    = (h1 and l1 0) ? math.exp((math.log(h1) + math.log(l1)) / 2.0) : na
            float g2 
    = (h2 and l2 0) ? math.exp((math.log(h2) + math.log(l2)) / 2.0) : na
            float g3 
    = (h3 and l3 0) ? math.exp((math.log(h3) + math.log(l3)) / 2.0) : na
            float g4 
    = (h4 and l4 0) ? math.exp((math.log(h4) + math.log(l4)) / 2.0) : na

            int pd 
    g0 g1 : -1
            int seg 
    1
            
    if g0 != g1
                
    if (g1 g2 : (g1 g2 ? -0)) == pd
                    seg 
    := 2
                    
    if (g2 g3 : (g2 g3 ? -0)) == pd
                        seg 
    := 3
                        
    if (g3 g4 : (g3 g4 ? -0)) == pd
                            seg 
    := 4

            int cx0 
    int(-P/2), int cx1 cx0 Pint cx2 cx1 Pint cx3 cx2 Pint cx4 cx3 P

            float fHH 
    h0float fLH h0float fHL l0float fLL l0
            int xHH 
    cx0int xLH cx0int xHL cx0int xLL cx0

            
    if seg >= 1
                
    if h1 fHH
                    fHH 
    := h1xHH := cx1
                
    if h1 fLH
                    fLH 
    := h1xLH := cx1
                
    if l1 fHL
                    fHL 
    := l1xHL := cx1
                
    if l1 fLL
                    fLL 
    := l1xLL := cx1
            
    if seg >= 2
                
    if h2 fHH
                    fHH 
    := h2xHH := cx2
                
    if h2 fLH
                    fLH 
    := h2xLH := cx2
                
    if l2 fHL
                    fHL 
    := l2xHL := cx2
                
    if l2 fLL
                    fLL 
    := l2xLL := cx2
            
    if seg >= 3
                
    if h3 fHH
                    fHH 
    := h3xHH := cx3
                
    if h3 fLH
                    fLH 
    := h3xLH := cx3
                
    if l3 fHL
                    fHL 
    := l3xHL := cx3
                
    if l3 fLL
                    fLL 
    := l3xLL := cx3
            
    if seg >= 4
                
    if h4 fHH
                    fHH 
    := h4xHH := cx4
                
    if h4 fLH
                    fLH 
    := h4xLH := cx4
                
    if l4 fHL
                    fHL 
    := l4xHL := cx4
                
    if l4 fLL
                    fLL 
    := l4xLL := cx4

            int sLx 
    seg == cx1 seg == cx2 seg == cx3 cx4
            int sRx 
    cx0

            float endG 
    seg == g1 seg == g2 seg == g3 g4
            float ang 
    f_icsAngle(endGsLxg0sRxsig)

            
    int dir math.abs(ang) <= 0.5 pd

            float uY1 
    fHHfloat uY2 fHHfloat lY1 fLLfloat lY2 fLL
            
    if dir == 1
                uY1 
    := f_icsLine(fLHxLHfHHxHHsLxsig), uY2 := f_icsLine(fLHxLHfHHxHHsRxsig)
                
    lY1 := f_icsLine(fLLxLLfHLxHLsLxsig), lY2 := f_icsLine(fLLxLLfHLxHLsRxsig)
            else if 
    dir == -1
                uY1 
    := f_icsLine(fHHxHHfLHxLHsLxsig), uY2 := f_icsLine(fHHxHHfLHxLHsRxsig)
                
    lY1 := f_icsLine(fHLxHLfLLxLLsLxsig), lY2 := f_icsLine(fHLxHLfLLxLLsRxsig)

            
    float uYa f_icsLine(uY1sLxuY2sRx0sig)
            
    float lYa f_icsLine(lY1sLxlY2sRx0sig)

            [
    uYalYafloat(dir)]

    // O anki mumun bulut deπerlerini global olarak alύyoruz
    [uYalYabulut_yon] = f_ics_calc()

    // ========================================================================= //
    // =========================== ΗέZέM MOTORU (HέYERARήέ) ==================== //
    // ========================================================================= //

    var box[]   kutu_bg     = array.new_box()
    var 
    line[]  cizgi_merkez= array.new_line()
    var 
    box[]   kutu_bulut  = array.new_box()
    var 
    line[]  cizgi_mum   = array.new_line()
    var 
    box[]   kutu_mum    = array.new_box()
    var 
    label[] etiketler   = array.new_label()

    f_temizle() =>
        for 
    b in kutu_bg
            box
    .delete(b)
        for 
    l in cizgi_merkez
            line
    .delete(l)
        for 
    b in kutu_bulut
            box
    .delete(b)
        for 
    l in cizgi_mum
            line
    .delete(l)
        for 
    b in kutu_mum
            box
    .delete(b)
        for 
    lbl in etiketler
            label
    .delete(lbl)
        array.
    clear(kutu_bg), array.clear(cizgi_merkez), array.clear(kutu_bulut)
        array.
    clear(cizgi_mum), array.clear(kutu_mum), array.clear(etiketler)

    if 
    barstate.islast
        f_temizle
    ()
        
        
    // --- 1. ADIM: EKRANIN GENEL MATEMATέΠέ VE SINIRLARI ---
        
    float max_val high
        float min_val 
    low
        
        
    // Son 'i_bars' kadar mumu geηmiώe doπru tarayύp o bφlgenin Max ve Min deπerlerini buluyoruz
        
    for 0 to i_bars 1
            float _h 
    high[i], float _l low[i]
            
    float _u uYa[i],  float _d lYa[i]
            
            
    max_val := math.max(max_val_h)
            
    min_val := math.min(min_val_l)
            if 
    not na(_u)
                
    max_val := math.max(max_val_u), min_val := math.min(min_val_u)
            if 
    not na(_d)
                
    max_val := math.max(max_val_d), min_val := math.min(min_val_d)
                
        
    // Pencereyi nereye ηizeceπiz? Ekranύn mevcut yόksekliπini referans alύyoruz
        
    float hv ta.highest(high300)
        
    float lv ta.lowest(low300)
        
    float cr hv lv == syminfo.mintick 100 hv lv
        float my 
    = (hv lv) / 2
        
        float er 
    cr * (i_vScale 100)
        
    float top_y my er 2
        float bot_y 
    my er 2
        float mid_y 
    = (top_y bot_y) / 2

        int start_x 
    bar_index i_offset
        int end_x   
    start_x i_width
        int mid_x   
    = (start_x end_x) / 2
        
        float hr 
    max_val min_val == syminfo.mintick max_val min_val
        float ir 
    top_y bot_y
        
        
    // Mumlar arasύ geniώlik hesaplamasύ
        
    float bs float(i_width) / i_bars
        int box_w 
    math.max(1int(bs 2))

        
    // --- 2. ADIM: HέYERARήέK ΗέZέM ---
        
        // Hiyerarώi 1: Ana Pencere (Zemin)
        //array.push(kutu_bg, box.new(start_x, top_y, end_x, bot_y, border_color=c_border, bgcolor=c_bg))
        
        // Hiyerarώi 2: Merkez Denge Ηizgisi
        
    array.push(cizgi_merkezline.new(start_xmid_yend_xmid_ycolor=color.yellowstyle=line.style_dashed))

        
    // Hiyerarώi 3: Alt ve άst Max/Min Etiketleri
        
    array.push(etiketlerlabel.new(mid_xtop_y"Max: " str.tostring(max_valformat.mintick), color=color.new(color.black100), textcolor=color.redstyle=label.style_label_downsize=size.normal))
        array.
    push(etiketlerlabel.new(mid_xbot_y"Min: " str.tostring(min_valformat.mintick), color=color.new(color.black100), textcolor=color.limestyle=label.style_label_upsize=size.normal)) 
    16.07.2024 - 10.12.2024

  4.  Alύntύ Originally Posted by @yφrόk@ Yazύyύ Oku



    okuyanlar iηin... paylaώύlan φrneklerden... beπendiπiniz kύsύmlarύ... alύp...
    birleώtirme yaparsanύz....

    buna benzer... grafikler όretmiώ olursunuz....

    paylaώύlan kodlarύn iηinde... ώu ana kadar TW gibi platformlarda... benzeri olmayan kodlar vardύr....

    gόzel birleώtirmelerinizi... burada paylaώύrsanύz....

    sevinirim....

    bilen paylaώύr...

    selamlar.....

    not: isteyen burdaki kod ηalύώmalarύnύ....TW de paylaώabilir... Ηόnkό hepsi Aέ tarafύndan yazύlmύώ...
    eπitim ηalύώmasύndan ibarettir....
    Claude Y.Z. senin sistemi bu gφnderideki gφrsel ve son gφnderilerini inceleyerek,
    benim ώablon ile ώφyle gφrselleώtirdi όstadύm:





    Nasύl tutarlύ mύ? Uπraώmaya deπer mi?

    Sόreη:

    Son dόzenleme : Oblo; 03-05-2026 saat: 23:56.

  5. Oblo hocam.... kodu bozmadan... pinescripten pyton ηevirmesi ηok gόzel olmuώ...

    kodun ηevrilme kύsmύnda hata var mύ bilemem....

    ama gφrsellerde... rakamlar tutuyor....

    kod normalde hl2 kaynak olarak kullanύyor....
    iηinde birbirini kontrol eden birden fazla strateji vardύ.

    scalping iηin 1dakikalύk grafik iηin hazύrlandύπύ iηin... pivotlar kkm sniper iηinde gφrdόπόn...
    1-3-5m hesaplamasύna dayanan bir strateji izliyor...
    fiyat 1-3m aynύ anda yukarύ kύrarsa al όretiyor....
    1-3m ortalamasύnύ ise en yakύn iz sόren stop olarak kullanύyor...

    1-3m birbiriyle όst όste binince.... pivotlar hesaplanύyor...
    hafif ayrύώma olunca otomatik olarak devam ediyor...
    yόzen aπ gibi sόrekli dinamiktirler... sabit deπillerdir....

    diπer 5-15-60-240 ve gόn deπerleri... gφrseldeki fuώyalar ise...
    o periyodun pivotu gibi dόώόnebilirsin... o deπerler gόηlό destek ve direnη gibidir....

    yine gφrselden gφrdόπόm kadarύ ile bazύ kύsύmlar eksik...
    sarύ almύώ hύzlύ olanύ... bar renklendirme almamύώ... bar renklendirmede strateji iηeriyordu...

    gφrseldeki dahboard ise sar stratejisini almύώ...
    sarύn hesapladύπύ destek direnci yazmύώ... ayna sarύn zύddύ olduπu iηin φncό olarak yazmύώ...
    yφrόkte stop gibidir...

    ayrύca gφrdόπόm kadarύyla... ben 1dakka scalping iηin kullandύπύmdan...atr 20-3.5-0.6 deπerlerini kullanύrken...
    senin gφrόntόde atr 50 gφzόkόyor.....

    bu durum rakamlarda az farklύlύk oluώturur....

    yine zemin renklendirmede hata var gibi...ηόnkό kodda zemin dόz ηizgi ώeklinde hareket eder...
    sar en son deπiώim yerinden dόz ηizgi ηeker... destek ve direnη iηin...
    gφrselde zeminde kύrύlύmlar gφrόyorum ki...
    bόyόk ihtimal fuώya deπerli yerden almύώ gibi gφzόkόyor....

    her ώey bir yana... bφyle aktarmasύ bile ηok mόthiώ....

    ηόnkό bunu sistemi taramasύ iηin kullanύlsa... ηok gόzel olacak...


    paylaώtύπύm kod... birden fazla strateji ve farklύ hesaplamalar iηerdiπi iηin....
    kόηόk hatalar olabilir...

    ama parηalύ aktarύm yapύlύrsa... hem hata olmaz... hem daha gόzel olur diye dόώόnόyorum....

    emeπine saπlύk....

    https://www.tradingview.com/x/0KY3RSEz/
    https://www.tradingview.com/x/DPeFJUc4/
    https://www.tradingview.com/x/CC6nVv18/
    https://www.tradingview.com/x/OO5FuH2j/
    https://www.tradingview.com/x/XDVZFsR0/

    bu gφrόntόlerin kodu.... biraz daha sade...
    PHP Code:
    //@version=6
    indicator("yφrόk"shorttitle="."overlay=truemax_labels_count=50max_lines_count=50)

    float sarMavi ta.sar(0.00.0030.02), sarSari ta.sar(0.00.0010.02), sarFusya ta.sar(0.0010.00050.02)
    plot(sarMavi"1"color.new(#04fbe6, 0), 1, plot.style_cross)
    plot(sarSari"2"color.new(#0408fb, 0), 1, plot.style_cross)
    plot(sarFusya"3"color.new(#fb5204, 0), 1, plot.style_cross)
    // 1. GέRDέLER

    int len input.int(13"Maliyet Uzunluπu")
    color col_up  input.color(#00e676, "Yόkseliώ Rengi (Yeώil)")
    color col_dn  input.color(#ff1744, "Dόώόώ Rengi (Kύrmύzύ)")
    color col_mid input.color(color.fuchsia"Merkez Ηizgi Rengi")

    float mid ta.hma(ta.median(hl2len 2), 233)

    // Sadece Kύrmύzύ ve Yeώil mantύπύ
    color bar_col close mid col_up close mid col_dn color.gray

    barcolor
    (bar_col)
    // 3. MOTOR: 3'Lά SAR ΗAKIήMASI (YAKIN TAKέP ELMAS TETέK)
    roSar1 ta.sar(0.030.0030.3// Hύzlύ Avcύ
    roSar2 ta.sar(0.050.0050.5// Yakύn Gφlge
    roSar3 ta.sar(0.100.0101.0// Vakum (Fiyata yapύώύk)

    // Kuantum Tolerans Motoru
    isEq(v1v2) => math.abs(v1 v2) <= syminfo.mintick
    isEq3
    (v1v2v3) => isEq(v1v2) and isEq(v1v3)

    // Sadece bu 3 SAR'ύn aynύ anda όst όste binme (ηakύώma) durumu
    all3Match isEq3(roSar1roSar2roSar3)

    float matchVal all3Match roSar1 na

    trigger 
    all3Match and not all3Match[1]
    isSupport close matchVal
    diamondColor 
    isSupport color.rgb(023011850) : color.rgb(255236850)

    plotshape(trigger matchVal na"3'lό SAR Elmasύ"shape.diamondlocation.absolutecolor=diamondColorsize=size.largedisplay=display.pane)
    ///////////////
    // ─────────────────────────────────────────────────────────────────
    // 1. ASYMMETRIC TREND ENGINE (GΦRάNMEZ HESAPLAYICI)
    float asy_src        hl2
    int   asy_lookback   
    21
    float asy_mult       
    6.5

    float asy_vol_threshold 
    ta.stdev(asy_srcasy_lookback) * asy_mult

    var float asy_trend_line na
    var int   asy_trend_dir  0
    var int   asy_prev_dir   0

    if na(asy_trend_line)
        
    asy_trend_line := asy_src
    else
        
    asy_prev_dir := asy_trend_dir
        
    if asy_trend_dir >= 0
            
    if asy_src asy_trend_line asy_vol_threshold 0.5
                asy_trend_line 
    := math.max(asy_trend_lineasy_src asy_vol_threshold 0.25)
                
    asy_trend_dir  := 1
            
    else if asy_src asy_trend_line asy_vol_threshold
                asy_trend_line 
    := asy_src asy_vol_threshold 0.25
                asy_trend_dir  
    := -1
        
    else
            if 
    asy_src asy_trend_line asy_vol_threshold 0.5
                asy_trend_line 
    := math.min(asy_trend_lineasy_src asy_vol_threshold 0.25)
                
    asy_trend_dir  := -1
            
    else if asy_src asy_trend_line asy_vol_threshold
                asy_trend_line 
    := asy_src asy_vol_threshold 0.25
                asy_trend_dir  
    := 1

    // Dφnόώ Teyitleri
    bool turned_bullish asy_trend_dir == 1  and asy_trend_dir[1] == -1
    bool turned_bearish 
    asy_trend_dir == -and asy_trend_dir[1] == 1
    bool is_reversal    
    asy_trend_dir != asy_prev_dir and bar_index 0

    // Trend ηizgisi plot edilmiyor, sadece dφnόώ anύnda hedef belirleniyor
    color rev_color asy_trend_dir == #00ffaa48 : #ff00003c

    // Reversal Noktasύ: Sadece trend yφn deπiώtirdiπinde o barύn altύna/όstόne '⦿' koyar
    plotchar(is_reversal ? (asy_trend_dir == low high) : na
             
    "KKM Reversal""⦿"location location.absolute
             
    color rev_colorsize size.huge)

    // //////
    // 0. MERKEZέ FONKSέYONLAR (Sύfύr Gecikme Motoru)
    // ─────────────────────────────────────────────────────────────────
    f_zlema(series float srcsimple int len) =>
        
    float ema1 ta.ema(srclen)
        
    float ema2 ta.ema(ema1len)
        
    ema1 + (ema1 ema2)

    // 1. DέNAMέK YOΠUNLUK MOTORU (Zamanύ Deπil, Maddeyi Φlηer)
    // ─────────────────────────────────────────────────────────────────
    // Bu motor aynύ 1m verisini alύr ama ona farklύ kutle direnηleri uygular.
    f_kutu_kutle(int _atrLenfloat _atrMultfloat _mu) =>
        
    float threshold ta.atr(_atrLen) * _atrMult
        
    var float z na
        
    var float v 0.0
        
    if bar_index == 0
            z 
    := hl2
        
    else
            
    float zPrev z[1], float vPrev v[1]
            
    float zPred zPrev vPrev
            float zTemp 
    zPred _mu * (hl2 zPred)
            
    float diff zTemp zPrev
            
    if math.abs(diff) > threshold
                v 
    := math.sign(diff) * (math.abs(diff) - threshold)
            else
                
    := 0.0
            z 
    := zPrev v
        z

    // ─────────────────────────────────────────────────────────────────
    // 2. KάTLE MATRέSέ (Camdan Ηeliπe Kurumsal Maliyetler)
    // ─────────────────────────────────────────────────────────────────
    // Aynύ 1 dakikalύk grafikte, merminin (fiyatύn) deleceπi katmanlar:
    float cam   f_kutu_kutle(11.00.05)   // CAM: Ηok kύrύlgan, mermi anύnda deler.

    float celik f_kutu_kutle(1,  0.010.01)  // ΗELέK: Komutanύn Tank Zύrhύ! (Delinmesi en zor)

    // ─────────────────────────────────────────────────────────────────
    // 3. YOΠUNLUK ΗέZέMLERέ (Ekranύ Kirletmeden)
    // ─────────────────────────────────────────────────────────────────
    plot(celik"@yφrόk@"color=color.new(#d500f9, 0), linewidth=1, style=plot.style_stepline) // Mor

    plot(cam,   "yφrόk",   color=color.new(#f5f902, 0), linewidth=1, style=plot.style_stepline) // Beyaz

    // ─────────────────────────────────────────────────────────────────

    group_ayna "Makro Duvarlar (Yin-Yang Ayna)"
    float h_start input.float(0.06"Hύzlύ SAR Baώlangύη"step=0.01group=group_ayna)
    float h_inc   input.float(0.06"Hύzlύ SAR έvme"step=0.01group=group_ayna)
    float h_max   input.float(0.30"Hύzlύ SAR Max"step=0.1group=group_ayna)
    int pivot_len input.int(10"Duvar Tespiti"group=group_ayna)

    color col_ayna color.new(color.gray0)

    // 4. YέN-YANG AYNASI VE MAKRO DUVARLAR
    // ─────────────────────────────────────────────────────────────────
    f_ozel_sar(src_hsrc_l_start_inc_max) =>
        var 
    int trend 0
        
    var float sar_val 0.0
        
    var float ep 0.0
        
    var float af 0.0
        
    if trend == and not na(src_h[1])
            
    trend   := src_h >= src_h[1] or src_l >= src_l[1] ? : -1
            sar_val 
    := trend src_l[1] : src_h[1]
            
    ep      := trend src_h[1] : src_l[1]
            
    af      := _start
        
    else
            
    float nextsar sar_val
            
    if trend 0
                
    if src_h[1] > ep
                    ep 
    := src_h[1]
                    
    af := math.min(_maxaf _inc)
                
    nextsar := sar_val af * (ep sar_val)
                
    nextsar := math.min(math.min(src_l[1], src_l[2]), nextsar)
                if 
    nextsar src_l
                    trend   
    := -1
                    nextsar 
    := ep
                    ep      
    := src_l
                    af      
    := _start
            
    else
                if 
    src_l[1] < ep
                    ep 
    := src_l[1]
                    
    af := math.min(_maxaf _inc)
                
    nextsar := sar_val af * (ep sar_val)
                
    nextsar := math.max(math.max(src_h[1], src_h[2]), nextsar)
                if 
    nextsar src_h
                    trend   
    := 1
                    nextsar 
    := ep
                    ep      
    := src_h
                    af      
    := _start
            sar_val 
    := nextsar
        
    [sar_valtrend]

    [
    sar_hizlitrend_hizli] = f_ozel_sar(highlowh_starth_inch_max)
    float ayna_hizli trend_hizli close math.abs(close sar_hizli) : close math.abs(close sar_hizli)

    float ph_ayna ta.pivothigh(ayna_hizlipivot_lenpivot_len)
    float pl_ayna ta.pivotlow(ayna_hizlipivot_lenpivot_len)

    var array<
    linemacro_up_walls = array.new<line>()
    var array<
    linemacro_dn_walls = array.new<line>()

    if 
    not na(ph_ayna)
        
    line w_up line.new(bar_index[pivot_len], ph_aynabar_indexph_aynacolor=color.new(#00e676, 0), width=1, style=line.style_dotted, extend=extend.right)
        
    array.push(macro_up_wallsw_up)
        if array.
    size(macro_up_walls) > 2
            line
    .delete(array.shift(macro_up_walls))

    if 
    not na(pl_ayna)
        
    line w_dn line.new(bar_index[pivot_len], pl_aynabar_indexpl_aynacolor=color.new(#ff1744, 0), width=1, style=line.style_dotted, extend=extend.right)
        
    array.push(macro_dn_wallsw_dn)
        if array.
    size(macro_dn_walls) > 2
            line
    .delete(array.shift(macro_dn_walls))

    plot(ayna_hizli"Ayna"color=col_aynalinewidth=1)

    // ─────────────────────────────────────────────────────────────────

    grp_pos "PENCERE VE BOYUT AYARLARI"
    i_bars    input.int(50,    "Gφsterilecek Mum Sayύsύ"group=grp_posminval=10)
    i_width   input.int(100,   "Pencere Geniώliπi (Bar)"group=grp_posminval=20)
    i_offset  input.int(10,    "Yatay Uzaklύk (Saπa)",    group=grp_pos)
    i_vScale  input.float(35.0"Dikey Φlηekleme (%)",    group=grp_posstep=1.0)

    grp_style "RENKLER VE GΦRSELLέK"
    c_up      input.color(color.new(#00e676, 0), "Yόkseliώ Mumu", group=grp_style)
    c_down    input.color(color.new(#ff1744, 0), "Dόώόώ Mumu",    group=grp_style)
    c_bg      input.color(color.new(#0b0e14, 20), "Arka Plan Kutusu",group=grp_style)
    c_border  input.color(color.new(#ffffff, 80), "Pencere Ηerηevesi",group=grp_style)

    c_fillUp  input.color(color.new(#26a69a, 60), "Bulut (Yόkseliώ)", group=grp_style)
    c_fillDn  input.color(color.new(#ef5350, 60), "Bulut (Dόώόώ)",    group=grp_style)
    c_fillRng input.color(color.new(#888888, 60), "Bulut (Yatay)",     group=grp_style)

    // ========================================================================= //
    // ================== ICS 21 MATEMATέΠέ (YERLEήέK HESAPLAMA) =============== //
    // ========================================================================= //
    // Dizi (Array) kullanmadan, doπrudan zaman serisi όzerinden ηalύώύr. Ηφkmez.

    f_yz_sigma(len) =>
        
    float _yzOR math.log(open nz(close[1], open))
        
    float _yzCO math.log(close open)
        
    float _yzHO math.log(high open)
        
    float _yzHC math.log(high close)
        
    float _yzLO math.log(low  open)
        
    float _yzLC math.log(low  close)
        
    float _sqOR ta.variance(_yzORlen)
        
    float _sqCO ta.variance(_yzCOlen)
        
    float _sqRS ta.sma(_yzHO _yzHC _yzLO _yzLClen)
        
    float _k    0.34 / (1.34 + (len 1.0) / math.max(len 1.01.0))
        
    float _sq   nz(_sqOR) + _k nz(_sqCO) + (1.0 _k) * nz(_sqRS)
        
    math.max(math.sqrt(math.max(_sq0.0)), 1e-10)

    f_icsLine(p1x1p2x2targetXsig) =>
        
    float out p1
        
    if x1 != x2 and p1 and p2 and sig 1e-10
            float y1 
    math.log(p1) / sig
            float y2 
    math.log(p2) / sig
            float yT 
    y1 + (y2 y1) * (targetX x1) / (x2 x1)
            
    out := math.exp(yT sig)
        
    out

    f_icsAngle
    (p1x1p2x2sig) =>
        
    float out 0.0
        
    if x1 != x2 and p1 and p2 and sig 1e-10
            float y1 
    math.log(p1) / sig
            float y2 
    math.log(p2) / sig
            out 
    := math.atan((y2 y1) / (x2 x1)) * 180.0 math.pi
        out

    f_ics_calc
    () =>
        
    int P 21
        float sig 
    f_yz_sigma(20)
        
        
    float h0 ta.highest(highP), float l0 ta.lowest(lowP)
        
        if 
    bar_index 5
            
    [h0l00.0]
        else
            
    float h1 h0[P],   float l1 l0[P]
            
    float h2 h0[P*2], float l2 l0[P*2]
            
    float h3 h0[P*3], float l3 l0[P*3]
            
    float h4 h0[P*4], float l4 l0[P*4]

            
    float g0 = (h0 and l0 0) ? math.exp((math.log(h0) + math.log(l0)) / 2.0) : na
            float g1 
    = (h1 and l1 0) ? math.exp((math.log(h1) + math.log(l1)) / 2.0) : na
            float g2 
    = (h2 and l2 0) ? math.exp((math.log(h2) + math.log(l2)) / 2.0) : na
            float g3 
    = (h3 and l3 0) ? math.exp((math.log(h3) + math.log(l3)) / 2.0) : na
            float g4 
    = (h4 and l4 0) ? math.exp((math.log(h4) + math.log(l4)) / 2.0) : na

            int pd 
    g0 g1 : -1
            int seg 
    1
            
    if g0 != g1
                
    if (g1 g2 : (g1 g2 ? -0)) == pd
                    seg 
    := 2
                    
    if (g2 g3 : (g2 g3 ? -0)) == pd
                        seg 
    := 3
                        
    if (g3 g4 : (g3 g4 ? -0)) == pd
                            seg 
    := 4

            int cx0 
    int(-P/2), int cx1 cx0 Pint cx2 cx1 Pint cx3 cx2 Pint cx4 cx3 P

            float fHH 
    h0float fLH h0float fHL l0float fLL l0
            int xHH 
    cx0int xLH cx0int xHL cx0int xLL cx0

            
    if seg >= 1
                
    if h1 fHH
                    fHH 
    := h1xHH := cx1
                
    if h1 fLH
                    fLH 
    := h1xLH := cx1
                
    if l1 fHL
                    fHL 
    := l1xHL := cx1
                
    if l1 fLL
                    fLL 
    := l1xLL := cx1
            
    if seg >= 2
                
    if h2 fHH
                    fHH 
    := h2xHH := cx2
                
    if h2 fLH
                    fLH 
    := h2xLH := cx2
                
    if l2 fHL
                    fHL 
    := l2xHL := cx2
                
    if l2 fLL
                    fLL 
    := l2xLL := cx2
            
    if seg >= 3
                
    if h3 fHH
                    fHH 
    := h3xHH := cx3
                
    if h3 fLH
                    fLH 
    := h3xLH := cx3
                
    if l3 fHL
                    fHL 
    := l3xHL := cx3
                
    if l3 fLL
                    fLL 
    := l3xLL := cx3
            
    if seg >= 4
                
    if h4 fHH
                    fHH 
    := h4xHH := cx4
                
    if h4 fLH
                    fLH 
    := h4xLH := cx4
                
    if l4 fHL
                    fHL 
    := l4xHL := cx4
                
    if l4 fLL
                    fLL 
    := l4xLL := cx4

            int sLx 
    seg == cx1 seg == cx2 seg == cx3 cx4
            int sRx 
    cx0

            float endG 
    seg == g1 seg == g2 seg == g3 g4
            float ang 
    f_icsAngle(endGsLxg0sRxsig)

            
    int dir math.abs(ang) <= 0.5 pd

            float uY1 
    fHHfloat uY2 fHHfloat lY1 fLLfloat lY2 fLL
            
    if dir == 1
                uY1 
    := f_icsLine(fLHxLHfHHxHHsLxsig), uY2 := f_icsLine(fLHxLHfHHxHHsRxsig)
                
    lY1 := f_icsLine(fLLxLLfHLxHLsLxsig), lY2 := f_icsLine(fLLxLLfHLxHLsRxsig)
            else if 
    dir == -1
                uY1 
    := f_icsLine(fHHxHHfLHxLHsLxsig), uY2 := f_icsLine(fHHxHHfLHxLHsRxsig)
                
    lY1 := f_icsLine(fHLxHLfLLxLLsLxsig), lY2 := f_icsLine(fHLxHLfLLxLLsRxsig)

            
    float uYa f_icsLine(uY1sLxuY2sRx0sig)
            
    float lYa f_icsLine(lY1sLxlY2sRx0sig)

            [
    uYalYafloat(dir)]

    // O anki mumun bulut deπerlerini global olarak alύyoruz
    [uYalYabulut_yon] = f_ics_calc()

    // ========================================================================= //
    // =========================== ΗέZέM MOTORU (HέYERARήέ) ==================== //
    // ========================================================================= //

    var box[]   kutu_bg     = array.new_box()
    var 
    line[]  cizgi_merkez= array.new_line()
    var 
    box[]   kutu_bulut  = array.new_box()
    var 
    line[]  cizgi_mum   = array.new_line()
    var 
    box[]   kutu_mum    = array.new_box()
    var 
    label[] etiketler   = array.new_label()

    f_temizle() =>
        for 
    b in kutu_bg
            box
    .delete(b)
        for 
    l in cizgi_merkez
            line
    .delete(l)
        for 
    b in kutu_bulut
            box
    .delete(b)
        for 
    l in cizgi_mum
            line
    .delete(l)
        for 
    b in kutu_mum
            box
    .delete(b)
        for 
    lbl in etiketler
            label
    .delete(lbl)
        array.
    clear(kutu_bg), array.clear(cizgi_merkez), array.clear(kutu_bulut)
        array.
    clear(cizgi_mum), array.clear(kutu_mum), array.clear(etiketler)

    if 
    barstate.islast
        f_temizle
    ()
        
        
    // --- 1. ADIM: EKRANIN GENEL MATEMATέΠέ VE SINIRLARI ---
        
    float max_val high
        float min_val 
    low
        
        
    // Son 'i_bars' kadar mumu geηmiώe doπru tarayύp o bφlgenin Max ve Min deπerlerini buluyoruz
        
    for 0 to i_bars 1
            float _h 
    high[i], float _l low[i]
            
    float _u uYa[i],  float _d lYa[i]
            
            
    max_val := math.max(max_val_h)
            
    min_val := math.min(min_val_l)
            if 
    not na(_u)
                
    max_val := math.max(max_val_u), min_val := math.min(min_val_u)
            if 
    not na(_d)
                
    max_val := math.max(max_val_d), min_val := math.min(min_val_d)
                
        
    // Pencereyi nereye ηizeceπiz? Ekranύn mevcut yόksekliπini referans alύyoruz
        
    float hv ta.highest(high300)
        
    float lv ta.lowest(low300)
        
    float cr hv lv == syminfo.mintick 100 hv lv
        float my 
    = (hv lv) / 2
        
        float er 
    cr * (i_vScale 100)
        
    float top_y my er 2
        float bot_y 
    my er 2
        float mid_y 
    = (top_y bot_y) / 2

        int start_x 
    bar_index i_offset
        int end_x   
    start_x i_width
        int mid_x   
    = (start_x end_x) / 2
        
        float hr 
    max_val min_val == syminfo.mintick max_val min_val
        float ir 
    top_y bot_y
        
        
    // Mumlar arasύ geniώlik hesaplamasύ
        
    float bs float(i_width) / i_bars
        int box_w 
    math.max(1int(bs 2))

        
    // --- 2. ADIM: HέYERARήέK ΗέZέM ---
        
        // Hiyerarώi 1: Ana Pencere (Zemin)
        //array.push(kutu_bg, box.new(start_x, top_y, end_x, bot_y, border_color=c_border, bgcolor=c_bg))
        
        // Hiyerarώi 2: Merkez Denge Ηizgisi
        
    array.push(cizgi_merkezline.new(start_xmid_yend_xmid_ycolor=color.yellowstyle=line.style_dashed))

        
    // Hiyerarώi 3: Alt ve άst Max/Min Etiketleri
        
    array.push(etiketlerlabel.new(mid_xtop_y"Max: " str.tostring(max_valformat.mintick), color=color.new(color.black100), textcolor=color.redstyle=label.style_label_downsize=size.normal))
        array.
    push(etiketlerlabel.new(mid_xbot_y"Min: " str.tostring(min_valformat.mintick), color=color.new(color.black100), textcolor=color.limestyle=label.style_label_upsize=size.normal))

        
    //////////////////////////
    // 1. GέRDέLER
    // ─────────────────────────────────────────────────────────────────
    group_l1 "1. Kinetik Motor (Yφrόk)"
    int atrLen input.int(20"L1 Hafύza (ATR)"group=group_l1)
    float atrMult input.float(3.5"L1 Gόrόltό Duvarύ"step=0.1group=group_l1)
    float mu input.float(0.6"L1 Yakύnsaklύk (μ)"step=0.1group=group_l1)

    // ─────────────────────────────────────────────────────────────────
    f_yoruk_pure() =>
        
    float threshold ta.atr(atrLen) * atrMult
        
    var float z na
        
    var float v 0.0
        
    if bar_index == 0
            z 
    := hl2
        
    else
            
    float zPrev z[1], float vPrev v[1]
            
    float zPred zPrev vPrev
            float zTemp 
    zPred mu * (hl2 zPred)
            
    float diff zTemp zPrev
            
    if math.abs(diff) > threshold
                v 
    := math.sign(diff) * (math.abs(diff) - threshold)
            else
                
    := 0.0
            z 
    := zPrev v
        z


    // ─────────────────────────────────────────────────────────────────
    // GέRDέLER VE RENKLER
    // ─────────────────────────────────────────────────────────────────

    //color col_up  = input.color(#00e676, "Yόkseliώ Rengi (Yeώil)")
    //color col_dn  = input.color(#ff1744, "Dόώόώ Rengi (Kύrmύzύ)")
    //color col_mid = input.color(color.fuchsia, "Merkez Ηizgi Rengi")


    group_motor "Kinetik Zeminler (Trinity)"
    int len_fast input.int(5"Hύzlύ Zemin (Zemin 1)"group=group_motor)
    int len_slow input.int(20"Yavaώ Zemin (Zemin 2)"group=group_motor)

    group_dash "Gφsterge Paneli"
    bool show_dash input.bool(true"Paneli Gφster"group=group_dash)
    string dash_pos input.string("Top Right""Panel Konumu"options=["Top Right""Top Left""Bottom Right""Bottom Left"], group=group_dash)

    group_kin "Renk Paleti"

    col_flat input.color(#787b86, "Flat (Nφtr)", group=group_kin)
    col_eq input.color(#ff9800, "Merkez Pivot (Turuncu Denge)", group=group_kin)

    // ─────────────────────────────────────────────────────────────────
    // 1. MOTOR: L1 KέNETέK FέLTRE (ANA BASELINE)
    // ─────────────────────────────────────────────────────────────────
    float threshold ta.atr(atrLen) * atrMult
    var float z na
    var float v 0.0

    if bar_index == 0
        z 
    := close
    else
        
    float zPrev z[1], float vPrev v[1]
        
    float zPred zPrev vPrev
        float zTemp 
    zPred mu * (close zPred)
        
    float diff zTemp zPrev
        
    if math.abs(diff) > threshold
            v 
    := math.sign(diff) * (math.abs(diff) - threshold)
        else
            
    := 0.0
        z 
    := zPrev v

    ////////////

    // ─────────────────────────────────────────────────────────────────
    // 2. MOTOR: TRINITY ZEMέNLER (5 - 20)
    // ─────────────────────────────────────────────────────────────────
    float fast_floor ta.hma(zlen_fast)
    float slow_floor ta.hma(zlen_slow)

    bool is_bull fast_floor slow_floor




    // ─────────────────────────────────────────────────────────────────
    // 3. ANALέZ: άΗLά KAVUήUM (YάZEN PέVOT AΠI) VE SέNYAL TAKέBέ
    // ─────────────────────────────────────────────────────────────────
    isEq55(v1v2) => math.abs(v1 v2) <= syminfo.mintick
    bool trinity_aligned 
    isEq55(zfast_floor) and isEq55(zslow_floor)

    var 
    float last_eq_val na
    var float last_eq_step na

    // Ηizgi ve Etiket Deπiώkenleri
    var line line_p na,  var label lbl_p na
    var line line_r1 na, var label lbl_r1 na
    var line line_r2 na, var label lbl_r2 na
    var line line_r3 na, var label lbl_r3 na
    var line line_s1 na, var label lbl_s1 na
    var line line_s2 na, var label lbl_s2 na
    var line line_s3 na, var label lbl_s3 na

    if trinity_aligned
        last_eq_val 
    := z
        last_eq_step 
    := threshold // L1'in kendi gόrόltό duvarύ mesafesi

    // Kavuώum (Denge) deπeri varsa, yόzen aπύ her an gόncelle
    if not na(last_eq_val)
        
    int ext 10 // Ηizgilerin uzayacaπύ bar sayύsύ
        
        
    float val_p  last_eq_val
        float val_r1 
    last_eq_val last_eq_step 1
        float val_r2 
    last_eq_val last_eq_step 2
        float val_r3 
    last_eq_val last_eq_step 3
        float val_s1 
    last_eq_val last_eq_step 1
        float val_s2 
    last_eq_val last_eq_step 2
        float val_s3 
    last_eq_val last_eq_step 3

        
    if na(line_p)
            
    // Ηizgiler
            
    line_p  := line.new(bar_indexval_p,  bar_index extval_p,  color=col_eqwidth=2style=line.style_dotted)
            
    line_r1 := line.new(bar_indexval_r1bar_index extval_r1color=color.new(col_dn30), width=1style=line.style_dotted)
            
    line_r2 := line.new(bar_indexval_r2bar_index extval_r2color=color.new(col_dn30), width=1style=line.style_dotted)
            
    line_r3 := line.new(bar_indexval_r3bar_index extval_r3color=color.new(col_dn30), width=1style=line.style_dotted)
            
    line_s1 := line.new(bar_indexval_s1bar_index extval_s1color=color.new(col_up30), width=1style=line.style_dotted)
            
    line_s2 := line.new(bar_indexval_s2bar_index extval_s2color=color.new(col_up30), width=1style=line.style_dotted)
            
    line_s3 := line.new(bar_indexval_s3bar_index extval_s3color=color.new(col_up30), width=1style=line.style_dotted)
            
            
    // Etiketler
            
    lbl_p  := label.new(bar_index extval_p,  "P: " str.tostring(val_pformat.mintick),  color=color.new(color.white100), textcolor=col_eqstyle=label.style_label_leftsize=size.normal)
            
    lbl_r1 := label.new(bar_index extval_r1"R1: " str.tostring(val_r1format.mintick), color=color.new(color.white100), textcolor=col_dnstyle=label.style_label_leftsize=size.normal)
            
    lbl_r2 := label.new(bar_index extval_r2"R2: " str.tostring(val_r2format.mintick), color=color.new(color.white100), textcolor=col_dnstyle=label.style_label_leftsize=size.normal)
            
    lbl_r3 := label.new(bar_index extval_r3"R3: " str.tostring(val_r3format.mintick), color=color.new(color.white100), textcolor=col_dnstyle=label.style_label_leftsize=size.normal)
            
    lbl_s1 := label.new(bar_index extval_s1"S1: " str.tostring(val_s1format.mintick), color=color.new(color.white100), textcolor=col_upstyle=label.style_label_leftsize=size.normal)
            
    lbl_s2 := label.new(bar_index extval_s2"S2: " str.tostring(val_s2format.mintick), color=color.new(color.white100), textcolor=col_upstyle=label.style_label_leftsize=size.normal)
            
    lbl_s3 := label.new(bar_index extval_s3"S3: " str.tostring(val_s3format.mintick), color=color.new(color.white100), textcolor=col_upstyle=label.style_label_leftsize=size.normal)
        else
            
    // Aπύ ve etiketleri her bar saπa kaydύr
            
    line.set_xy1(line_p,  bar_indexval_p),  line.set_xy2(line_p,  bar_index extval_p)
            
    line.set_xy1(line_r1bar_indexval_r1), line.set_xy2(line_r1bar_index extval_r1)
            
    line.set_xy1(line_r2bar_indexval_r2), line.set_xy2(line_r2bar_index extval_r2)
            
    line.set_xy1(line_r3bar_indexval_r3), line.set_xy2(line_r3bar_index extval_r3)
            
    line.set_xy1(line_s1bar_indexval_s1), line.set_xy2(line_s1bar_index extval_s1)
            
    line.set_xy1(line_s2bar_indexval_s2), line.set_xy2(line_s2bar_index extval_s2)
            
    line.set_xy1(line_s3bar_indexval_s3), line.set_xy2(line_s3bar_index extval_s3)
            
            
    label.set_xy(lbl_p,  bar_index extval_p),  label.set_text(lbl_p,  "P: " str.tostring(val_pformat.mintick))
            
    label.set_xy(lbl_r1bar_index extval_r1), label.set_text(lbl_r1"R1: " str.tostring(val_r1format.mintick))
            
    label.set_xy(lbl_r2bar_index extval_r2), label.set_text(lbl_r2"R2: " str.tostring(val_r2format.mintick))
            
    label.set_xy(lbl_r3bar_index extval_r3), label.set_text(lbl_r3"R3: " str.tostring(val_r3format.mintick))
            
    label.set_xy(lbl_s1bar_index extval_s1), label.set_text(lbl_s1"S1: " str.tostring(val_s1format.mintick))
            
    label.set_xy(lbl_s2bar_index extval_s2), label.set_text(lbl_s2"S2: " str.tostring(val_s2format.mintick))
            
    label.set_xy(lbl_s3bar_index extval_s3), label.set_text(lbl_s3"S3: " str.tostring(val_s3format.mintick))

    // Sinyal Takibi (L1 Yφn Deπiώimi)
    var int trendL1 0
    if z[1]
        
    trendL1 := 1
    else if z[1]
        
    trendL1 := -1

    var string last_sig_type "-"
    var float last_sig_price na

    if ta.change(trendL1) != 0
        last_sig_type 
    := trendL1 == "AL" "SAT"
        
    last_sig_price := close

    // ─────────────────────────────────────────────────────────────────
    // 4. GΦRSEL TERMέNAL (DASHBOARD)
    // ─────────────────────────────────────────────────────────────────
    var pos dash_pos == "Bottom Right" position.top_left dash_pos == "Top Left" position.top_left dash_pos == "Bottom Right" position.bottom_right position.bottom_left
    var table dash55 table.new(pos27bgcolor=color.new(#131722, 10), border_width=1, border_color=color.new(#363a45, 50), frame_color=color.new(#363a45, 50), frame_width=1)

    if show_dash and barstate.islast
        
    // Baώlύk
        
    table.cell(dash5500"@yφrόk@ 2026 Gemini Pro Eπitim Ηalύώmasύdύr."bgcolor=color.new(#2962ff, 50), text_color=color.white, text_size=size.normal, text_halign=text.align_center)
        
    table.merge_cells(dash550010)
        
        
    // Deπerler
        
    table.cell(dash5501"Fiyat"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5511str.tostring(closeformat.mintick), text_color=color.whitetext_size=size.normal)
        
        
    table.cell(dash5502"0"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5512str.tostring(zformat.mintick), text_color=color.silvertext_size=size.normal)
        
        
    table.cell(dash5503"(1) | (2)"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5513str.tostring(fast_floorformat.mintick) + " | " str.tostring(slow_floorformat.mintick), text_color=color.aquatext_size=size.normal)
        
        
    // άηlό Kavuώum (Denge Noktasύ)
        
    table.cell(dash5504"(Denge)"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5514na(last_eq_val) ? "-" str.tostring(last_eq_valformat.mintick), text_color=col_eqtext_size=size.normal)
        
        
    // Son Sinyal
        
    color sig_col last_sig_type == "AL" col_up last_sig_type == "SAT" col_dn color.gray
        table
    .cell(dash5505"Son Sinyal"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5515last_sig_type " (" str.tostring(last_sig_priceformat.mintick) + ")"text_color=sig_coltext_size=size.normal)

        
    // Alt Bilgi
        
    table.cell(dash5506" Yatύrύm tavsiyesi DEΠέLDέR."text_color=color.new(color.white0), text_size=size.normal)
        
    table.merge_cells(dash550616)
    /////////////////////////// 
    Son dόzenleme : @yφrόk@; 04-05-2026 saat: 07:16.
    16.07.2024 - 10.12.2024

  6. btc.. gόnlόk periyotta 82.093 hedefte...
    scalping yapan iηin ise 80.200 izstop...79.800 kesin stop...

    Oblo hocam....
    yazύnύ tekrar okudum...

    Claude Y.Z. senin sistemi bu gφnderideki gφrsel ve son gφnderilerini inceleyerek....

    eπer sadece gφrsel inceleyerek... kod yazdύysa.... ben bi yaώύma daha girerim...

    (hoώ bende bazύ grafiklerin gφrselinden kod yazdύrύyorum ama...senin kullandύπύn daha iyiymiώ)

    ben kodlarύ parηalayύp... ayrύ ayrύ hazύrladύkηa... senin sisteme aktarma iηin paylaώύm yapacaπύm...
    aηύklamasύyla beraber.... el elden όstόndόr... senin de fikirlerinle... daha da gόzelleώtiririz.. inώallah...
    selamlar...
    16.07.2024 - 10.12.2024


  7. Ben de bunu web uygulamasύna dφnόώtόrdόm



     Alύntύ Originally Posted by @yφrόk@ Yazύyύ Oku
    Oblo hocam.... kodu bozmadan... pinescripten pyton ηevirmesi ηok gόzel olmuώ...

    kodun ηevrilme kύsmύnda hata var mύ bilemem....

    ama gφrsellerde... rakamlar tutuyor....

    kod normalde hl2 kaynak olarak kullanύyor....
    iηinde birbirini kontrol eden birden fazla strateji vardύ.

    scalping iηin 1dakikalύk grafik iηin hazύrlandύπύ iηin... pivotlar kkm sniper iηinde gφrdόπόn...
    1-3-5m hesaplamasύna dayanan bir strateji izliyor...
    fiyat 1-3m aynύ anda yukarύ kύrarsa al όretiyor....
    1-3m ortalamasύnύ ise en yakύn iz sόren stop olarak kullanύyor...

    1-3m birbiriyle όst όste binince.... pivotlar hesaplanύyor...
    hafif ayrύώma olunca otomatik olarak devam ediyor...
    yόzen aπ gibi sόrekli dinamiktirler... sabit deπillerdir....

    diπer 5-15-60-240 ve gόn deπerleri... gφrseldeki fuώyalar ise...
    o periyodun pivotu gibi dόώόnebilirsin... o deπerler gόηlό destek ve direnη gibidir....

    yine gφrselden gφrdόπόm kadarύ ile bazύ kύsύmlar eksik...
    sarύ almύώ hύzlύ olanύ... bar renklendirme almamύώ... bar renklendirmede strateji iηeriyordu...

    gφrseldeki dahboard ise sar stratejisini almύώ...
    sarύn hesapladύπύ destek direnci yazmύώ... ayna sarύn zύddύ olduπu iηin φncό olarak yazmύώ...
    yφrόkte stop gibidir...

    ayrύca gφrdόπόm kadarύyla... ben 1dakka scalping iηin kullandύπύmdan...atr 20-3.5-0.6 deπerlerini kullanύrken...
    senin gφrόntόde atr 50 gφzόkόyor.....

    bu durum rakamlarda az farklύlύk oluώturur....

    yine zemin renklendirmede hata var gibi...ηόnkό kodda zemin dόz ηizgi ώeklinde hareket eder...
    sar en son deπiώim yerinden dόz ηizgi ηeker... destek ve direnη iηin...
    gφrselde zeminde kύrύlύmlar gφrόyorum ki...
    bόyόk ihtimal fuώya deπerli yerden almύώ gibi gφzόkόyor....

    her ώey bir yana... bφyle aktarmasύ bile ηok mόthiώ....

    ηόnkό bunu sistemi taramasύ iηin kullanύlsa... ηok gόzel olacak...


    paylaώtύπύm kod... birden fazla strateji ve farklύ hesaplamalar iηerdiπi iηin....
    kόηόk hatalar olabilir...

    ama parηalύ aktarύm yapύlύrsa... hem hata olmaz... hem daha gόzel olur diye dόώόnόyorum....

    emeπine saπlύk....

    https://www.tradingview.com/x/0KY3RSEz/
    https://www.tradingview.com/x/DPeFJUc4/
    https://www.tradingview.com/x/CC6nVv18/
    https://www.tradingview.com/x/OO5FuH2j/
    https://www.tradingview.com/x/XDVZFsR0/

    bu gφrόntόlerin kodu.... biraz daha sade...
    PHP Code:
    //@version=6
    indicator("yφrόk"shorttitle="."overlay=truemax_labels_count=50max_lines_count=50)

    float sarMavi ta.sar(0.00.0030.02), sarSari ta.sar(0.00.0010.02), sarFusya ta.sar(0.0010.00050.02)
    plot(sarMavi"1"color.new(#04fbe6, 0), 1, plot.style_cross)
    plot(sarSari"2"color.new(#0408fb, 0), 1, plot.style_cross)
    plot(sarFusya"3"color.new(#fb5204, 0), 1, plot.style_cross)
    // 1. GέRDέLER

    int len input.int(13"Maliyet Uzunluπu")
    color col_up  input.color(#00e676, "Yόkseliώ Rengi (Yeώil)")
    color col_dn  input.color(#ff1744, "Dόώόώ Rengi (Kύrmύzύ)")
    color col_mid input.color(color.fuchsia"Merkez Ηizgi Rengi")

    float mid ta.hma(ta.median(hl2len 2), 233)

    // Sadece Kύrmύzύ ve Yeώil mantύπύ
    color bar_col close mid col_up close mid col_dn color.gray

    barcolor
    (bar_col)
    // 3. MOTOR: 3'Lά SAR ΗAKIήMASI (YAKIN TAKέP ELMAS TETέK)
    roSar1 ta.sar(0.030.0030.3// Hύzlύ Avcύ
    roSar2 ta.sar(0.050.0050.5// Yakύn Gφlge
    roSar3 ta.sar(0.100.0101.0// Vakum (Fiyata yapύώύk)

    // Kuantum Tolerans Motoru
    isEq(v1v2) => math.abs(v1 v2) <= syminfo.mintick
    isEq3
    (v1v2v3) => isEq(v1v2) and isEq(v1v3)

    // Sadece bu 3 SAR'ύn aynύ anda όst όste binme (ηakύώma) durumu
    all3Match isEq3(roSar1roSar2roSar3)

    float matchVal all3Match roSar1 na

    trigger 
    all3Match and not all3Match[1]
    isSupport close matchVal
    diamondColor 
    isSupport color.rgb(023011850) : color.rgb(255236850)

    plotshape(trigger matchVal na"3'lό SAR Elmasύ"shape.diamondlocation.absolutecolor=diamondColorsize=size.largedisplay=display.pane)
    ///////////////
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    // 1. ASYMMETRIC TREND ENGINE (GΦRάNMEZ HESAPLAYICI)
    float asy_src        hl2
    int   asy_lookback   
    21
    float asy_mult       
    6.5

    float asy_vol_threshold 
    ta.stdev(asy_srcasy_lookback) * asy_mult

    var float asy_trend_line na
    var int   asy_trend_dir  0
    var int   asy_prev_dir   0

    if na(asy_trend_line)
        
    asy_trend_line := asy_src
    else
        
    asy_prev_dir := asy_trend_dir
        
    if asy_trend_dir >= 0
            
    if asy_src asy_trend_line asy_vol_threshold 0.5
                asy_trend_line 
    := math.max(asy_trend_lineasy_src asy_vol_threshold 0.25)
                
    asy_trend_dir  := 1
            
    else if asy_src asy_trend_line asy_vol_threshold
                asy_trend_line 
    := asy_src asy_vol_threshold 0.25
                asy_trend_dir  
    := -1
        
    else
            if 
    asy_src asy_trend_line asy_vol_threshold 0.5
                asy_trend_line 
    := math.min(asy_trend_lineasy_src asy_vol_threshold 0.25)
                
    asy_trend_dir  := -1
            
    else if asy_src asy_trend_line asy_vol_threshold
                asy_trend_line 
    := asy_src asy_vol_threshold 0.25
                asy_trend_dir  
    := 1

    // Dφnόώ Teyitleri
    bool turned_bullish asy_trend_dir == 1  and asy_trend_dir[1] == -1
    bool turned_bearish 
    asy_trend_dir == -and asy_trend_dir[1] == 1
    bool is_reversal    
    asy_trend_dir != asy_prev_dir and bar_index 0

    // Trend ηizgisi plot edilmiyor, sadece dφnόώ anύnda hedef belirleniyor
    color rev_color asy_trend_dir == #00ffaa48 : #ff00003c

    // Reversal Noktasύ: Sadece trend yφn deπiώtirdiπinde o barύn altύna/όstόne 'β¦Ώ' koyar
    plotchar(is_reversal ? (asy_trend_dir == low high) : na
             
    "KKM Reversal""β¦Ώ"location location.absolute
             
    color rev_colorsize size.huge)

    // //////
    // 0. MERKEZέ FONKSέYONLAR (Sύfύr Gecikme Motoru)
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    f_zlema(series float srcsimple int len) =>
        
    float ema1 ta.ema(srclen)
        
    float ema2 ta.ema(ema1len)
        
    ema1 + (ema1 ema2)

    // 1. DέNAMέK YOΠUNLUK MOTORU (Zamanύ Deπil, Maddeyi Φlηer)
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    // Bu motor aynύ 1m verisini alύr ama ona farklύ kutle direnηleri uygular.
    f_kutu_kutle(int _atrLenfloat _atrMultfloat _mu) =>
        
    float threshold ta.atr(_atrLen) * _atrMult
        
    var float z na
        
    var float v 0.0
        
    if bar_index == 0
            z 
    := hl2
        
    else
            
    float zPrev z[1], float vPrev v[1]
            
    float zPred zPrev vPrev
            float zTemp 
    zPred _mu * (hl2 zPred)
            
    float diff zTemp zPrev
            
    if math.abs(diff) > threshold
                v 
    := math.sign(diff) * (math.abs(diff) - threshold)
            else
                
    := 0.0
            z 
    := zPrev v
        z

    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    // 2. KάTLE MATRέSέ (Camdan Ηeliπe Kurumsal Maliyetler)
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    // Aynύ 1 dakikalύk grafikte, merminin (fiyatύn) deleceπi katmanlar:
    float cam   f_kutu_kutle(11.00.05)   // CAM: Ηok kύrύlgan, mermi anύnda deler.

    float celik f_kutu_kutle(1,  0.010.01)  // ΗELέK: Komutanύn Tank Zύrhύ! (Delinmesi en zor)

    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    // 3. YOΠUNLUK ΗέZέMLERέ (Ekranύ Kirletmeden)
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    plot(celik"@yφrόk@"color=color.new(#d500f9, 0), linewidth=1, style=plot.style_stepline) // Mor

    plot(cam,   "yφrόk",   color=color.new(#f5f902, 0), linewidth=1, style=plot.style_stepline) // Beyaz

    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€

    group_ayna "Makro Duvarlar (Yin-Yang Ayna)"
    float h_start input.float(0.06"Hύzlύ SAR Baώlangύη"step=0.01group=group_ayna)
    float h_inc   input.float(0.06"Hύzlύ SAR έvme"step=0.01group=group_ayna)
    float h_max   input.float(0.30"Hύzlύ SAR Max"step=0.1group=group_ayna)
    int pivot_len input.int(10"Duvar Tespiti"group=group_ayna)

    color col_ayna color.new(color.gray0)

    // 4. YέN-YANG AYNASI VE MAKRO DUVARLAR
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    f_ozel_sar(src_hsrc_l_start_inc_max) =>
        var 
    int trend 0
        
    var float sar_val 0.0
        
    var float ep 0.0
        
    var float af 0.0
        
    if trend == and not na(src_h[1])
            
    trend   := src_h >= src_h[1] or src_l >= src_l[1] ? : -1
            sar_val 
    := trend src_l[1] : src_h[1]
            
    ep      := trend src_h[1] : src_l[1]
            
    af      := _start
        
    else
            
    float nextsar sar_val
            
    if trend 0
                
    if src_h[1] > ep
                    ep 
    := src_h[1]
                    
    af := math.min(_maxaf _inc)
                
    nextsar := sar_val af * (ep sar_val)
                
    nextsar := math.min(math.min(src_l[1], src_l[2]), nextsar)
                if 
    nextsar src_l
                    trend   
    := -1
                    nextsar 
    := ep
                    ep      
    := src_l
                    af      
    := _start
            
    else
                if 
    src_l[1] < ep
                    ep 
    := src_l[1]
                    
    af := math.min(_maxaf _inc)
                
    nextsar := sar_val af * (ep sar_val)
                
    nextsar := math.max(math.max(src_h[1], src_h[2]), nextsar)
                if 
    nextsar src_h
                    trend   
    := 1
                    nextsar 
    := ep
                    ep      
    := src_h
                    af      
    := _start
            sar_val 
    := nextsar
        
    [sar_valtrend]

    [
    sar_hizlitrend_hizli] = f_ozel_sar(highlowh_starth_inch_max)
    float ayna_hizli trend_hizli close math.abs(close sar_hizli) : close math.abs(close sar_hizli)

    float ph_ayna ta.pivothigh(ayna_hizlipivot_lenpivot_len)
    float pl_ayna ta.pivotlow(ayna_hizlipivot_lenpivot_len)

    var array<
    linemacro_up_walls = array.new<line>()
    var array<
    linemacro_dn_walls = array.new<line>()

    if 
    not na(ph_ayna)
        
    line w_up line.new(bar_index[pivot_len], ph_aynabar_indexph_aynacolor=color.new(#00e676, 0), width=1, style=line.style_dotted, extend=extend.right)
        
    array.push(macro_up_wallsw_up)
        if array.
    size(macro_up_walls) > 2
            line
    .delete(array.shift(macro_up_walls))

    if 
    not na(pl_ayna)
        
    line w_dn line.new(bar_index[pivot_len], pl_aynabar_indexpl_aynacolor=color.new(#ff1744, 0), width=1, style=line.style_dotted, extend=extend.right)
        
    array.push(macro_dn_wallsw_dn)
        if array.
    size(macro_dn_walls) > 2
            line
    .delete(array.shift(macro_dn_walls))

    plot(ayna_hizli"Ayna"color=col_aynalinewidth=1)

    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€

    grp_pos "PENCERE VE BOYUT AYARLARI"
    i_bars    input.int(50,    "Gφsterilecek Mum Sayύsύ"group=grp_posminval=10)
    i_width   input.int(100,   "Pencere Geniώliπi (Bar)"group=grp_posminval=20)
    i_offset  input.int(10,    "Yatay Uzaklύk (Saπa)",    group=grp_pos)
    i_vScale  input.float(35.0"Dikey Φlηekleme (%)",    group=grp_posstep=1.0)

    grp_style "RENKLER VE GΦRSELLέK"
    c_up      input.color(color.new(#00e676, 0), "Yόkseliώ Mumu", group=grp_style)
    c_down    input.color(color.new(#ff1744, 0), "Dόώόώ Mumu",    group=grp_style)
    c_bg      input.color(color.new(#0b0e14, 20), "Arka Plan Kutusu",group=grp_style)
    c_border  input.color(color.new(#ffffff, 80), "Pencere Ηerηevesi",group=grp_style)

    c_fillUp  input.color(color.new(#26a69a, 60), "Bulut (Yόkseliώ)", group=grp_style)
    c_fillDn  input.color(color.new(#ef5350, 60), "Bulut (Dόώόώ)",    group=grp_style)
    c_fillRng input.color(color.new(#888888, 60), "Bulut (Yatay)",     group=grp_style)

    // ========================================================================= //
    // ================== ICS 21 MATEMATέΠέ (YERLEήέK HESAPLAMA) =============== //
    // ========================================================================= //
    // Dizi (Array) kullanmadan, doπrudan zaman serisi όzerinden ηalύώύr. Ηφkmez.

    f_yz_sigma(len) =>
        
    float _yzOR math.log(open nz(close[1], open))
        
    float _yzCO math.log(close open)
        
    float _yzHO math.log(high open)
        
    float _yzHC math.log(high close)
        
    float _yzLO math.log(low  open)
        
    float _yzLC math.log(low  close)
        
    float _sqOR ta.variance(_yzORlen)
        
    float _sqCO ta.variance(_yzCOlen)
        
    float _sqRS ta.sma(_yzHO _yzHC _yzLO _yzLClen)
        
    float _k    0.34 / (1.34 + (len 1.0) / math.max(len 1.01.0))
        
    float _sq   nz(_sqOR) + _k nz(_sqCO) + (1.0 _k) * nz(_sqRS)
        
    math.max(math.sqrt(math.max(_sq0.0)), 1e-10)

    f_icsLine(p1x1p2x2targetXsig) =>
        
    float out p1
        
    if x1 != x2 and p1 and p2 and sig 1e-10
            float y1 
    math.log(p1) / sig
            float y2 
    math.log(p2) / sig
            float yT 
    y1 + (y2 y1) * (targetX x1) / (x2 x1)
            
    out := math.exp(yT sig)
        
    out

    f_icsAngle
    (p1x1p2x2sig) =>
        
    float out 0.0
        
    if x1 != x2 and p1 and p2 and sig 1e-10
            float y1 
    math.log(p1) / sig
            float y2 
    math.log(p2) / sig
            out 
    := math.atan((y2 y1) / (x2 x1)) * 180.0 math.pi
        out

    f_ics_calc
    () =>
        
    int P 21
        float sig 
    f_yz_sigma(20)
        
        
    float h0 ta.highest(highP), float l0 ta.lowest(lowP)
        
        if 
    bar_index 5
            
    [h0l00.0]
        else
            
    float h1 h0[P],   float l1 l0[P]
            
    float h2 h0[P*2], float l2 l0[P*2]
            
    float h3 h0[P*3], float l3 l0[P*3]
            
    float h4 h0[P*4], float l4 l0[P*4]

            
    float g0 = (h0 and l0 0) ? math.exp((math.log(h0) + math.log(l0)) / 2.0) : na
            float g1 
    = (h1 and l1 0) ? math.exp((math.log(h1) + math.log(l1)) / 2.0) : na
            float g2 
    = (h2 and l2 0) ? math.exp((math.log(h2) + math.log(l2)) / 2.0) : na
            float g3 
    = (h3 and l3 0) ? math.exp((math.log(h3) + math.log(l3)) / 2.0) : na
            float g4 
    = (h4 and l4 0) ? math.exp((math.log(h4) + math.log(l4)) / 2.0) : na

            int pd 
    g0 g1 : -1
            int seg 
    1
            
    if g0 != g1
                
    if (g1 g2 : (g1 g2 ? -0)) == pd
                    seg 
    := 2
                    
    if (g2 g3 : (g2 g3 ? -0)) == pd
                        seg 
    := 3
                        
    if (g3 g4 : (g3 g4 ? -0)) == pd
                            seg 
    := 4

            int cx0 
    int(-P/2), int cx1 cx0 Pint cx2 cx1 Pint cx3 cx2 Pint cx4 cx3 P

            float fHH 
    h0float fLH h0float fHL l0float fLL l0
            int xHH 
    cx0int xLH cx0int xHL cx0int xLL cx0

            
    if seg >= 1
                
    if h1 fHH
                    fHH 
    := h1xHH := cx1
                
    if h1 fLH
                    fLH 
    := h1xLH := cx1
                
    if l1 fHL
                    fHL 
    := l1xHL := cx1
                
    if l1 fLL
                    fLL 
    := l1xLL := cx1
            
    if seg >= 2
                
    if h2 fHH
                    fHH 
    := h2xHH := cx2
                
    if h2 fLH
                    fLH 
    := h2xLH := cx2
                
    if l2 fHL
                    fHL 
    := l2xHL := cx2
                
    if l2 fLL
                    fLL 
    := l2xLL := cx2
            
    if seg >= 3
                
    if h3 fHH
                    fHH 
    := h3xHH := cx3
                
    if h3 fLH
                    fLH 
    := h3xLH := cx3
                
    if l3 fHL
                    fHL 
    := l3xHL := cx3
                
    if l3 fLL
                    fLL 
    := l3xLL := cx3
            
    if seg >= 4
                
    if h4 fHH
                    fHH 
    := h4xHH := cx4
                
    if h4 fLH
                    fLH 
    := h4xLH := cx4
                
    if l4 fHL
                    fHL 
    := l4xHL := cx4
                
    if l4 fLL
                    fLL 
    := l4xLL := cx4

            int sLx 
    seg == cx1 seg == cx2 seg == cx3 cx4
            int sRx 
    cx0

            float endG 
    seg == g1 seg == g2 seg == g3 g4
            float ang 
    f_icsAngle(endGsLxg0sRxsig)

            
    int dir math.abs(ang) <= 0.5 pd

            float uY1 
    fHHfloat uY2 fHHfloat lY1 fLLfloat lY2 fLL
            
    if dir == 1
                uY1 
    := f_icsLine(fLHxLHfHHxHHsLxsig), uY2 := f_icsLine(fLHxLHfHHxHHsRxsig)
                
    lY1 := f_icsLine(fLLxLLfHLxHLsLxsig), lY2 := f_icsLine(fLLxLLfHLxHLsRxsig)
            else if 
    dir == -1
                uY1 
    := f_icsLine(fHHxHHfLHxLHsLxsig), uY2 := f_icsLine(fHHxHHfLHxLHsRxsig)
                
    lY1 := f_icsLine(fHLxHLfLLxLLsLxsig), lY2 := f_icsLine(fHLxHLfLLxLLsRxsig)

            
    float uYa f_icsLine(uY1sLxuY2sRx0sig)
            
    float lYa f_icsLine(lY1sLxlY2sRx0sig)

            [
    uYalYafloat(dir)]

    // O anki mumun bulut deπerlerini global olarak alύyoruz
    [uYalYabulut_yon] = f_ics_calc()

    // ========================================================================= //
    // =========================== ΗέZέM MOTORU (HέYERARήέ) ==================== //
    // ========================================================================= //

    var box[]   kutu_bg     = array.new_box()
    var 
    line[]  cizgi_merkez= array.new_line()
    var 
    box[]   kutu_bulut  = array.new_box()
    var 
    line[]  cizgi_mum   = array.new_line()
    var 
    box[]   kutu_mum    = array.new_box()
    var 
    label[] etiketler   = array.new_label()

    f_temizle() =>
        for 
    b in kutu_bg
            box
    .delete(b)
        for 
    l in cizgi_merkez
            line
    .delete(l)
        for 
    b in kutu_bulut
            box
    .delete(b)
        for 
    l in cizgi_mum
            line
    .delete(l)
        for 
    b in kutu_mum
            box
    .delete(b)
        for 
    lbl in etiketler
            label
    .delete(lbl)
        array.
    clear(kutu_bg), array.clear(cizgi_merkez), array.clear(kutu_bulut)
        array.
    clear(cizgi_mum), array.clear(kutu_mum), array.clear(etiketler)

    if 
    barstate.islast
        f_temizle
    ()
        
        
    // --- 1. ADIM: EKRANIN GENEL MATEMATέΠέ VE SINIRLARI ---
        
    float max_val high
        float min_val 
    low
        
        
    // Son 'i_bars' kadar mumu geηmiώe doπru tarayύp o bφlgenin Max ve Min deπerlerini buluyoruz
        
    for 0 to i_bars 1
            float _h 
    high[i], float _l low[i]
            
    float _u uYa[i],  float _d lYa[i]
            
            
    max_val := math.max(max_val_h)
            
    min_val := math.min(min_val_l)
            if 
    not na(_u)
                
    max_val := math.max(max_val_u), min_val := math.min(min_val_u)
            if 
    not na(_d)
                
    max_val := math.max(max_val_d), min_val := math.min(min_val_d)
                
        
    // Pencereyi nereye ηizeceπiz? Ekranύn mevcut yόksekliπini referans alύyoruz
        
    float hv ta.highest(high300)
        
    float lv ta.lowest(low300)
        
    float cr hv lv == syminfo.mintick 100 hv lv
        float my 
    = (hv lv) / 2
        
        float er 
    cr * (i_vScale 100)
        
    float top_y my er 2
        float bot_y 
    my er 2
        float mid_y 
    = (top_y bot_y) / 2

        int start_x 
    bar_index i_offset
        int end_x   
    start_x i_width
        int mid_x   
    = (start_x end_x) / 2
        
        float hr 
    max_val min_val == syminfo.mintick max_val min_val
        float ir 
    top_y bot_y
        
        
    // Mumlar arasύ geniώlik hesaplamasύ
        
    float bs float(i_width) / i_bars
        int box_w 
    math.max(1int(bs 2))

        
    // --- 2. ADIM: HέYERARήέK ΗέZέM ---
        
        // Hiyerarώi 1: Ana Pencere (Zemin)
        //array.push(kutu_bg, box.new(start_x, top_y, end_x, bot_y, border_color=c_border, bgcolor=c_bg))
        
        // Hiyerarώi 2: Merkez Denge Ηizgisi
        
    array.push(cizgi_merkezline.new(start_xmid_yend_xmid_ycolor=color.yellowstyle=line.style_dashed))

        
    // Hiyerarώi 3: Alt ve άst Max/Min Etiketleri
        
    array.push(etiketlerlabel.new(mid_xtop_y"Max: " str.tostring(max_valformat.mintick), color=color.new(color.black100), textcolor=color.redstyle=label.style_label_downsize=size.normal))
        array.
    push(etiketlerlabel.new(mid_xbot_y"Min: " str.tostring(min_valformat.mintick), color=color.new(color.black100), textcolor=color.limestyle=label.style_label_upsize=size.normal))

        
    //////////////////////////
    // 1. GέRDέLER
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    group_l1 "1. Kinetik Motor (Yφrόk)"
    int atrLen input.int(20"L1 Hafύza (ATR)"group=group_l1)
    float atrMult input.float(3.5"L1 Gόrόltό Duvarύ"step=0.1group=group_l1)
    float mu input.float(0.6"L1 Yakύnsaklύk (ΞΌ)"step=0.1group=group_l1)

    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    f_yoruk_pure() =>
        
    float threshold ta.atr(atrLen) * atrMult
        
    var float z na
        
    var float v 0.0
        
    if bar_index == 0
            z 
    := hl2
        
    else
            
    float zPrev z[1], float vPrev v[1]
            
    float zPred zPrev vPrev
            float zTemp 
    zPred mu * (hl2 zPred)
            
    float diff zTemp zPrev
            
    if math.abs(diff) > threshold
                v 
    := math.sign(diff) * (math.abs(diff) - threshold)
            else
                
    := 0.0
            z 
    := zPrev v
        z


    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    // GέRDέLER VE RENKLER
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€

    //color col_up  = input.color(#00e676, "Yόkseliώ Rengi (Yeώil)")
    //color col_dn  = input.color(#ff1744, "Dόώόώ Rengi (Kύrmύzύ)")
    //color col_mid = input.color(color.fuchsia, "Merkez Ηizgi Rengi")


    group_motor "Kinetik Zeminler (Trinity)"
    int len_fast input.int(5"Hύzlύ Zemin (Zemin 1)"group=group_motor)
    int len_slow input.int(20"Yavaώ Zemin (Zemin 2)"group=group_motor)

    group_dash "Gφsterge Paneli"
    bool show_dash input.bool(true"Paneli Gφster"group=group_dash)
    string dash_pos input.string("Top Right""Panel Konumu"options=["Top Right""Top Left""Bottom Right""Bottom Left"], group=group_dash)

    group_kin "Renk Paleti"

    col_flat input.color(#787b86, "Flat (Nφtr)", group=group_kin)
    col_eq input.color(#ff9800, "Merkez Pivot (Turuncu Denge)", group=group_kin)

    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    // 1. MOTOR: L1 KέNETέK FέLTRE (ANA BASELINE)
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    float threshold ta.atr(atrLen) * atrMult
    var float z na
    var float v 0.0

    if bar_index == 0
        z 
    := close
    else
        
    float zPrev z[1], float vPrev v[1]
        
    float zPred zPrev vPrev
        float zTemp 
    zPred mu * (close zPred)
        
    float diff zTemp zPrev
        
    if math.abs(diff) > threshold
            v 
    := math.sign(diff) * (math.abs(diff) - threshold)
        else
            
    := 0.0
        z 
    := zPrev v

    ////////////

    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    // 2. MOTOR: TRINITY ZEMέNLER (5 - 20)
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    float fast_floor ta.hma(zlen_fast)
    float slow_floor ta.hma(zlen_slow)

    bool is_bull fast_floor slow_floor




    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    // 3. ANALέZ: άΗLά KAVUήUM (YάZEN PέVOT AΠI) VE SέNYAL TAKέBέ
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    isEq55(v1v2) => math.abs(v1 v2) <= syminfo.mintick
    bool trinity_aligned 
    isEq55(zfast_floor) and isEq55(zslow_floor)

    var 
    float last_eq_val na
    var float last_eq_step na

    // Ηizgi ve Etiket Deπiώkenleri
    var line line_p na,  var label lbl_p na
    var line line_r1 na, var label lbl_r1 na
    var line line_r2 na, var label lbl_r2 na
    var line line_r3 na, var label lbl_r3 na
    var line line_s1 na, var label lbl_s1 na
    var line line_s2 na, var label lbl_s2 na
    var line line_s3 na, var label lbl_s3 na

    if trinity_aligned
        last_eq_val 
    := z
        last_eq_step 
    := threshold // L1'in kendi gόrόltό duvarύ mesafesi

    // Kavuώum (Denge) deπeri varsa, yόzen aπύ her an gόncelle
    if not na(last_eq_val)
        
    int ext 10 // Ηizgilerin uzayacaπύ bar sayύsύ
        
        
    float val_p  last_eq_val
        float val_r1 
    last_eq_val last_eq_step 1
        float val_r2 
    last_eq_val last_eq_step 2
        float val_r3 
    last_eq_val last_eq_step 3
        float val_s1 
    last_eq_val last_eq_step 1
        float val_s2 
    last_eq_val last_eq_step 2
        float val_s3 
    last_eq_val last_eq_step 3

        
    if na(line_p)
            
    // Ηizgiler
            
    line_p  := line.new(bar_indexval_p,  bar_index extval_p,  color=col_eqwidth=2style=line.style_dotted)
            
    line_r1 := line.new(bar_indexval_r1bar_index extval_r1color=color.new(col_dn30), width=1style=line.style_dotted)
            
    line_r2 := line.new(bar_indexval_r2bar_index extval_r2color=color.new(col_dn30), width=1style=line.style_dotted)
            
    line_r3 := line.new(bar_indexval_r3bar_index extval_r3color=color.new(col_dn30), width=1style=line.style_dotted)
            
    line_s1 := line.new(bar_indexval_s1bar_index extval_s1color=color.new(col_up30), width=1style=line.style_dotted)
            
    line_s2 := line.new(bar_indexval_s2bar_index extval_s2color=color.new(col_up30), width=1style=line.style_dotted)
            
    line_s3 := line.new(bar_indexval_s3bar_index extval_s3color=color.new(col_up30), width=1style=line.style_dotted)
            
            
    // Etiketler
            
    lbl_p  := label.new(bar_index extval_p,  "P: " str.tostring(val_pformat.mintick),  color=color.new(color.white100), textcolor=col_eqstyle=label.style_label_leftsize=size.normal)
            
    lbl_r1 := label.new(bar_index extval_r1"R1: " str.tostring(val_r1format.mintick), color=color.new(color.white100), textcolor=col_dnstyle=label.style_label_leftsize=size.normal)
            
    lbl_r2 := label.new(bar_index extval_r2"R2: " str.tostring(val_r2format.mintick), color=color.new(color.white100), textcolor=col_dnstyle=label.style_label_leftsize=size.normal)
            
    lbl_r3 := label.new(bar_index extval_r3"R3: " str.tostring(val_r3format.mintick), color=color.new(color.white100), textcolor=col_dnstyle=label.style_label_leftsize=size.normal)
            
    lbl_s1 := label.new(bar_index extval_s1"S1: " str.tostring(val_s1format.mintick), color=color.new(color.white100), textcolor=col_upstyle=label.style_label_leftsize=size.normal)
            
    lbl_s2 := label.new(bar_index extval_s2"S2: " str.tostring(val_s2format.mintick), color=color.new(color.white100), textcolor=col_upstyle=label.style_label_leftsize=size.normal)
            
    lbl_s3 := label.new(bar_index extval_s3"S3: " str.tostring(val_s3format.mintick), color=color.new(color.white100), textcolor=col_upstyle=label.style_label_leftsize=size.normal)
        else
            
    // Aπύ ve etiketleri her bar saπa kaydύr
            
    line.set_xy1(line_p,  bar_indexval_p),  line.set_xy2(line_p,  bar_index extval_p)
            
    line.set_xy1(line_r1bar_indexval_r1), line.set_xy2(line_r1bar_index extval_r1)
            
    line.set_xy1(line_r2bar_indexval_r2), line.set_xy2(line_r2bar_index extval_r2)
            
    line.set_xy1(line_r3bar_indexval_r3), line.set_xy2(line_r3bar_index extval_r3)
            
    line.set_xy1(line_s1bar_indexval_s1), line.set_xy2(line_s1bar_index extval_s1)
            
    line.set_xy1(line_s2bar_indexval_s2), line.set_xy2(line_s2bar_index extval_s2)
            
    line.set_xy1(line_s3bar_indexval_s3), line.set_xy2(line_s3bar_index extval_s3)
            
            
    label.set_xy(lbl_p,  bar_index extval_p),  label.set_text(lbl_p,  "P: " str.tostring(val_pformat.mintick))
            
    label.set_xy(lbl_r1bar_index extval_r1), label.set_text(lbl_r1"R1: " str.tostring(val_r1format.mintick))
            
    label.set_xy(lbl_r2bar_index extval_r2), label.set_text(lbl_r2"R2: " str.tostring(val_r2format.mintick))
            
    label.set_xy(lbl_r3bar_index extval_r3), label.set_text(lbl_r3"R3: " str.tostring(val_r3format.mintick))
            
    label.set_xy(lbl_s1bar_index extval_s1), label.set_text(lbl_s1"S1: " str.tostring(val_s1format.mintick))
            
    label.set_xy(lbl_s2bar_index extval_s2), label.set_text(lbl_s2"S2: " str.tostring(val_s2format.mintick))
            
    label.set_xy(lbl_s3bar_index extval_s3), label.set_text(lbl_s3"S3: " str.tostring(val_s3format.mintick))

    // Sinyal Takibi (L1 Yφn Deπiώimi)
    var int trendL1 0
    if z[1]
        
    trendL1 := 1
    else if z[1]
        
    trendL1 := -1

    var string last_sig_type "-"
    var float last_sig_price na

    if ta.change(trendL1) != 0
        last_sig_type 
    := trendL1 == "AL" "SAT"
        
    last_sig_price := close

    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    // 4. GΦRSEL TERMέNAL (DASHBOARD)
    // β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    var pos dash_pos == "Bottom Right" position.top_left dash_pos == "Top Left" position.top_left dash_pos == "Bottom Right" position.bottom_right position.bottom_left
    var table dash55 table.new(pos27bgcolor=color.new(#131722, 10), border_width=1, border_color=color.new(#363a45, 50), frame_color=color.new(#363a45, 50), frame_width=1)

    if show_dash and barstate.islast
        
    // Baώlύk
        
    table.cell(dash5500"@yφrόk@ 2026 Gemini Pro Eπitim Ηalύώmasύdύr."bgcolor=color.new(#2962ff, 50), text_color=color.white, text_size=size.normal, text_halign=text.align_center)
        
    table.merge_cells(dash550010)
        
        
    // Deπerler
        
    table.cell(dash5501"Fiyat"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5511str.tostring(closeformat.mintick), text_color=color.whitetext_size=size.normal)
        
        
    table.cell(dash5502"0"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5512str.tostring(zformat.mintick), text_color=color.silvertext_size=size.normal)
        
        
    table.cell(dash5503"(1) | (2)"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5513str.tostring(fast_floorformat.mintick) + " | " str.tostring(slow_floorformat.mintick), text_color=color.aquatext_size=size.normal)
        
        
    // άηlό Kavuώum (Denge Noktasύ)
        
    table.cell(dash5504"(Denge)"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5514na(last_eq_val) ? "-" str.tostring(last_eq_valformat.mintick), text_color=col_eqtext_size=size.normal)
        
        
    // Son Sinyal
        
    color sig_col last_sig_type == "AL" col_up last_sig_type == "SAT" col_dn color.gray
        table
    .cell(dash5505"Son Sinyal"text_color=color.graytext_size=size.normal)
        
    table.cell(dash5515last_sig_type " (" str.tostring(last_sig_priceformat.mintick) + ")"text_color=sig_coltext_size=size.normal)

        
    // Alt Bilgi
        
    table.cell(dash5506" Yatύrύm tavsiyesi DEΠέLDέR."text_color=color.new(color.white0), text_size=size.normal)
        
    table.merge_cells(dash550616)
    /////////////////////////// 
    Sύradan bir insan

Sayfa 415/418 έlkέlk ... 315365405413414415416417 ... SonSon

Yer έmleri

Yer έmleri

Gφnderi Kurallarύ

  • Yeni konu aηamazsύnύz
  • Konulara cevap yazamazsύnύz
  • Yazύlara ek gφnderemezsiniz
  • Yazύlarύnύzύ deπiώtiremezsiniz
  •