Artan
Azalan
lem
BIST 30
BIST 50
BIST 100
NASDAQ 100
Hisse Fiyat Fark% Hacim (TL) Dk / Yksek
119,90 10% 1,15 Mr 110,30 / 119,90
8,14 10% 2,46 Mr 7,54 / 8,14
3,63 10% 493,03 Mn 3,31 / 3,63
2.157,00 9.99% 561,40 Mn 1.965,00 / 2.157,00
34,80 9.99% 89,68 Mn 34,80 / 34,80
Hisse Fiyat Fark% Hacim (TL) Dk / Yksek
1.349,00 -9.95% 271,81 Mn 1.349,00 / 1.508,00
2,90 -9.94% 926,28 Mn 2,90 / 3,13
6,47 -9% 170,16 Mn 6,40 / 6,88
7,80 -8.24% 5,48 Mn 7,80 / 8,01
22,08 -7.07% 384,83 Mn 21,42 / 24,44
Hisse Fiyat Fark% Hacim (TL) Dk / Yksek
3,17 3.59% 31,84 Mr 3,03 / 3,32
329,75 3.94% 30,62 Mr 317,75 / 335,00
38,88 3.74% 11,99 Mr 37,14 / 39,10
15,00 3.88% 11,94 Mr 14,36 / 15,07
82,80 6.02% 10,99 Mr 77,40 / 83,20
Hisse Fiyat Fark% Hacim (TL) Dk / Yksek
19,17 3.18% 1,20 Mr 18,28 / 19,26
82,80 6.02% 10,99 Mr 77,40 / 83,20
414,75 0.91% 6,76 Mr 407,00 / 416,25
195,70 1.93% 8,45 Mr 189,40 / 197,60
764,00 2.41% 3,57 Mr 742,50 / 766,00
Hisse Fiyat Fark% Hacim (TL) Dk / Yksek
19,17 3.18% 1,20 Mr 18,28 / 19,26
82,80 6.02% 10,99 Mr 77,40 / 83,20
95,50 2.47% 553,49 Mn 92,75 / 95,65
118,50 2.16% 234,93 Mn 114,90 / 119,20
414,75 0.91% 6,76 Mr 407,00 / 416,25
Hisse Fiyat Fark% Hacim (TL) Dk / Yksek
19,17 3.18% 1,20 Mr 18,28 / 19,26
31,90 3.5% 208,47 Mn 30,62 / 31,96
82,80 6.02% 10,99 Mr 77,40 / 83,20
10,92 2.06% 187,97 Mn 10,71 / 10,94
79,65 -2.15% 711,24 Mn 78,55 / 82,95

Masrafsz Bankaclk + 1.000 TL Nakit! Enparadan ifte Avantaj

Masrafsz Bankaclk + 1.000 TL Nakit! Enparadan ifte Avantaj
Sayfa 384/393 lklk ... 284334374382383384385386 ... SonSon
Arama sonucu : 3139 madde; 3,065 - 3,072 aras.

Konu: Tradingview

  1. PHP Code:
    //@version=6
    strategy(":] z ST + Mizan 100 (k Disiplini)"overlay=trueinitial_capital=10000default_qty_type=strategy.percent_of_equitydefault_qty_value=100commission_type=strategy.commission.percentcommission_value=0.04)

    // ==========================================
    // 1. AYARLAR 
    // ==========================================
    float ayar_genislik input.float(1.0"Ana Atmosfer arpan"minval=0.1maxval=2.0step=0.1)

    // ==========================================
    // 2. IKI DSPLN AYARLARI (YEN)
    // ==========================================
    float tp_carpan input.float(1.5"Kr Al (TP) arpan"step=0.1group="k Disiplini"tooltip="leme girerkenki atmosferin ka kat kr hedeflensin?")
    float sl_carpan input.float(1.0"Zarar Kes (SL) arpan"step=0.1group="k Disiplini"tooltip="leme girerkenki atmosferin ka kat terste kalnca ilem kapatlsn?")

    // ==========================================
    // 3. MOTOR BLOKLARI (PARAMETRELER)
    // ==========================================
    float s_fast_1 ta.sar(0.080.050.2
    float s_fast_2 ta.sar(0.010.050.2)
    float s_fast_3 ta.sar(0.040.040.2)
    float avg_fast = (s_fast_1 s_fast_2 s_fast_3) / 3

    // ==========================================
    // 4. YAPAY ZEKA (DL) ATMOSFER (GENLK HESABI)
    // ==========================================
    tanh_fn(v) => (math.exp(-v)) / (math.exp(-v))
    td_fn(s)   => nz((nz(s[1])) / nz(s[1]))

    var 
    w_c = array.from(22.4271, -26.69174.93719.0349, -10.6929, -38.288010.0500, -44.7063, -17.816330.5662, -33.995414.5017, -43.2865, -13.387424.7080, -14.392928.4830, -22.9793, -7.6582, -5.650528.8379, -26.35440.520625.0049, -17.8832, -4.8113, -4.0364, -8.3327, -1.15710.4667, -22.05333.6525, -4.39042.103020.027211.5101, -0.4150)
    n_in = array.from(tanh_fn(td_fn(open)), tanh_fn(td_fn(high)), tanh_fn(td_fn(low)), tanh_fn(td_fn(close)))

    f_calc_dl(n_arrw_arr) =>
        
    float out 0.0
        
    for 0 to 5
            float s 
    0.0
            
    for 0 to 3
                s 
    += array.get(n_arrj) * array.get(w_arr, (5) + j)
            
    out += tanh_fn(+ array.get(w_arr, (5) + 4)) * array.get(w_arr30 i)
        
    tanh_fn(out + array.get(w_arr36))
        
    float dl_val f_calc_dl(n_inw_c)
    float ai_factor = (0.2 + (math.abs(dl_val) * 0.5)) * ayar_genislik

    // Atmosferik Snr (Kalkan Genilii)
    float dist_base math.abs(close s_fast_1) * ai_factor
    float dist_swing  
    dist_base 2.0

    // ==========================================
    // 5. MZAN 100 (KADM EKSEN)
    // ==========================================
    f_hakiki_mizan(_sar_sm) =>
        
    float _delta math.abs(close _sar)
        
    float _raw close _sar close _delta close _delta
        float _mirror 
    ta.hma(_raw_sm)
        
    bool _dondu_asagi  _mirror _mirror[1] and _mirror[1] > _mirror[2]
        
    bool _dondu_yukari _mirror _mirror[1] and _mirror[1] < _mirror[2]
        var 
    float _tepe na
        
    var float _dip  na
        
    if _dondu_asagi
            _tepe 
    := _mirror[1]
        if 
    _dondu_yukari
            _dip 
    := _mirror[1]
        (
    _tepe _dip) / 2

    float mizan_100 
    f_hakiki_mizan(s_fast_1100)
    plot(mizan_100"Mizan 100 (Ana Eksen)"color=color.new(color.fuchsia0), linewidth=4)

    // ==========================================
    // 6. Z EKRDEK SUPERTREND (HIZLI GEZEGEN)
    // ==========================================
    float ust_band avg_fast dist_swing
    float alt_band 
    avg_fast dist_swing

    var int   oz_st_yon 1
    var float oz_st_cizgi na

    if oz_st_yon == 1
        oz_st_cizgi 
    := math.max(nz(oz_st_cizgi[1], alt_band), alt_band)
        if 
    close oz_st_cizgi
            oz_st_yon 
    := -1
            oz_st_cizgi 
    := ust_band
    else
        
    oz_st_cizgi := math.min(nz(oz_st_cizgi[1], ust_band), ust_band)
        if 
    close oz_st_cizgi
            oz_st_yon 
    := 1
            oz_st_cizgi 
    := alt_band

    bool mizan_AL_onayi  
    close mizan_100
    bool mizan_SAT_onayi 
    close mizan_100

    // SuperTrend Renginin Mizan'a taat Etmesi
    color oz_st_renk = (oz_st_yon == and mizan_AL_onayi) ? color.new(color.lime0) : 
                       (
    oz_st_yon == -and mizan_SAT_onayi) ? color.new(color.red0) : 
                       
    color.new(color.gray80

    plot(oz_st_cizgi"z SuperTrend"color=oz_st_renkstyle=plot.style_steplinelinewidth=2)

    // ==========================================
    // 7. KUSURSUZ TTFAK SNYALLER
    // ==========================================
    bool st_AL_kesti  oz_st_yon == and oz_st_yon[1] == -1
    bool st_SAT_kesti 
    oz_st_yon == -and oz_st_yon[1] == 1

    bool ittifak_AL  
    st_AL_kesti and mizan_AL_onayi
    bool ittifak_SAT 
    st_SAT_kesti and mizan_SAT_onayi

    plotshape
    (ittifak_AL,  title="MZAN+ST AL",  text="ST+M100\nAL",  style=shape.labelup,   location=location.belowbarcolor=color.rgb(0230119), textcolor=color.whitesize=size.normal)
    plotshape(ittifak_SATtitle="MZAN+ST SAT"text="ST+M100\nSAT"style=shape.labeldownlocation=location.abovebarcolor=color.rgb(2558282), textcolor=color.whitesize=size.normal)

    // ==========================================
    // 8. SAVA MEYDANI VE DNAMK IKI EMRLER
    // ==========================================
    // leme girdiimiz andaki atmosfer geniliini hafzaya al
    var float kayitli_mesafe na

    if ittifak_AL or ittifak_SAT
        kayitli_mesafe 
    := dist_swing

    if ittifak_AL
        strategy
    .entry("Kusursuz_AL"strategy.long)

    if 
    ittifak_SAT
        strategy
    .entry("Kusursuz_SAT"strategy.short)

    // ahini Geri arma (Dinamik TP / SL)
    if strategy.position_size 0
        float sl_seviyesi 
    strategy.opentrades.entry_price(0) - (kayitli_mesafe sl_carpan)
        
    float tp_seviyesi strategy.opentrades.entry_price(0) + (kayitli_mesafe tp_carpan)
        
    strategy.exit("AL_Kapat"from_entry="Kusursuz_AL"limit=tp_seviyesistop=sl_seviyesi)

    if 
    strategy.position_size 0
        float sl_seviyesi 
    strategy.opentrades.entry_price(0) + (kayitli_mesafe sl_carpan)
        
    float tp_seviyesi strategy.opentrades.entry_price(0) - (kayitli_mesafe tp_carpan)
        
    strategy.exit("SAT_Kapat"from_entry="Kusursuz_SAT"limit=tp_seviyesistop=sl_seviyesi)

    // MZA
    var table ytd_table table.new(position.bottom_center11)
    if 
    barstate.islast
        table
    .cell(ytd_table00"(A) eitim almasdr. Yatrm tavsiyesi KULLANILAMAZ."text_color=color.new(color.white50), text_size=size.small
    16.07.2024 - 10.12.2024

  2. bunlar paylama amacm...
    indikatr sinyali farkldr....

    ileme girip...strateji sonucu farkldr...

    fark...otomatik ilem ile manuel ilem fark gibidir...
    16.07.2024 - 10.12.2024

  3. paylalan son kodlarda deerleri istediiniz gibi deitirebilirsiniz....

    nk son paylatklarm...ai zellikli olanlarda....kendi almalarmdr...

    bilen paylar... nk paylaan, renmeye aktr....

    nk paylaan, asl kendisiyle yarr...
    kendini yeniler...evla olan...arar...

    u an...sar hesaplamal... bilinenin aksine yeni bir spertrend yazm durumdaym...

    ve bunu basnnla ilikilendirmi oldum...

    rnek x100 gnlkten

    0.3 basn https://www.tradingview.com/x/9fNvmDsf/
    0.5 basn https://www.tradingview.com/x/c2X5lmyh/
    1 basn https://www.tradingview.com/x/sacucPrW/
    2 basn https://www.tradingview.com/x/SJqJllNC/

    imdi strateji... 0.5 te girme... 1 stop ve 1.5 kar al.... eklindedir...

    yaplmas gereken.... ise stratejinin test edilip... yeni ve daha gzel sonular reten...genel hale getirilmesidir...
    Son dzenleme : @yrk@; 08-03-2026 saat: 22:12.
    16.07.2024 - 10.12.2024

  4. https://www.tradingview.com/x/lbx33s9C/ bu grnt arkadaki basn gsterir...

    not...
    tasarlanan sistem... olan yanstr....

    gemii kullanma veya gelecee hesaplama iermez....

    olan iler.... bu yzden repaint olmaz...
    16.07.2024 - 10.12.2024

  5. https://www.tradingview.com/x/eRfzjTC0/ bu grnt ise

    kullandm botla beraber olan...
    16.07.2024 - 10.12.2024

  6. son olarak...spertrendin...krlm basamaklar...destek diren gibi dnlr...
    dip-tepeler ise.... olas hedefler gibi...

    https://www.tradingview.com/x/EtJxvVZD/

    https://www.tradingview.com/x/9HUbNY5a/

    selamlar...
    16.07.2024 - 10.12.2024

  7. uzun bir ara vereceim iin...elimdeki son deneme almalarn....
    yedek amal....brakyorum.
    dileyenler.... gelitirip...testler yaparak....belki burada...ie yarayp..yaramad hususunda...
    tecrbelerini paylarlar....

    not... almalarn ou psar hesaplamayla ilgilidir.

    PHP Code:
    //@version=6
    indicator(":]"overlay=truemax_lines_count=50max_labels_count=500)
    ///////////////////////

    // ==========================================
    // 1. AYARLAR
    // ==========================================
    float ayar_genislik input.float(1.5"Genilik (0.1 - 2.0)"minval=0.1maxval=2.0step=0.1)

    // ==========================================
    // 2. ANA OMURGA MOTORU (HMA 55)
    // ==========================================
    float s_start_sabit 0.02
    float s_inc_sabit   
    0.02
    float s_max_sabit   
    0.2
    int s_smooth_sabit  
    100

    f_katman_ana
    (_start_inc_max_smooth) =>
        
    float _sar ta.sar(_start_inc_max)
        
    float _delta math.abs(close _sar)
        
    bool _is_up  close _sar
        float _raw_mirror 
    _is_up close _delta close _delta
        ta
    .hma(_raw_mirror_smooth)

    float mirror_ana f_katman_ana(s_start_sabits_inc_sabits_max_sabits_smooth_sabit)

    // ==========================================
    // 3. MOTOR BLOKLARI (SAR PARAMETRELER)
    // ==========================================
    float s_slow_1 ta.sar(0.020.020.2)
    float s_slow_2 ta.sar(0.0150.0150.15)
    float s_slow_3 ta.sar(0.010.010.1)

    float s_fast_1 ta.sar(0.080.050.2
    float s_fast_2 ta.sar(0.010.050.2)
    float s_fast_3 ta.sar(0.040.040.2)
    float avg_fast = (s_fast_1 s_fast_2 s_fast_3) / 3

    // ==========================================
    // 4. YAPAY ZEKA (DL) MODL (SRTNMESZ)
    // ==========================================
    tanh_fn(v) => (math.exp(-v)) / (math.exp(-v))
    td_fn(s)   => nz((nz(s[1])) / nz(s[1]))

    float in_o tanh_fn(td_fn(open))
    float in_h tanh_fn(td_fn(high))
    float in_l tanh_fn(td_fn(low))
    float in_c tanh_fn(td_fn(close))

    float h0 tanh_fn((in_o 22.4271) + (in_h * -26.6917) + (in_l 4.9371) + (in_c 9.0349) - 10.6929)
    float h1 tanh_fn((in_o * -38.2880) + (in_h 10.0500) + (in_l * -44.7063) + (in_c * -17.8163) + 30.5662)
    float h2 tanh_fn((in_o * -33.9954) + (in_h 14.5017) + (in_l * -43.2865) + (in_c * -13.3874) + 24.7080)
    float h3 tanh_fn((in_o * -14.3929) + (in_h 28.4830) + (in_l * -22.9793) + (in_c * -7.6582) - 5.6505)
    float h4 tanh_fn((in_o 28.8379) + (in_h * -26.3544) + (in_l 0.5206) + (in_c 25.0049) - 17.8832)
    float h5 tanh_fn((in_o * -4.8113) + (in_h * -4.0364) + (in_l * -8.3327) + (in_c * -1.1571) + 0.4667)

    float dl_val tanh_fn((h0 * -22.0533) + (h1 3.6525) + (h2 * -4.3904) + (h3 2.1030) + (h4 20.0272) + (h5 11.5101) - 0.4150)
        
    float ai_factor = (0.2 + (math.abs(dl_val) * 0.5)) * ayar_genislik

    // ==========================================
    // 5. DNAMK RENKL ATMOSFER VE KALKAN
    // ==========================================
    bool all_fast_below = (close s_fast_1) and (close s_fast_2) and (close s_fast_3
    bool all_fast_above = (close s_fast_1) and (close s_fast_2) and (close s_fast_3

    color core_color all_fast_below color.new(color.green50) : 
                       
    all_fast_above color.new(color.red50) : 
                       
    color.new(color.yellow50)

    float dist_1 math.abs(close s_fast_1) * ai_factor
    float l1_top 
    close dist_1
    float l1_bot 
    close dist_1

    p1_top 
    plot(l1_top"st"display=display.none)
    p1_bot plot(l1_bot"Alt"display=display.none)
    fill(p1_topp1_botcolor=core_colortitle="Dinamik ekirdek ")

    int kalkan 0
    if close s_fast_1 
        kalkan 
    += 1
    if close s_fast_2 
        kalkan 
    += 1
    if close s_fast_3 
        kalkan 
    += 1

    if close s_fast_1 and close avg_fast
        kalkan 
    += 1
    if close s_fast_2 and close avg_fast
        kalkan 
    += 1
    if close s_fast_3 and close avg_fast
        kalkan 
    += 1

    color bar_col 
    na
    if kalkan >= 3
        bar_col 
    := close avg_fast color.rgb(0230119100) : color.rgb(2558282100)
    else if 
    kalkan == 2
        bar_col 
    := color.rgb(000)
    else
        
    bar_col := color.rgb(22364251100)

    barcolor(bar_col)

    // ==========================================
    // 6. ANA OMURGA RENK MANTII
    // ==========================================
    bool makro_al mirror_ana close
    color col_mirror_ana 
    na

    if makro_al
        
    if mirror_ana mirror_ana[1]
            
    col_mirror_ana := color.blue   
        
    else
            
    col_mirror_ana := color.lime   
    else
        if 
    mirror_ana mirror_ana[1]
            
    col_mirror_ana := color.yellow 
        
    else
            
    col_mirror_ana := color.red    

    // ==========================================
    // 7. HAFIZALI SNYAL MANTII VE TAKP
    // ==========================================
    bool is_sari = (col_mirror_ana == color.yellow)
    bool is_mavi = (col_mirror_ana == color.blue)

    var 
    int sinyal_durumu 
    bool kesin_al 
    false
    bool kesin_sat 
    false

    var string son_yon "BEKLENYOR"
    var float son_sinyal_fiyati na

    if barstate.isconfirmed
        
    if is_sari and sinyal_durumu != 1
            kesin_al 
    := true
            sinyal_durumu 
    := 1
            son_yon 
    := "AL"
            
    son_sinyal_fiyati := close
            
        
    if is_mavi and sinyal_durumu != -1
            kesin_sat 
    := true
            sinyal_durumu 
    := -1
            son_yon 
    := "SAT"
            
    son_sinyal_fiyati := close

    // ==========================================
    // 8. FT YNL EVREKA MANTII (TAVAN VE ZEMN)
    // ==========================================
    var float evreka_tepe na
    var float evreka_dip na

    // Renklere deil, dorudan ekirdei oluturan matematiksel manta kilitledik!
    bool is_green_core all_fast_below
    bool is_red_core 
    all_fast_above

    // TAVAN: Yeil atmosferin en yksek noktas
    if is_green_core
        evreka_tepe 
    := na(evreka_tepe) ? l1_top math.max(evreka_tepel1_top)

    // ZEMN: Krmz atmosferin en dk noktas
    if is_red_core
        evreka_dip 
    := na(evreka_dip) ? l1_bot math.min(evreka_dipl1_bot)

    // TREND DNNDE HAFIZALARI SIFIRLAMA
    if close s_slow_1
        evreka_tepe 
    := na
    if close s_slow_1
        evreka_dip 
    := na

    // KIRILIMLAR
    bool evreka_direnc_kirilim ta.crossover(mirror_anaevreka_tepe) and barstate.isconfirmed
    bool evreka_destek_kirilim 
    ta.crossunder(mirror_anaevreka_dip) and barstate.isconfirmed

    // ==========================================
    // 9. GRSELLETRME VE ALARMLAR
    // ==========================================
    plot(mirror_ana"0"color=col_mirror_analinewidth=3style=plot.style_stepline)
    plot(evreka_tepe"+1"color=color.new(color.fuchsia100), style=plot.style_linebrlinewidth=2)
    plot(evreka_dip"-1"color=color.new(color.fuchsia100), style=plot.style_linebrlinewidth=2)

    //plotshape(kesin_al, "Sar Balad (AL)", shape.labelup, location.belowbar, color.rgb(255, 235, 59), text="L", textcolor=color.black, size=size.tiny)
    //plotshape(kesin_sat, "Mavi Balad (SAT)", shape.labeldown, location.abovebar, color.rgb(33, 150, 243), text="S", textcolor=color.white, size=size.tiny)

    // ift Ynl Evreka Bayraklar
    //plotshape(evreka_direnc_kirilim, "(@yrk@) DREN", shape.flag, location.abovebar, color.fuchsia, text="DR\n(@yrk@)", textcolor=color.fuchsia, size=size.small)
    //plotshape(evreka_destek_kirilim, "(@yrk@) DESTEK", shape.flag, location.belowbar, color.fuchsia, text="DES\n(@yrk@)", textcolor=color.fuchsia, size=size.small)

    //alertcondition(evreka_direnc_kirilim, title="💎 EVREKA (KOPU!)", message="Sistem: Ana Trend, ekirdek Tepeyi at!")
    //alertcondition(evreka_destek_kirilim, title="⚠️ EVREKA (K!)", message="Sistem: Ana Trend, ekirdek Dibi aa krd!")

    // ==========================================
    // 10. KOMUTA MERKEZ (DASHBOARD)
    // ==========================================
    var table dash table.new(position.top_right314border_width 1border_color color.new(color.gray80))

    if 
    barstate.islast
        table
    .cell(dash00"Yatrm Tavsiyesi DELDR."text_color=color.whitebgcolor=color.new(color.black20), text_size=size.normaltext_halign=text.align_center)
        
    table.merge_cells(dash0020)
        
        
    table.cell(dash01"Fiyat:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash11str.tostring(closeformat.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.merge_cells(dash1121)

        
    string sig_text son_yon == "BEKLENYOR" "YOK" son_yon " @ " str.tostring(son_sinyal_fiyatiformat.mintick)
        
    color sig_color son_yon == "AL" color.rgb(25523559) : son_yon == "SAT" color.rgb(33150243) : color.gray
        table
    .cell(dash02"Son Sinyal:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash12sig_texttext_color=sig_colorbgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.merge_cells(dash1222)

        
    table.cell(dash03"Trend:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash13str.tostring(mirror_anaformat.mintick), text_color=col_mirror_anabgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.merge_cells(dash1323)

        
    string evreka_tepe_str na(evreka_tepe) ? "BEKLENYOR" str.tostring(evreka_tepeformat.mintick)
        
    table.cell(dash04"Oto Diren:"text_color=color.fuchsiabgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash14evreka_tepe_strtext_color=color.fuchsiabgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.merge_cells(dash1424)

        
    string evreka_dip_str na(evreka_dip) ? "BEKLENYOR" str.tostring(evreka_dipformat.mintick)
        
    table.cell(dash05"Oto Destek:"text_color=color.fuchsiabgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash15evreka_dip_strtext_color=color.fuchsiabgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.merge_cells(dash1525)

        
    table.cell(dash06"--- A-HIZLI (@yrk@) ---"text_color=color.yellowbgcolor=color.new(color.black20), text_halign=text.align_center)
        
    table.merge_cells(dash0626)

        
    table.cell(dash07"1:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash17str.tostring(s_fast_1format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash27close s_fast_1 "AL" "SAT"text_color=close s_fast_1 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

        
    table.cell(dash08"2:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash18str.tostring(s_fast_2format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash28close s_fast_2 "AL" "SAT"text_color=close s_fast_2 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

        
    table.cell(dash09"3:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash19str.tostring(s_fast_3format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash29close s_fast_3 "AL" "SAT"text_color=close s_fast_3 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

        
    table.cell(dash010"--- A-YAVA (@yrk@) ---"text_color=color.yellowbgcolor=color.new(color.black20), text_halign=text.align_center)
        
    table.merge_cells(dash010210)

        
    table.cell(dash011"4:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash111str.tostring(s_slow_1format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash211close s_slow_1 "AL" "SAT"text_color=close s_slow_1 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

        
    table.cell(dash012"5:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash112str.tostring(s_slow_2format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash212close s_slow_2 "AL" "SAT"text_color=close s_slow_2 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

        
    table.cell(dash013"6:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash113str.tostring(s_slow_3format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash213close s_slow_3 "AL" "SAT"text_color=close s_slow_3 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

    var 
    table ytd_table table.new(position.bottom_center11)
    if 
    barstate.islast
        table
    .cell(ytd_table00"(A) - Eitim almasdr. Yatrm tavsiyesi KULLANILAMAZ."text_color=color.new(color.white00), text_size=size.small)
    ////////////////////

    // ┌────────────────────────────── 1. SEL TAZYK: PSAR ─────────────────────────────┐
    sarStart input.float(0.01"Basn Balangc")
    sarInc   input.float(0.02"Basn vmesi")
    sarMax   input.float(0.2"Maksimum Tazyik")
    psarVal  ta.sar(sarStartsarIncsarMax)

    // ┌────────────────────────────── 2. FZKSEL DREN: KABUK ─────────────────────────┐
    direncPeriyodu input.int(2"Kapakk (Snr) Periyodu")
    ustKapak ta.highest(highdirencPeriyodu)[1]
    altKapak ta.lowest(lowdirencPeriyodu)[1]

    // ┌────────────────────────────── 3. MTK-3: FTE KIRILIM ───────────────────────────┐
    ciftKirilimAtim    ta.crossover(closepsarVal) and (close ustKapak)
    ciftKirilimGevseme ta.crossunder(closepsarVal) and (close altKapak)

    // ┌────────────────────────────── 4. MUTLAK HEDEFLER (EVREKA) ───────────────────────┐
    // Tahmin (forecast) yok. Krlm anndaki mutlak gemi u nokta hedeftir.
    var float tepeHedef na
    var float dipHedef  na

    // Kan pompalandnda (Yukar Krlm), geride kalan en derin nefes boluu DP HEDEF olur.
    if ciftKirilimAtim
        dipHedef 
    := ta.lowest(lowdirencPeriyodu 2)[1]

    // Sistem gevediinde (Aa Krlm), geride kalan en ikin kapasite TEPE HEDEF olur.
    if ciftKirilimGevseme
        tepeHedef 
    := ta.highest(highdirencPeriyodu 2)[1]

    // ┌────────────────────────────── GRSELLETRME ────────────────────────────────────┐
    plot(psarVal"@yrk@"style=plot.style_crosscolor=close psarVal color.yellow color.bluelinewidth=2)

    //plot(ustKapak, "st Kapakk", color=color.new(color.gray, 60), style=plot.style_stepline)
    //plot(altKapak, "Alt Kapakk", color=color.new(color.gray, 60), style=plot.style_stepline)

    // Hedef izgileri (Gelecee uzanan sabit ller)
    plot(tepeHedef"O-Tepe "color=color.new(color.blue30), style=plot.style_linebrlinewidth=1)
    plot(dipHedef,  "O-Dip ",  color=color.new(color.yellow30), style=plot.style_linebrlinewidth=1)

    //plotshape(ciftKirilimAtim, "MTK-3 Atm", shape.triangleup, location.belowbar, color.teal, size=size.normal)
    //plotshape(ciftKirilimGevseme, "MTK-3 Geveme", shape.triangledown, location.abovebar, color.maroon, size=size.normal)

    // Daire Formu Dngs
    var int mtkDongu 0
    if ciftKirilimAtim
        mtkDongu 
    := 1
    else if ciftKirilimGevseme
        mtkDongu 
    := -1

    bgcolor
    (mtkDongu == color.new(color.lime90) : mtkDongu == -color.new(color.red90) : natitle="Dng Formu")

    ///////////////////////
    // ┌────────────────────────────── BOSWaves ─ Groups ─────────────────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    GRP_PSAR   "PSAR Settings"
    GRP_KMEANS "K-Means Regime Detection"
    GRP_KNN    "KNN Signal Validation"
    GRP_SMOOTH "Smoothing Settings"
    GRP_VISUAL "Visual Settings"


    // ┌────────────────────────────── BOSWaves ─ Tooltips ───────────────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    // ── PSAR ──
    const string tt_base_start     "The initial Acceleration Factor value when a new trend begins. Lower values make the SAR start further from price, giving the trend more room before flipping."
    const string tt_base_increment "How much the AF increases each time price makes a new extreme. Higher values cause the SAR to accelerate toward price more quickly as the trend matures."
    const string tt_base_max       "The maximum value the AF can reach. Caps how tightly the SAR trails price, preventing it from becoming too sensitive during extended trends."

    // ── K-Means ──
    const string tt_use_kmeans          "When enabled, the indicator classifies the market into choppy, neutral, or trending regimes and adjusts PSAR parameters accordingly. Disable to use fixed base AF values throughout."
    const string tt_training_period     "How many bars of historical data the regime classifier looks back over to measure flip frequency. Longer periods give more stable regime readings but are slower to react to market changes."
    const string tt_choppy_threshold    "Percentile of the flip-frequency range used as the choppy market centroid. At 0.75, a flip frequency in the upper 25% of its historical range is classified as choppy. Higher = harder to enter choppy regime."
    const string tt_trending_threshold  "Percentile of the flip-frequency range used as the trending market centroid. At 0.25, a flip frequency in the lower 25% of its historical range is classified as trending. Lower = harder to enter trending regime."

    // ── KNN ──
    const string tt_use_knn        "When enabled, each SAR flip is scored using K-Nearest Neighbors on historical flips. The score reflects how often similar past setups led to a successful reversal. Disable to treat all flips equally."
    const string tt_k_neighbors    "How many of the closest historical matches to include when computing the confidence score. More neighbors = smoother, more stable scores. Fewer = more sensitive to individual historical examples."
    const string tt_knn_lookback   "How far back (in bars) the KNN search scans for historical flip comparisons. Larger values give the model more examples to learn from but increase computation time."
    const string tt_min_confidence "KNN confidence score threshold (0100). Flips scoring below this value are treated as low-confidence  they still appear on the chart but are excluded from high-confidence alerts."

    // ── Smoothing ──
    const string tt_use_af_smoothing  "Instead of incrementing the AF in discrete steps, this ramps it gradually using exponential smoothing. Produces a more fluid SAR line that is less prone to sudden jumps."
    const string tt_af_smooth_alpha   "Controls how quickly the AF ramps toward its target on each bar. 1.0 = no smoothing (instant step). 0.01 = very gradual ramp. Has no effect if AF Smoothing is disabled."
    const string tt_use_kalman        "Applies a Kalman filter to the SAR output to smooth the displayed dot positions. The filter snaps to the new SAR value on every flip so reversals are not delayed, then re-smooths from that point."
    const string tt_kalman_proc_noise "Controls how much the Kalman filter trusts the SAR's own dynamics versus measurements. Higher values cause the filter to adapt faster to SAR changes, reducing smoothing lag."
    const string tt_kalman_meas_noise "Controls how much the Kalman filter smooths the SAR line. Higher values apply more smoothing and make the line less responsive to each new SAR value. Lower values track the raw SAR more closely."
    const string tt_use_min_bars      "Prevents SAR flips from occurring unless the current trend has lasted at least a minimum number of bars. Reduces whipsaws in fast, choppy markets."
    const string tt_min_flip_bars     "The minimum number of bars a trend must run before a SAR flip is allowed. For example, 3 means the first two bars of a new trend are always protected from an immediate reversal."

    // ── Visual ──
    const string tt_bull_color             "Color used for the SAR dots, fill, and labels when the trend is bullish (SAR below price)."
    const string tt_bear_color             "Color used for the SAR dots, fill, and labels when the trend is bearish (SAR above price)."
    const string tt_show_confidence_labels "Displays the KNN confidence percentage next to each flip label. Green = 70%+, Orange = 5069%, Red = below 50%. Only visible when KNN Signal Scoring is enabled."
    const string tt_show_regime_labels     "Displays the current market regime as a number on each bar: 3 = Trending, 2 = Neutral, 1 = Choppy. Useful for understanding how the K-Means system is classifying the market in real time."





    // ┌────────────────────────────── BOSWaves ─ Inputs ─────────────────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    base_start     input.float(0.02"Base AF Start",     minval=0.001step=0.001group=GRP_PSARtooltip=tt_base_start)
    base_increment input.float(0.02"Base AF Increment"minval=0.001step=0.001group=GRP_PSARtooltip=tt_base_increment)
    base_max       input.float(0.2,  "Base AF Maximum",   step=0.01,                group=GRP_PSARtooltip=tt_base_max)

    use_kmeans         input.bool(true,  "Enable K-Means Adaptation",  group=GRP_KMEANStooltip=tt_use_kmeans)
    training_period    input.int(100,    "Training Data Period",        minval=20maxval=500group=GRP_KMEANStooltip=tt_training_period)
    choppy_threshold   input.float(0.75"Choppy Regime Percentile",   maxval=1,              group=GRP_KMEANStooltip=tt_choppy_threshold)
    trending_threshold input.float(0.25"Trending Regime Percentile"maxval=1,              group=GRP_KMEANStooltip=tt_trending_threshold)

    use_knn        input.bool(true,  "Enable KNN Signal Scoring",  group=GRP_KNNtooltip=tt_use_knn)
    k_neighbors    input.int(8,      "K - Number of Neighbors",    minval=1maxval=50,  group=GRP_KNNtooltip=tt_k_neighbors)
    knn_lookback   input.int(200,    "Historical Lookback Period"minval=50maxval=500group=GRP_KNNtooltip=tt_knn_lookback)
    min_confidence input.float(15.0"Minimum Confidence Filter",  minval=0maxval=100,  group=GRP_KNNtooltip=tt_min_confidence)

    use_af_smoothing         input.bool(true,  "Enable AF Smoothing",                    group=GRP_SMOOTHtooltip=tt_use_af_smoothing)
    af_smooth_alpha          input.float(0.01"AF Smoothing Factor (lower = smoother)"minval=0.01step=0.05group=GRP_SMOOTHtooltip=tt_af_smooth_alpha)
    use_kalman               input.bool(true,  "Enable Kalman Filter",                   group=GRP_SMOOTHtooltip=tt_use_kalman)
    kalman_process_noise     input.float(0.015"Kalman Process Noise",                  minval=0.001maxval=0.5,  step=0.005group=GRP_SMOOTHtooltip=tt_kalman_proc_noise)
    kalman_measurement_noise input.float(0.5,   "Kalman Measurement Noise",              minval=0.01,  maxval=5.0,  step=0.1,   group=GRP_SMOOTHtooltip=tt_kalman_meas_noise)
    use_min_bars             input.bool(true,  "Enable Minimum Bars Filter",             group=GRP_SMOOTHtooltip=tt_use_min_bars)
    min_flip_bars            input.int(3,      "Minimum Bars Before Flip",               minval=1maxval=20group=GRP_SMOOTHtooltip=tt_min_flip_bars)

    bull_color             input.color(#00C8FF, "Bullish",                group=GRP_VISUAL, inline="col", tooltip=tt_bull_color)
    bear_color             input.color(#FF005D, "Bearish",                group=GRP_VISUAL, inline="col", tooltip=tt_bear_color)
    show_confidence_labels input.bool(true,     "Show Confidence Scores"group=GRP_VISUALtooltip=tt_show_confidence_labels)
    show_regime_labels     input.bool(true,     "Show Regime Numbers",    group=GRP_VISUALtooltip=tt_show_regime_labels)





    // ┌────────────────────────────── BOSWaves ─ Variables ──────────────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    var float sar               na
    var float af                na
    var float ep                na
    var int   trend             1
    var int   bars_since_flip   0
    var float af_at_last_flip   0.0
    var int   last_trend_duration 0
    var int   current_trend_bars 0
    var float ep_progress       0.0
    var float flip_ep           na
    var int   recent_flips      0
    var float signal_confidence 50.0

    // ── Kalman State Variables ──
    var float kalman_estimate na
    var float kalman_error    1.0

    // ┌────────────────────────────── BOSWaves ─ Initialization ─────────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    if na(sar)
        
    sar               := high[1]
        
    af                := base_start
        ep                
    := low
        trend             
    := -1
        bars_since_flip   
    := 0
        current_trend_bars 
    := 0

    bool raw_bull_flip 
    false
    bool raw_bear_flip 
    false

    current_trend_bars 
    += 1
    bars_since_flip    
    += 1

    // ┌────────────────────────────── BOSWaves ─ PSAR Calculation ───────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    if trend == 1
        
    if high ep
            ep_progress 
    := (high flip_ep) / nz(ta.atr(14), high low)
            
    ep          := high
            float target_af 
    math.min(af base_incrementbase_max)
            
    af := use_af_smoothing af af_smooth_alpha * (target_af af) : target_af
        sar 
    := sar af * (ep sar)
        
    sar := math.min(sarlow[1])
        if 
    bar_index 1
            sar 
    := math.min(sarlow[2])
        if 
    close sar
            bool allow_flip 
    not use_min_bars or current_trend_bars >= min_flip_bars
            
    if allow_flip
                raw_bear_flip       
    := true
                last_trend_duration 
    := current_trend_bars
                af_at_last_flip     
    := af
                trend               
    := -1
                sar                 
    := ep
                flip_ep             
    := ep
                ep                  
    := low
                af                  
    := base_start
                current_trend_bars  
    := 0
                bars_since_flip     
    := 0
                ep_progress         
    := 0.0
                recent_flips        
    += 1
    else
        if 
    low ep
            ep_progress 
    := (flip_ep low) / nz(ta.atr(14), high low)
            
    ep          := low
            float target_af 
    math.min(af base_incrementbase_max)
            
    af := use_af_smoothing af af_smooth_alpha * (target_af af) : target_af
        sar 
    := sar af * (sar ep)
        
    sar := math.max(sarhigh[1])
        if 
    bar_index 1
            sar 
    := math.max(sarhigh[2])
        if 
    close sar
            bool allow_flip 
    not use_min_bars or current_trend_bars >= min_flip_bars
            
    if allow_flip
                raw_bull_flip       
    := true
                last_trend_duration 
    := current_trend_bars
                af_at_last_flip     
    := af
                trend               
    := 1
                sar                 
    := ep
                flip_ep             
    := ep
                ep                  
    := high
                af                  
    := base_start
                current_trend_bars  
    := 0
                bars_since_flip     
    := 0
                ep_progress         
    := 0.0
                recent_flips        
    += 1

    // ┌────────────────────────────── BOSWaves ─ Kalman Filter ──────────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    if na(kalman_estimate)
        
    kalman_estimate := sar
        kalman_error    
    := 1.0

    if use_kalman
        
    if raw_bull_flip or raw_bear_flip
            kalman_estimate 
    := sar
            kalman_error    
    := 1.0
        
    else
            
    float kalman_gain kalman_error / (kalman_error kalman_measurement_noise)
            
    kalman_estimate  := kalman_estimate kalman_gain * (sar kalman_estimate)
            
    kalman_error     := (1.0 kalman_gain) * kalman_error kalman_process_noise

    float display_sar 
    use_kalman kalman_estimate sar

    // ┌────────────────────────────── BOSWaves ─ K-Means Regime Detection ───────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    bool had_flip_long_ago = (raw_bull_flip[training_period] or raw_bear_flip[training_period])
    if 
    had_flip_long_ago
        recent_flips 
    -= 1
    recent_flips 
    := math.max(0recent_flips)

    float flip_frequency recent_flips training_period 100
    float ff_upper       
    ta.highest(flip_frequencytraining_period)
    float ff_lower       ta.lowest(flip_frequencytraining_period)

    float choppy_centroid   ff_lower + (ff_upper ff_lower) * choppy_threshold
    float neutral_centroid  
    ff_lower + (ff_upper ff_lower) * 0.5
    float trending_centroid 
    ff_lower + (ff_upper ff_lower) * trending_threshold

    float dist_to_choppy   
    math.abs(flip_frequency choppy_centroid)
    float dist_to_neutral  math.abs(flip_frequency neutral_centroid)
    float dist_to_trending math.abs(flip_frequency trending_centroid)

    int market_regime dist_to_choppy dist_to_neutral and dist_to_choppy dist_to_trending dist_to_trending dist_to_choppy and dist_to_trending dist_to_neutral 1

    // ┌────────────────────────────── BOSWaves ─ Adaptive Parameters ────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    float adaptive_start     use_kmeans ? (market_regime == base_start 0.5 market_regime == base_start 1.5 base_start) : base_start
    float adaptive_increment 
    use_kmeans ? (market_regime == base_increment 0.4 market_regime == base_increment 1.4 base_increment) : base_increment
    float adaptive_max       
    use_kmeans ? (market_regime == base_max 0.6 market_regime == base_max 1.3 base_max) : base_max

    if use_kmeans
        af 
    := math.min(afadaptive_max)

    // ┌────────────────────────────── BOSWaves ─ KNN Signal Validation ──────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    if use_knn and (raw_bull_flip or raw_bear_flip)
        
    float f1 bars_since_flip[1] / 50.0
        float f2 
    last_trend_duration 50.0
        float f3 
    af_at_last_flip base_max
        float f4 
    flip_frequency 10.0
        float f5 
    math.min(ep_progress[1], 5.0) / 5.0

        
    var distances = array.new_float()
        var 
    outcomes  = array.new_float()
        
    distances.clear()
        
    outcomes.clear()

        for 
    10 to knn_lookback
            
    if bar_index
                bool hist_bull_flip 
    trend[i] == and trend[1] == -1
                bool hist_bear_flip 
    trend[i] == -and trend[1] == 1

                
    if (raw_bull_flip and hist_bull_flip) or (raw_bear_flip and hist_bear_flip)
                    
    float h1 bars_since_flip[1] / 50.0
                    float h2 
    last_trend_duration[i] / 50.0
                    float h3 
    af_at_last_flip[i] / base_max
                    float h4 
    flip_frequency[i] / 10.0
                    float h5 
    math.min(ep_progress[1], 5.0) / 5.0

                    float dist 
    math.sqrt(math.pow(f1 h12) + math.pow(f2 h22) + math.pow(f3 h32) + math.pow(f4 h42) + math.pow(f5 h52))

                    
    float outcome 0.0
                    
    if 10
                        float price_change 
    = (close[5] - close[i]) / close[i]
                        if 
    raw_bull_flip and hist_bull_flip
                            outcome 
    := price_change 0.001 1.0 0.0
                        
    else if raw_bear_flip and hist_bear_flip
                            outcome 
    := price_change < -0.001 1.0 0.0

                    distances
    .push(dist)
                    
    outcomes.push(outcome)

        
    int n distances.size()
        if 
    1
            
    for 0 to math.min(k_neighbors1) - 1
                int   min_idx 
    i
                float min_val 
    distances.get(i)
                for 
    1 to n 1
                    
    if distances.get(j) < min_val
                        min_val 
    := distances.get(j)
                        
    min_idx := j
                
    if min_idx != i
                    float temp_dist 
    distances.get(i)
                    
    float temp_out  outcomes.get(i)
                    
    distances.set(idistances.get(min_idx))
                    
    outcomes.set(ioutcomes.get(min_idx))
                    
    distances.set(min_idxtemp_dist)
                    
    outcomes.set(min_idxtemp_out)

            
    float weighted_success 0.0
            float total_weight     
    0.0
            int   effective_k      
    math.min(k_neighborsn)

            for 
    0 to effective_k 1
                float dist   
    distances.get(i)
                
    float weight dist 0.0001 100.0 1.0 dist
                weighted_success 
    += outcomes.get(i) * weight
                total_weight     
    += weight

            
    if total_weight 0
                signal_confidence 
    := (weighted_success total_weight) * 100

    // ┌────────────────────────────── BOSWaves ─ Signal Logic ───────────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    bool bullish_flip raw_bull_flip
    bool bearish_flip 
    raw_bear_flip

    bool high_conf_bull 
    bullish_flip and (not use_knn or signal_confidence >= min_confidence)
    bool high_conf_bear bearish_flip and (not use_knn or signal_confidence >= min_confidence)
    bool low_conf_bull  bullish_flip and use_knn and signal_confidence min_confidence
    bool low_conf_bear  
    bearish_flip and use_knn and signal_confidence min_confidence

    // ┌────────────────────────────── BOSWaves ─ Plotting ───────────────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    color sar_color trend == bull_color bear_color

    plot
    (display_sar"Ai"sar_colorstyle=plot.style_circleslinewidth=2display=display.none)

    p_sar   plot(display_sar"SAR"color=sar_colorstyle=plot.style_circleslinewidth=2display=display.none)
    p_price plot(trend == low high"Price Anchor"color=color.new(sar_color100), display=display.none)

    int conf_transp int(90 signal_confidence 0.6)
    color conf_color color.new(sar_colorconf_transp)

    //fill(p_sar, p_price,
         //trend == 1 ? low : display_sar,
        // trend == 1 ? display_sar : high,
        // color.new(sar_color, conf_transp + 30),
         //conf_color,
         //title="Confidence Fill")





    // ┌────────────────────────────── BOSWaves ─ Labels ─────────────────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘



    // ── Confidence Score Labels ──
    if show_confidence_labels and use_knn and (bullish_flip or bearish_flip)
        
    //string conf_text      = str.tostring(math.round(signal_confidence)) + "%"
        
    color  conf_lbl_color signal_confidence >= 70 #00ff88 : signal_confidence >= 50 ? #ffaa00 : #ff4444
        
    label.new(bar_indextrend == display_sar ta.atr(14) * 0.8 display_sar ta.atr(14) * 0.8
             
    style=label.style_nonetextcolor=conf_lbl_colorsize=size.normal)

    // ── Regime Number Labels ──
    if show_regime_labels and bar_index == 0
        string regime_text  
    str.tostring(market_regime)
        
    color  regime_color color.from_gradient(market_regime 113color.new(sar_color00), color.new(sar_color00))
        
    label.new(bar_indextrend == display_sar ta.atr(14) * 1.5 display_sar ta.atr(14) * 1.5regime_text,
             
    style=label.style_nonetextcolor=regime_colorsize=size.normal)

    // ┌────────────────────────────── BOSWaves ─ Alerts ─────────────────────────────────┐
    // └──────────────────────────────────────────────────────────────────────────────────┘

    alertcondition(high_conf_bull and barstate.isconfirmed"ML PSAR Buy",          "ML PSAR Buy Signal {{ticker}} {{interval}}")
    alertcondition(high_conf_bear and barstate.isconfirmed"ML PSAR Sell",         "ML PSAR Sell Signal {{ticker}} {{interval}}")
    alertcondition(bullish_flip and signal_confidence >= 70 and barstate.isconfirmed"High Confidence Buy",  "High confidence ML PSAR Buy {{ticker}} {{interval}}")
    alertcondition(bearish_flip and signal_confidence >= 70 and barstate.isconfirmed"High Confidence Sell""High confidence ML PSAR Sell {{ticker}} {{interval}}")
    alertcondition(market_regime == and market_regime[1] != and barstate.isconfirmed"Choppy Market",   "Entered choppy market regime {{ticker}} {{interval}}")
    alertcondition(market_regime == and market_regime[1] != and barstate.isconfirmed"Trending Market""Entered trending market regime {{ticker}} {{interval}}")
    /////////////
    // ┌────────────────────────────── DASHBOARD ──────────────────────────────┐
    // ==========================================
    var table dash1 table.new(position.top_center23border_width 1border_color color.new(color.gray80))

    if 
    barstate.islast
        
    // Panel Bal
        
    table.cell(dash100"AI @yrk@"text_color=color.whitebgcolor=color.new(color.black20), text_size=size.normaltext_halign=text.align_center)
        
    table.merge_cells(dash10010)
        
        
    // AI PSAR Gncel Deeri
        
    table.cell(dash101"AI:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash111str.tostring(display_sarformat.mintick), text_color=sar_colorbgcolor=color.new(color.black40), text_halign=text.align_right)
        
        
    // Piyasa Vitesi (Rejimi)
        
    string vites_txt market_regime == "TESTERE" market_regime == "TREND" "NTR"
        
    color vites_col market_regime == color.red market_regime == color.lime color.yellow
        
        table
    .cell(dash102"Sonu:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash112vites_txttext_color=vites_colbgcolor=color.new(color.black40), text_halign=text.align_right
    16.07.2024 - 10.12.2024

  8. PHP Code:
    //@version=6
    indicator(":)"overlay=falsemax_lines_count=50max_labels_count=50)

    // ==========================================
    // 1. AYARLAR
    // ==========================================
    float ayar_genislik input.float(0.5"Genilik (0.1 - 2.0)"minval=0.1maxval=2.0step=0.1)

    // ==========================================
    // 2. MOTOR BLOKLARI (SAR PARAMETRELER)
    // ==========================================
    // --- Yava Motor (Ana Trend / Omurga) ---
    float s_slow_1 ta.sar(0.020.020.2)
    float s_slow_2 ta.sar(0.0150.0150.15)
    float s_slow_3 ta.sar(0.010.010.1)

    // --- Hzl Motor (Scalp / Nitro) ---
    float s_fast_1 ta.sar(0.080.050.2)
    float s_fast_2 ta.sar(0.010.050.2)
    float s_fast_3 ta.sar(0.040.040.2)
    float avg_fast = (s_fast_1 s_fast_2 s_fast_3) / 3

    // ==========================================
    // 3. YAPAY ZEKA (DL) MODL (ATMOSFER)
    // ==========================================
    tanh_fn(v) => (math.exp(-v)) / (math.exp(-v))
    td_fn(s)   => nz((nz(s[1])) / nz(s[1]))

    // Diziler ve dngler yerine dorudan hesaplanan giriler
    float in_o tanh_fn(td_fn(open))
    float in_h tanh_fn(td_fn(high))
    float in_l tanh_fn(td_fn(low))
    float in_c tanh_fn(td_fn(close))

    // Dmler
    float h0 tanh_fn((in_o 22.4271) + (in_h * -26.6917) + (in_l 4.9371) + (in_c 9.0349) - 10.6929)
    float h1 tanh_fn((in_o * -38.2880) + (in_h 10.0500) + (in_l * -44.7063) + (in_c * -17.8163) + 30.5662)
    float h2 tanh_fn((in_o * -33.9954) + (in_h 14.5017) + (in_l * -43.2865) + (in_c * -13.3874) + 24.7080)
    float h3 tanh_fn((in_o * -14.3929) + (in_h 28.4830) + (in_l * -22.9793) + (in_c * -7.6582) - 5.6505)
    float h4 tanh_fn((in_o 28.8379) + (in_h * -26.3544) + (in_l 0.5206) + (in_c 25.0049) - 17.8832)
    float h5 tanh_fn((in_o * -4.8113) + (in_h * -4.0364) + (in_l * -8.3327) + (in_c * -1.1571) + 0.4667)

    // Tek satrlk nihai sonu
    float dl_val tanh_fn((h0 * -22.0533) + (h1 3.6525) + (h2 * -4.3904) + (h3 2.1030) + (h4 20.0272) + (h5 11.5101) - 0.4150)
        
    float ai_factor = (0.2 + (math.abs(dl_val) * 0.5)) * ayar_genislik

    float dist_1 
    math.abs(close s_fast_1) * ai_factor
    float l1_top 
    close dist_1
    float l1_bot 
    close dist_1

    p1_top 
    plot(l1_top"st"display=display.none)
    p1_bot plot(l1_bot"Alt"display=display.none)
    fill(p1_topp1_botcolor=color.new(color.yellow60), title="ekirdek")

    // ==========================================
    // 4. KALKAN GC (MUM BOYAMA)
    // ==========================================
    int kalkan 0
    if close s_fast_1 
        kalkan 
    += 1
    if close s_fast_2 
        kalkan 
    += 1
    if close s_fast_3 
        kalkan 
    += 1

    if close s_fast_1 and close avg_fast
        kalkan 
    += 1
    if close s_fast_2 and close avg_fast
        kalkan 
    += 1
    if close s_fast_3 and close avg_fast
        kalkan 
    += 1

    color bar_col 
    na
    bool is_green 
    false
    bool is_red 
    false

    if kalkan >= 3
        
    if close avg_fast
            bar_col 
    := color.rgb(023011900)
            
    is_green := true
        
    else
            
    bar_col := color.rgb(255828200)
            
    is_red := true
    else if kalkan == 2
        bar_col 
    := color.blue
    else
        
    bar_col := color.fuchsia

    barcolor
    (bar_col)

    // ==========================================
    // 5. EVREKA MANTII (DREN VE DESTEK KIRILIMI)
    // ==========================================
    var float evreka_tepe na
    var float evreka_dip na

    // Yeil kalkandayken atmosferin en st noktasn hafzaya al (Tavan)
    if is_green
        evreka_tepe 
    := na(evreka_tepe) ? l1_top math.max(evreka_tepel1_top)

    // Krmz kalkandayken atmosferin en alt noktasn hafzaya al (Zemin)
    if is_red
        evreka_dip 
    := na(evreka_dip) ? l1_bot math.min(evreka_dipl1_bot)

    // Ana Trend (Yava 1) aa krldnda eski tepeyi sil
    if close s_slow_1
        evreka_tepe 
    := na

    // Ana Trend (Yava 1) yukar krldnda eski dibi sil
    if close s_slow_1
        evreka_dip 
    := na

    // Fiyat, hafzadaki tepeyi veya dibi krdnda bayra dik
    bool evreka_direnc_kirilim ta.crossover(closeevreka_tepe) and barstate.isconfirmed
    bool evreka_destek_kirilim 
    ta.crossunder(closeevreka_dip) and barstate.isconfirmed

    // ==========================================
    // 6. GRSELLETRME ZMLER
    // ==========================================
    plot(s_slow_1"4"style=plot.style_linecolor=color.new(color.yellow0), linewidth=2)
    plot(s_slow_2"5"style=plot.style_linecolor=color.new(color.blue0), linewidth=1)
    plot(s_slow_3"6"style=plot.style_linecolor=color.new(color.red0), linewidth=1)

    plot(s_fast_1"1"style=plot.style_crosscolor=color.new(color.yellow0), linewidth=2)
    plot(s_fast_2"2"style=plot.style_crosscolor=color.new(color.blue0), linewidth=1)
    plot(s_fast_3"3"style=plot.style_crosscolor=color.new(color.red0), linewidth=1)

    // Evreka izgileri ve Bayraklar
    plot(evreka_tepe"Dir"color=color.new(color.fuchsia100), style=plot.style_linebrlinewidth=2)
    plot(evreka_dip"Des"color=color.new(color.fuchsia100), style=plot.style_linebrlinewidth=2)

    plotshape(evreka_direnc_kirilim"(@yrk@) DREN"shape.flaglocation.abovebarcolor.fuchsiatext="(@yrk@)\n(YUKARI)"textcolor=color.fuchsiasize=size.small)
    plotshape(evreka_destek_kirilim"(@yrk@) DESTEK"shape.flaglocation.belowbarcolor.fuchsiatext="(@yrk@)\n(AAI)"textcolor=color.fuchsiasize=size.small)

    // ==========================================
    // 7. KOMUTA MERKEZ (DASHBOARD)
    // ==========================================
    var table dash table.new(position.top_right312border_width 1border_color color.new(color.gray80))

    if 
    barstate.islast
        
    // Balk
        
    table.cell(dash00"Yatrm Tavsiyesi DELDR."text_color=color.whitebgcolor=color.new(color.black20), text_size=size.normaltext_halign=text.align_center)
        
    table.merge_cells(dash0020)
        
        
    // Fiyat
        
    table.cell(dash01"Fiyat:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash11str.tostring(closeformat.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.merge_cells(dash1121)

        
    // Evreka Direnci (Tavan)
        
    string evreka_str na(evreka_tepe) ? "HESAPLANIYOR" str.tostring(evreka_tepeformat.mintick)
        
    table.cell(dash02"Oto Diren:"text_color=color.fuchsiabgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash12evreka_strtext_color=color.fuchsiabgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.merge_cells(dash1222)

        
    // Evreka Destei (Zemin) - YEN
        
    string evreka_dip_str na(evreka_dip) ? "HESAPLANIYOR" str.tostring(evreka_dipformat.mintick)
        
    table.cell(dash03"Oto Destek:"text_color=color.fuchsiabgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash13evreka_dip_strtext_color=color.fuchsiabgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.merge_cells(dash1323)

        
    // --- HIZLI SARLAR BALIK ---
        
    table.cell(dash04"--- A- HIZLI (@yrk@) ---"text_color=color.yellowbgcolor=color.new(color.black20), text_halign=text.align_center)
        
    table.merge_cells(dash0424)

        
    // Hzl 1, 2, 3
        
    table.cell(dash05"1:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash15str.tostring(s_fast_1format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash25close s_fast_1 "AL" "SAT"text_color=close s_fast_1 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

        
    table.cell(dash06"2:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash16str.tostring(s_fast_2format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash26close s_fast_2 "AL" "SAT"text_color=close s_fast_2 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

        
    table.cell(dash07"3:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash17str.tostring(s_fast_3format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash27close s_fast_3 "AL" "SAT"text_color=close s_fast_3 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

        
    // --- YAVA SARLAR BALIK ---
        
    table.cell(dash08"--- A- YAVA (@yrk@) ---"text_color=color.yellowbgcolor=color.new(color.black20), text_halign=text.align_center)
        
    table.merge_cells(dash0828)

        
    // Yava 1, 2, 3
        
    table.cell(dash09"4:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash19str.tostring(s_slow_1format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash29close s_slow_1 "AL" "SAT"text_color=close s_slow_1 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

        
    table.cell(dash010"5:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash110str.tostring(s_slow_2format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash210close s_slow_2 "AL" "SAT"text_color=close s_slow_2 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

        
    table.cell(dash011"6:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash111str.tostring(s_slow_3format.mintick), text_color=color.whitebgcolor=color.new(color.black40), text_halign=text.align_right)
        
    table.cell(dash211close s_slow_3 "AL" "SAT"text_color=close s_slow_3 color.lime color.redbgcolor=color.new(color.black40), text_halign=text.align_center)

    var 
    table ytd_table table.new(position.bottom_center11)
    if 
    barstate.islast
        table
    .cell(ytd_table00"(A) - Eitim almasdr. Yatrm tavsiyesi KULLANILAMAZ."text_color=color.new(color.white00), text_size=size.small)
    //////
    // ==========================================
    f_katman_ana(_start_inc_max_smooth) =>
        
    float _sar ta.sar(_start_inc_max)
        
    float _delta math.abs(close _sar)
        
    bool _is_up  close _sar
        float _raw_mirror 
    _is_up close _delta close _delta
        ta
    .hma(_raw_mirror_smooth)

    float mirror_ana f_katman_ana(0.020.020.22)

    // Ana omurga izgisi
    plot(mirror_ana"0"color=color.new(color.white00), linewidth=1
    16.07.2024 - 10.12.2024

Sayfa 384/393 lklk ... 284334374382383384385386 ... SonSon

Yer mleri

Yer mleri

Gnderi Kurallar

  • Yeni konu aamazsnz
  • Konulara cevap yazamazsnz
  • Yazlara ek gnderemezsiniz
  • Yazlarnz deitiremezsiniz
  •