Artan
Azalan
έώlem
BIST 30
BIST 50
BIST 100
NASDAQ 100
Hisse Fiyat Fark% Hacim (TL) Dόώόk / Yόksek
34,10 10% 56,18 Mn 30,92 / 34,10
7,04 10% 588,94 Mn 6,42 / 7,04
1.331,00 10% 111,95 Mn 1.234,00 / 1.331,00
3,85 10% 381,06 Mn 3,53 / 3,85
52,80 10% 292,41 Mn 47,98 / 52,80
Hisse Fiyat Fark% Hacim (TL) Dόώόk / Yόksek
14,22 -10% 1,40 Mr 14,22 / 16,50
1.067,00 -9.96% 334,06 Mn 1.067,00 / 1.303,00
307,75 -9.95% 252,30 Mn 307,75 / 348,00
120,40 -9.41% 1,70 Mr 119,70 / 128,00
6,73 -7.81% 543,00 Mn 6,60 / 7,08
Hisse Fiyat Fark% Hacim (TL) Dόώόk / Yόksek
297,50 3.3% 13,15 Mr 296,00 / 300,50
2,70 1.89% 8,97 Mr 2,62 / 2,73
341,75 -0.94% 8,34 Mr 340,50 / 354,75
65,40 2.83% 8,09 Mr 63,70 / 66,05
39,48 2.07% 7,50 Mr 38,90 / 40,70
Hisse Fiyat Fark% Hacim (TL) Dόώόk / Yόksek
19,54 1.35% 613,06 Mn 19,10 / 19,65
65,40 2.83% 8,09 Mr 63,70 / 66,05
401,75 -2.01% 6,15 Mr 396,00 / 413,00
341,75 -0.94% 8,34 Mr 340,50 / 354,75
378,75 -3.56% 4,16 Mr 375,75 / 397,50
Hisse Fiyat Fark% Hacim (TL) Dόώόk / Yόksek
19,54 1.35% 613,06 Mn 19,10 / 19,65
65,40 2.83% 8,09 Mr 63,70 / 66,05
96,90 0.62% 384,70 Mn 96,05 / 98,00
105,00 0.86% 253,69 Mn 103,50 / 105,60
401,75 -2.01% 6,15 Mr 396,00 / 413,00
Hisse Fiyat Fark% Hacim (TL) Dόώόk / Yόksek
19,54 1.35% 613,06 Mn 19,10 / 19,65
33,82 -0.94% 99,77 Mn 33,56 / 34,74
65,40 2.83% 8,09 Mr 63,70 / 66,05
10,65 0.85% 209,13 Mn 10,48 / 10,70
77,95 0.32% 372,67 Mn 77,00 / 79,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 23/23 έlkέlk ... 13212223
Arama sonucu : 183 madde; 177 - 183 arasύ.

Konu: @yφrόk@’όn Heybesinden

  1.  Alύntύ Originally Posted by @yφrόk@ Yazύyύ Oku
    5 farklύ stratejiniz var... yapacaπύnύz en bόyόk hata....

    hepsini birleώtirmeye kalkmak....

    ya da...

    hepsinden alύp... en iyi bir taneyi yapmaya ηalύώmak....


    o zaman soru....
    bir elinizde bir parmak olsa mύ daha iyi kullanύrdύnύz....

    ya da... beώ parmak olunca mύ...

    cevap belli...

    φyleyse...

    htf robota karώύ...

    en mantύklύ yol....

    en iyi 5 stratejinizi belirleyip....

    stratejik hub yapmaktύr ki...

    bulunduπu periyotta... hub kendi seηsin....

    deπil mi...
    dikkat edilecek nokta ise TW sadece tek strateji okur... ve tabloya belirtir...
    birden fazla ηalύώmaz...

    ώimdi kύsύtlanmύώ....
    rastgele... 3 koda... strateji yazύlmύώ... ve όηό hub olarak birleώtirilmiώ....
    ama otomatik seηim eklenmemiώ...
    sadece seηtiπinizin... sonucunu tabloda belirten....

    basit bir kalύp φrneπi....
    amaη bu tarz kalύplarύ... kendiniz geliώtirmek uygulamak iηin...

    basit bir φrnek....
    PHP Code:
    // © Kinetik Komuta Merkezi - OMEGA-HUB MULTI-ENGINE MATRIX
    //@version=6
    strategy("OMEGA-HUB Multi-Engine Matrix"overlay=trueinitial_capital=1000commission_type=strategy.commission.percentcommission_value=0.04max_bars_back=5000)

    // ── 1. ANA SEΗέCέ VE GLOBAL AYARLAR ─────────────────────────────────────────
    var string GRP_HUB  "🛸 OMEGA-HUB ANA KUMANDA"
    strat_mode input.string("V14.2 DayTrader""Aktif Savaώ Doktrini"options=["V14.2 DayTrader""AlphaTrend Matrix""KNN Mean Reversion"], group=GRP_HUB)
    tp_mult    input.float(3.0"Hedef Dalga Ηarpanύ (V14.2 έηin R)"group=GRP_HUB)

    // BIST Zaman Ayarlarύ (10:00 - 17:50 arasύ operasyon, 17:55 imha)
    bist_tz "Europe/Istanbul"
    hour(timebist_tz)
    minute(timebist_tz)
    bool is_trade_window = (>= 10) and (17 or (== 17 and <= 50))
    bool is_eod          = (== 17 and >= 55) or (>= 18)

    // Global Sinyal Hafύzasύ
    bool global_long       false
    bool global_short      
    false
    bool global_exit_long  
    false
    bool global_exit_short 
    false

    // ── 2. MOTOR 1: V14.2 CYBORG-SNIPER MOTORU ──────────────────────────────────
    var string GRP_V14 "🎯 Mod 1: Cyborg-Sniper Ayarlarύ"
    q_ratio input.float(0.002"Kalman Q Sabiti"group=GRP_V14)
    atrLen  input.int(14"Kalkan ATR Periyodu"group=GRP_V14)
    atrMult input.float(1.2"Kalkan Geniώliπi"group=GRP_V14)

    calc_kalman(float srcfloat p_statefloat p_cv) =>
        
    float q_process 0.1 q_ratio
        float k_gain 
    = (p_cv q_process) / (p_cv q_process 1.0 1e-10)
        
    float next_state nz(p_statesrc) + k_gain * (src nz(p_statesrc))
        
    float next_cov   = (k_gain) * (p_cv q_process)
        [
    next_statenext_cov]

    var 
    float kf_state close, var float p_cov 1.0
    [new_statenew_cov] = calc_kalman(closekf_statep_cov)
    kf_state := new_statep_cov := new_cov

    mirror_signal 
    ta.ema(kf_state10) - ta.ema(kf_state20)

    f_dbhf_sniper(srclm) =>
        var 
    float dbhf src
        float tau 
    ta.atr(l) * m
        float diff 
    src dbhf
        
    if diff tau
            dbhf 
    += (diff tau) * 0.1 
        
    else if diff < -tau
            dbhf 
    += (diff tau) * 0.1
        dbhf

    float kalkan 
    f_dbhf_sniper(hl2atrLenatrMult)

    bool v14_long  ta.crossover(mirror_signal0)
    bool v14_short ta.crossunder(mirror_signal0)

    // ── 3. MOTOR 2: ALPHATREND MOMENTUM MOTORU ──────────────────────────────────
    var string GRP_AT "⚡ Mod 2: AlphaTrend Ayarlarύ"
    coeff input.float(1.0"AlphaTrend ATR Ηarpanύ"step=0.1group=GRP_AT)
    AP    input.int(14"AlphaTrend Periyodu"minval=1group=GRP_AT)
    overrideSensitivity input.float(2.0"Kύrύlύm Hassasiyeti"step=0.1group=GRP_AT)

    float AT_ATR ta.sma(ta.trAP)
    float upT    low  AT_ATR coeff
    float downT  
    high AT_ATR coeff
    float mfiVal 
    ta.mfi(hlc3AP)

    float AlphaTrend 0.0
    AlphaTrend 
    := mfiVal >= 50 ? (upT nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : upT) : (downT nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : downT)

    var 
    int at_direction 1
    if AlphaTrend AlphaTrend[2]
        
    at_direction := 1
    else if AlphaTrend AlphaTrend[2]
        
    at_direction := -1

    bool isCrossUp   
    close[1] > AlphaTrend[1] and close[2] <= nz(AlphaTrend[2])
    bool isCrossDn   close[1] < AlphaTrend[1] and close[2] >= nz(AlphaTrend[2])
    bool _boMomentum = (math.abs(close[1] - close[2]) > AT_ATR[1] * overrideSensitivity)

    if 
    _boMomentum and isCrossUp
        at_direction 
    := 1
    else if _boMomentum and isCrossDn
        at_direction 
    := -1

    bool isTrendCrossUp 
    AlphaTrend AlphaTrend[2] and nz(AlphaTrend[1]) <= nz(AlphaTrend[3])
    bool isTrendCrossDn AlphaTrend AlphaTrend[2] and nz(AlphaTrend[1]) >= nz(AlphaTrend[3])
    bool buySignalk     isTrendCrossUp or (_boMomentum and isCrossUp)
    bool sellSignalk    isTrendCrossDn or (_boMomentum and isCrossDn)

    var 
    int K1 0, var int K2 0
    var int O1 0, var int O2 0
    O1 
    := buySignalk[1] ? O1 1
    O2 
    := sellSignalk[1] ? O2 1
    K1 
    := buySignalk K1 1
    K2 
    := sellSignalk K2 1

    bool at_long  
    buySignalk and O1 K2
    bool at_short 
    sellSignalk and O2 K1

    // ── 4. MOTOR 3: KNN YAPAY ZEKA (ORTALAMAYA DΦNάή) MOTORU ────────────────────
    var string GRP_KNN "🧠 Mod 3: KNN Yapay Zeka Ayarlarύ"
    k_val       input.int(60"K Komώu Sayύsύ"minval=5group=GRP_KNN)
    win_size    input.int(800"Geriye Dφnόk Tarama Penceresi"minval=50group=GRP_KNN)
    rev_window  input.int(6"Geri Dφnόώ Vadesi"minval=1group=GRP_KNN)
    p_dist      input.float(2.0"Minkowski p άssό"minval=1.0group=GRP_KNN)
    gauss_bw    input.float(1.5"Gaussian Bant Geniώliπi"minval=0.1group=GRP_KNN)
    prob_thresh input.float(0.65"Geri Dφnόώ έhtimal Eώiπi"minval=0.3group=GRP_KNN)

    f_zscore(srclen) =>
        
    _mu  ta.sma(src[1], len)
        
    _sig ta.stdev(src[1], len)
        (
    src _mu) / math.max(_sig1e-6)

    basis     ta.ema(close20)
    bb_std    ta.stdev(close20)
    bb_upper  basis 2.0 bb_std
    vol_ratio 
    volume math.max(ta.sma(volume[1], 20), 1)

    f_dist     = (close basis) / math.max(basis1e-6) * 100
    f_bb_pos   
    = (close basis) / math.max(bb_upper basis1e-6)
    f_rsi_dev  ta.rsi(close14) - 50.0
    f_body_cmp 
    math.abs(close open) / math.max(high low1e-6)
    f_vol_fade = -vol_ratio

    z1 
    f_zscore(f_distwin_size), z2 f_zscore(f_bb_poswin_size), z3 f_zscore(f_rsi_devwin_size)
    z4 f_zscore(f_body_cmpwin_size), z5 f_zscore(f_vol_fadewin_size)

    f_label() =>
        
    int lbl 0
        
    if close[rev_window] > basis[rev_window]
            
    bool touched false
            
    for 0 to rev_window 1
                
    if low[rev_window j] <= basis[rev_window j]
                    
    touched := true
            lbl 
    := touched 0
        
    else if close[rev_window] < basis[rev_window]
            
    bool touched false
            
    for 0 to rev_window 1
                
    if high[rev_window j] >= basis[rev_window j]
                    
    touched := true
            lbl 
    := touched ? -0
        lbl

    var float p_rev_above 0.0, var float p_rev_below 0.0
    var float[] dist_arr  = array.new_float(0)
    var 
    float[] label_arr = array.new_float(0)

    // CPU yόkόnό azaltmak iηin sadece KNN modu seηiliyken ηalύώtύrύlύr
    if strat_mode == "KNN Mean Reversion" and bar_index win_size rev_window
        
    array.clear(dist_arr), array.clear(label_arr)
        for 
    rev_window to win_size rev_window by rev_window
            float d 
    math.pow(math.pow(math.abs(z1 z1[i]), p_dist) + math.pow(math.abs(z2 z2[i]), p_dist) + math.pow(math.abs(z3 z3[i]), p_dist) + math.pow(math.abs(z4 z4[i]), p_dist) + math.pow(math.abs(z5 z5[i]), p_dist), 1.0 p_dist)
            array.
    push(dist_arrd), array.push(label_arrf_label()[i])
        
        
    int n_samples = array.size(dist_arr)
        if 
    n_samples >= k_val
            int
    [] sorted_idx = array.sort_indices(dist_arrorder.ascending)
            
    float sigma math.max(array.get(dist_arr, array.get(sorted_idxmath.min(math.max(1int(k_val 2)), n_samples 1))), 1e-6)
            
    float w_rev_above 0.0float w_rev_below 0.0
            float w_total_above 
    0.0float w_total_below 0.0
            
            
    for 0 to k_val 1
                int idx 
    = array.get(sorted_idxj)
                
    float d = array.get(dist_arridx)
                
    float lbl = array.get(label_arridx)
                
    float w math.exp(-math.pow(dgauss_bw) / (2.0 sigma sigma))
                if 
    lbl == 1
                    w_rev_above 
    += ww_total_above += w
                
    else if lbl == -1
                    w_rev_below 
    += ww_total_below += w
                
    else
                    if 
    z1[array.get(sorted_idxj)] > 0
                        w_total_above 
    += w
                    
    else
                        
    w_total_below += w
            p_rev_above 
    := w_total_above w_rev_above w_total_above 0.0
            p_rev_below 
    := w_total_below w_rev_below w_total_below 0.0

    bool knn_long  
    ta.crossover(p_rev_belowprob_thresh) and close basis
    bool knn_short 
    ta.crossover(p_rev_aboveprob_thresh) and close basis

    // ── 5. STRATEJέK HUBA BAΠLAMA VE YΦNLENDέRME (ROUTING) ───────────────────────
    if strat_mode == "V14.2 DayTrader"
        
    global_long       := v14_long
        global_short      
    := v14_short
        global_exit_long  
    := (close kalkan)
        
    global_exit_short := (close kalkan)
    else if 
    strat_mode == "AlphaTrend Matrix"
        
    global_long       := at_long
        global_short      
    := at_short
        global_exit_long  
    := (K1 K2 and close AlphaTrend)
        
    global_exit_short := (K2 K1 and close AlphaTrend)
    else if 
    strat_mode == "KNN Mean Reversion"
        
    global_long       := knn_long
        global_short      
    := knn_short
        global_exit_long  
    := ta.crossover(closebasis// Ortalamaya ulaώtύπύnda ηύkύώ
        
    global_exit_short := ta.crossunder(closebasis)

    // ── 6. EMέR έCRAATLARI (MάHάRLά REPAINTSέZ) ─────────────────────────────────
    if global_long and is_trade_window and barstate.isconfirmed
        strategy
    .entry("LONG"strategy.longcomment=strat_mode " Giriώ")
    if 
    global_short and is_trade_window and barstate.isconfirmed
        strategy
    .entry("SHORT"strategy.shortcomment=strat_mode " Giriώ")

    // Teknik Ηύkύώ ήartlarύ
    if strategy.position_size and global_exit_long and barstate.isconfirmed
        strategy
    .close("LONG"comment="Teknik Ηύkύώ")
    if 
    strategy.position_size and global_exit_short and barstate.isconfirmed
        strategy
    .close("SHORT"comment="Teknik Ηύkύώ")

    // BIST Gόn Sonu Acύmasύz έmha (17:55)
    if is_eod
        
    if strategy.position_size 0
            strategy
    .close("LONG"comment="G.S. Kapanύώ")
        if 
    strategy.position_size 0
            strategy
    .close("SHORT"comment="G.S. Kapanύώ")

    // ── 7. DARK-MODE ANALYTICS HUD RADAR PANELέ ─────────────────────────────────
    float kar_faktoru strategy.grossloss == ? (strategy.grossprofit 99.99 0.0) : (strategy.grossprofit strategy.grossloss)

    if 
    barstate.islast
        
    var table hud table.new(position.top_right24bgcolor=color.rgb(15152015), border_width=1border_color=color.rgb(454555))
        
    color hdrBg color.rgb(30304510)
        
    color altBg color.rgb(20202510)
        
        
    table.cell(hud00"🛸 OMEGA-HUB"text_color=color.whitetext_size=size.smallbgcolor=hdrBgtext_halign=text.align_left)
        
    table.cell(hud10"KOMUTA MERKEZέ"text_color=color.whitetext_size=size.smallbgcolor=hdrBgtext_halign=text.align_right)
        
    table.merge_cells(hud0010)
        
        
    table.cell(hud01"Aktif Doktrin"text_color=color.graytext_size=size.smallbgcolor=altBgtext_halign=text.align_left)
        
    table.cell(hud11strat_modetext_color=color.orangetext_size=size.smallbgcolor=altBgtext_halign=text.align_right)
        
        
    table.cell(hud02"Radar Durumu"text_color=color.graytext_size=size.smalltext_halign=text.align_left)
        
    table.cell(hud12strategy.position_size "LONG AKTέF" strategy.position_size "SHORT AKTέF" "PUSUDA"text_color=strategy.position_size != color.lime color.graytext_size=size.smalltext_halign=text.align_right)
        
        
    table.cell(hud03"Kβr Faktφrό (PF)"text_color=color.graytext_size=size.smallbgcolor=altBgtext_halign=text.align_left)
        
    table.cell(hud13str.tostring(kar_faktoru"#.##"), text_color=kar_faktoru >= 2.0 color.lime kar_faktoru >= 1.0 color.yellow color.redtext_size=size.smallbgcolor=altBgtext_halign=text.align_right)

    // VέZYON HATTI (Sadece Seηili Olan Ana Gφsterge Ηizilir)
    plot(strat_mode == "V14.2 DayTrader" kf_state na"Kalman Hattύ"color=color.whitelinewidth=1)
    plot(strat_mode == "V14.2 DayTrader" kalkan na"Sniper Kalkanύ"color=color.limelinewidth=2)
    plot(strat_mode == "AlphaTrend Matrix" AlphaTrend na"AlphaTrend Hattύ"color=at_direction == color.green color.redlinewidth=2)
    plot(strat_mode == "KNN Mean Reversion" basis na"KNN Basis MA"color=color.bluelinewidth=2
    16.07.2024 - 10.12.2024

  2. PHP Code:
    // © Kinetik Komuta Merkezi - V9.0 KUANTUM ARBέTRAJ MATRIX (AGPro Fusion)
    //@version=6
    strategy("V9.0 Kuantum Arbitraj Matrix"overlay=trueinitial_capital=10000default_qty_type=strategy.percent_of_equitydefault_qty_value=100commission_type=strategy.commission.percentcommission_value=0.04)

    // ═════════════════════════════════════════════════════════════════════════
    //  1. GέRDέLER VE ARBέTRAJ CEPHANESέ
    // ═════════════════════════════════════════════════════════════════════════
    grp_sym "Hedef Hisseler (Bacaklar)"
    sym1 input.symbol("BIST:MCARD""1. Hisse (Ana Grafikteki)"group=grp_sym)
    sym2 input.symbol("BIST:XU100""2. Hisse (Kύyaslanan)"group=grp_sym)

    grp_logic "AGPro Motor Ayarlarύ"
    zLength input.int(180"Z-Score Hafύzasύ (Lookback)"minval=60maxval=500group=grp_logic)
    entryZ  input.float(1.20"Taarruz Sύnύrύ (Entry Z)"step=0.1group=grp_logic)
    exitZ   input.float(0.80"Tahliye Sύnύrύ (Reversion Z)"step=0.1group=grp_logic)
    minIntegrity input.float(20.0"Minimum Gόvenlik Puanύ (Integrity)"minval=0.0maxval=100.0group=grp_logic)

    // BIST iηin φlό saatleri sόzme
    hide_session input.session("1810-0950""Gizlenecek Φlό Saatler"group="Zaman Kalkanύ")
    tz input.string("UTC+3""Saat Dilimi"group="Zaman Kalkanύ")
    in_hide_session not na(time(timeframe.periodhide_sessiontz))
    is_weekend = (dayofweek == dayofweek.saturday or dayofweek == dayofweek.sunday)
    should_hide is_weekend or in_hide_session

    // ═════════════════════════════════════════════════════════════════════════
    //  2. VERέ έSTέHBARATI VE TEMέZLEME
    // ═════════════════════════════════════════════════════════════════════════
    c1_raw request.security(sym1timeframe.periodclosegaps=barmerge.gaps_on)
    c2_raw request.security(sym2timeframe.periodclosegaps=barmerge.gaps_on)

    // Φlό saatleri filtrele (Veri zehirlenmesini φnle)
    var float c1 na
    var float c2 na
    if not should_hide and c1_raw and c2_raw 0
        c1 
    := c1_raw
        c2 
    := c2_raw

    // ═════════════════════════════════════════════════════════════════════════
    //  3. LOG-RASYO VE Z-SCORE ΗEKέRDEΠέ (AGPro)
    // ═════════════════════════════════════════════════════════════════════════
    float ratio = (not na(c1) and not na(c2)) ? (c1 c2) : na
    float logRatio 
    not na(ratio) ? math.log(ratio) : na

    float ratioMean 
    ta.sma(logRatiozLength)
    float ratioDev  ta.stdev(logRatiozLength)
    float zScore    ratioDev ? (logRatio ratioMean) / ratioDev na
    float absZ      
    math.abs(zScore)

    // ═════════════════════════════════════════════════════════════════════════
    //  4. INTEGRITY (GάVENLέK) VE QUALITY (KALέTE) HESAPLARI
    // ═════════════════════════════════════════════════════════════════════════
    // 4a. Korelasyon (Kardeώlik bozuldu mu?)
    float retA = (not na(c1) and not na(c1[1])) ? math.log(c1 nz(c1[1], c1)) : na
    float retB 
    = (not na(c2) and not na(c2[1])) ? math.log(c2 nz(c2[1], c2)) : na
    float pairCorr 
    ta.correlation(retAretB60)

    // 4b. Volatilite Geniώlemesi (Makas ηύldύrdύ mύ?)
    int shortLen 20
    float volShort 
    ta.stdev(logRatioshortLen)
    float volBase  ta.stdev(logRatio60)
    float volExpansion volBase volShort volBase na

    // 4c. Ortalama Kaymasύ (Drift)
    float meanDrift = (ratioDev and not na(ratioMean[20])) ? math.abs(ratioMean ratioMean[20]) / ratioDev na

    // Normaller ve Skorlama (0 ile 1 arasύ sύkύώtύrma)
    float corrNorm  na(pairCorr) ? 0.0 math.max(0math.min(1, (pairCorr 1.0) / 2.0))
    float driftNorm na(meanDrift) ? 0.0 math.max(0math.min(11.0 meanDrift 0.45))
    float volNorm   na(volExpansion) ? 0.0 math.max(0math.min(11.0 math.max(0volExpansion 1.0) / 0.45))

    float integrityScore math.max(0math.min(100100.0 * (0.45 corrNorm 0.30 driftNorm 0.25 volNorm)))
    bool  integrityOk    integrityScore >= minIntegrity

    float qualityScore 
    math.max(0math.min(100, (nz(absZ) / 2.40) * 42.0 integrityScore 0.48))

    // ═════════════════════════════════════════════════════════════════════════
    //  5. STRATEJέ FάZYONU (SAVAή ALANI)
    // ═════════════════════════════════════════════════════════════════════════
    // Z-Score eksi ise: 1. Hisse (....) ucuzlamύώtύr -> LONG
    bool t_long_giris = (zScore <= -entryZ) and integrityOk and barstate.isconfirmed
    // Z-Score artύ ise: 1. Hisse (....) pahalanmύώtύr -> SHORT
    bool t_short_giris = (zScore >= entryZ) and integrityOk and barstate.isconfirmed

    // Taarruz!
    if t_long_giris
        strategy
    .entry("LONG"strategy.long)
    if 
    t_short_giris
        strategy
    .entry("SHORT"strategy.short)

    // Tahliye (Reversion) - Makas dengeye gelince ηύk!
    if strategy.position_size and zScore >= -exitZ and barstate.isconfirmed
        strategy
    .close("LONG"comment="Makas Kapandύ (Denge)")
        
    if 
    strategy.position_size and zScore <= exitZ and barstate.isconfirmed
        strategy
    .close("SHORT"comment="Makas Kapandύ (Denge)")

    // Acil Durum Tahliyesi (Gόvenlik έhlali - Kardeώlik Bozulursa)
    if not integrityOk and absZ >= entryZ and strategy.position_size != and barstate.isconfirmed
        strategy
    .close_all(comment="INTEGRITY BLOCK! Acil Tahliye")

    // ═════════════════════════════════════════════════════════════════════════
    //  6. GΦRSELLEήTέRME VE HUD PANEL
    // ═════════════════════════════════════════════════════════════════════════
    // Operasyon Bar Renklendirmeleri (Aqua=Long, Fuchsia=Short, Gray=Pusu)
    color position_bar_col strategy.position_size color.new(color.aqua0) : strategy.position_size color.new(color.fuchsia0) : color.new(color.gray50)
    barcolor(position_bar_coltitle="Operasyon Bar Rengi")

    plotshape(t_long_giris and strategy.position_size <= 0"AL"shape.triangleuplocation.belowbarcolor.aquasize=size.small)
    plotshape(t_short_giris and strategy.position_size >= 0"SAT"shape.triangledownlocation.abovebarcolor.redsize=size.small
    16.07.2024 - 10.12.2024

  3. PHP Code:
    // © Kinetik Komuta Merkezi - V8.10 NέHAέ GANN MATRIX (Hatasύz Ηekirdek)
    //@version=6
    strategy("V8.10 Nihai Gann Matrix"overlay=trueinitial_capital=1000commission_type=strategy.commission.percentcommission_value=0.04)

    // ═════════════════════════════════════════════════════════════════════════
    //  1. GέRDέLER
    // ═════════════════════════════════════════════════════════════════════════
    grp_kalman "Kalman Radar Ayarlarύ"
    factor input.float(0.5"Ηift EMA Hύzύ"minval=0.1step=0.1group=grp_kalman)
    r_ratiob input.int(5"Yavaώ Kalman R"step=5group=grp_kalman)
    r_ratios input.int(20"Hύzlύ Kalman R"step=5group=grp_kalman)
    q_ratio input.float(0.002"Kalman Q Sabiti"step=0.001group=grp_kalman)

    i_period input.int(19"έzotropik Dόrbόn Periyodu"minval=5group="έzotropik Dόrbόn")

    // ═════════════════════════════════════════════════════════════════════════
    //  2. KALMAN VE έZOTROPέK KANAL (V8.3 SAF ΗEKέRDEK)
    // ═════════════════════════════════════════════════════════════════════════
    pine_ema(srclength) => 
        
    float alpha / (length 1)
        var 
    float sum na
        sum 
    := na(sum[1]) ? src alpha src + (alpha) * nz(sum[1])
        
    sum

    clamp
    (xab) => math.min(math.max(xa), b)

    calc_kalman(float srcfloat p_statefloat p_cvfloat R_rawfloat Q_raw) =>
        
    float q_process clamp(nz(Q_raw0.1), 0.00110.0) * q_ratio
        float r_adaptive 
    math.max(nz(R_raw1.0), 1.0)
        
    float current_p_cov p_cv q_process
        float k_gain 
    current_p_cov / (current_p_cov r_adaptive 1e-10)
        
    float next_state nz(p_statesrc) + k_gain * (src nz(p_statesrc))
        
    float next_cov   = (k_gain) * current_p_cov
        
    [next_statenext_cov]

    float ema_val pine_ema(pine_ema(closefactor), factor)
    float vol_base math.max(ta.atr(14), 1e-6)

    var 
    float kf_stateb na, var float p_covb 1.0
    float resb 
    ema_val nz(kf_stateb[1], ema_val)
    float res_varb math.pow(resb2) / math.pow(vol_base2)
    [
    new_valbnew_covb] = calc_kalman(ema_valkf_statebp_covbnz(ta.rma(res_varbr_ratiob), 1.0), nz(ta.rma(res_varb5), 0.1))
    kf_stateb := new_valbp_covb := new_covb
    float kalman_yavas 
    pine_ema(kf_stateb3)

    var 
    float kf_states na, var float p_covs 1.0
    float ress 
    ema_val nz(kf_states[1], ema_val)
    float res_vars math.pow(ress2) / math.pow(vol_base2)
    [
    new_valsnew_covs] = calc_kalman(ema_valkf_statesp_covsnz(ta.rma(res_varsr_ratios), 1.0), nz(ta.rma(res_vars5), 0.1))
    kf_states := new_valsp_covs := new_covs
    float kalman_hizli 
    pine_ema(kf_states5)

    bool makro_boga kalman_hizli kalman_yavas
    bool makro_ayi 
    kalman_hizli kalman_yavas

    float iso_chUp 
    ta.highest(highi_period)[1]
    float iso_chLo ta.lowest(lowi_period)[1]
    bool tavan_kirildi close iso_chUp
    bool taban_kirildi 
    close iso_chLo

    // Orijinal DBHF Kalkanύ
    f_dbhf_sniper(srcatrLenatrMultenterMultexitMultresponse) =>
        var 
    float dbhf na
        
    if na(dbhf)
            
    dbhf := src
        float tauEnter 
    ta.atr(atrLen) * atrMult enterMult
        float diff 
    src dbhf
        
    if diff tauEnter
            dbhf 
    += response * (diff tauEnter)
        else if 
    diff < -tauEnter
            dbhf 
    += response * (diff tauEnter)
        
    dbhf

    float dbhf_macro_cizgi 
    f_dbhf_sniper(hl2141.51.00.50.1)

    // ═════════════════════════════════════════════════════════════════════════
    //  3. SέNYALLER VE έZ SάREN STOP (HATASIZ)
    // ═════════════════════════════════════════════════════════════════════════
    bool t_long_giris makro_boga and tavan_kirildi and barstate.isconfirmed
    bool t_short_giris 
    makro_ayi and taban_kirildi and barstate.isconfirmed

    if t_long_giris
        strategy
    .entry("LONG"strategy.long)
    if 
    t_short_giris
        strategy
    .entry("SHORT"strategy.short)

    var 
    float iz_suren_stop na

    // BUG DάZELTέLDέ: nz fonksiyonuna DBHF referans gφsterilerek kilitlenme ηφzόldό
    if strategy.position_size 0
        iz_suren_stop 
    := math.max(nz(iz_suren_stop[1], dbhf_macro_cizgi), dbhf_macro_cizgi)
        if 
    close iz_suren_stop and barstate.isconfirmed
            strategy
    .close("LONG"comment="Kalkan Delindi")
    else if 
    strategy.position_size 0
        iz_suren_stop 
    := math.min(nz(iz_suren_stop[1], dbhf_macro_cizgi), dbhf_macro_cizgi)
        if 
    close iz_suren_stop and barstate.isconfirmed
            strategy
    .close("SHORT"comment="Kalkan Delindi")
    else
        
    iz_suren_stop := na 

    // ═════════════════════════════════════════════════════════════════════════
    //  4. GANN KOZMέK PROJEKSέYON (MUM BAZLI - ΦLά SAAT YUTUCU)
    // ═════════════════════════════════════════════════════════════════════════
    var int b_anchor1 na
    var int b_anchor2 na
    var int dongu_uzunlugu na

    bool is_new_entry 
    = (t_long_giris and strategy.position_size <= 0) or (t_short_giris and strategy.position_size >= 0)

    if 
    is_new_entry
        b_anchor1 
    := nz(b_anchor2bar_index)
        
    b_anchor2 := bar_index
        
    if b_anchor1 != b_anchor2
            dongu_uzunlugu 
    := b_anchor2 b_anchor1

    var int gann_faz 0
    int tepeye_kalan_bar 
    na
    int dibe_kalan_bar 
    na

    if not na(dongu_uzunlugu) and dongu_uzunlugu 0
        int gecen_bar 
    bar_index b_anchor2
        int dongu_ici_bar 
    gecen_bar dongu_uzunlugu
        
        
    // Dφngόnόn Yarύsύ Boπa, Yarύsύ Ayύ
        
    int tepe_noktasi math.round(dongu_uzunlugu 0.50)
        
        if 
    dongu_ici_bar <= tepe_noktasi
            gann_faz 
    := 1
            tepeye_kalan_bar 
    := tepe_noktasi dongu_ici_bar
        
    else
            
    gann_faz := -1
            dibe_kalan_bar 
    := dongu_uzunlugu dongu_ici_bar

    bgcolor
    (gann_faz == color.new(color.green96) : gann_faz == -color.new(color.red96) : natitle="Dinamik Gann Zemin")

    // ═════════════════════════════════════════════════════════════════════════
    //  5. GΦRSELLEήTέRME VE HUD PANEL
    // ═════════════════════════════════════════════════════════════════════════
    plot(iso_chUpcolor=color.new(color.aqua50), style=plot.style_stepline)
    plot(iso_chLocolor=color.new(color.red50), style=plot.style_stepline)
    plot(iz_suren_stop"έz Sόren Kalkan"color=strategy.position_size color.aqua color.fuchsialinewidth=2style=plot.style_stepline
    16.07.2024 - 10.12.2024

  4. PHP Code:
    // © Kinetik Komuta Merkezi - V16.1 OMEGA-STRIKE (Decay + Volatility + Momentum)
    //@version=6
    strategy("V16.1 Omega-Strike: Repaint-Free Sniper"overlay=trueinitial_capital=1000commission_type=strategy.commission.percentcommission_value=0.04)

    // ═════════════════════════════════════════════════════════════════════════
    // 1. GέRDέLER VE MATEMATέKSEL PARAMETRELER
    // ═════════════════════════════════════════════════════════════════════════
    grp_core "🧠 Ηekirdek Radar Ayarlarύ"
    lookback input.int(100"Tarama Periyodu"minval=20group=grp_core)
    decay_factor input.float(2.0"Zaman Zayύflama Ηarpanύ"step=0.5group=grp_core)

    grp_filters "🛡️ Volatilite & Momentum Filtreleri"
    atr_len input.int(14"Volatilite (ATR) Periyodu"group=grp_filters)
    vol_mult input.float(0.5"Kύrύlύm Gόcό (Gφvde/ATR Ηarpanύ)"step=0.1group=grp_filterstooltip="Kύrύlύm yapan mumun gφvdesi ATR'nin en az bu kadarύ olmalύ. (Sahte kύrύlύmlarύ eler)")
    rsi_len input.int(14"Momentum (RSI) Periyodu"group=grp_filters)

    // Hafύza
    var float dyn_res na
    var float dyn_sup na

    // ═════════════════════════════════════════════════════════════════════════
    // 2. ZAMAN ZAYIFLAMALI FέTέL (PRICE REJECTION) HESAPLAMASI (REPAINTSέZ)
    // ═════════════════════════════════════════════════════════════════════════
    if barstate.isconfirmed
        float max_decayed_uw 
    = -1.0
        float max_decayed_lw 
    = -1.0
        float temp_res 
    na
        float temp_sup 
    na
        
        
    // Tarama sadece kapanmύώ geηmiώ barlarda [1] yapύlύr (Repaint έmkansύzdύr)
        
    for 1 to lookback
            float upper_wick 
    high[i] - math.max(open[i], close[i])
            
    float lower_wick math.min(open[i], close[i]) - low[i]
            
            
    float weight math.exp(-decay_factor lookback)
            
            
    float decayed_uw upper_wick weight
            float decayed_lw 
    lower_wick weight
            
            
    if decayed_uw max_decayed_uw
                max_decayed_uw 
    := decayed_uw
                temp_res 
    := high[i]
                
            if 
    decayed_lw max_decayed_lw
                max_decayed_lw 
    := decayed_lw
                temp_sup 
    := low[i]
                
        
    dyn_res := temp_res
        dyn_sup 
    := temp_sup

    // ═════════════════════════════════════════════════════════════════════════
    // 3. FέLTRELER: VOLATέLέTE VE MOMENTUM MOTORU
    // ═════════════════════════════════════════════════════════════════════════
    float atr ta.atr(atr_len)
    float body_size math.abs(close open)
    float rsi ta.rsi(closersi_len)

    // Volatilite Kalkanύ Onayύ (Mum Gφvdesi yeterince dolgun mu?)
    bool vol_ok body_size >= (atr vol_mult)

    // Momentum έvme Onayύ
    bool mom_bull rsi 50
    bool mom_bear 
    rsi 50

    // ═════════════════════════════════════════════════════════════════════════
    // 4. έCRAAT MOTORU (TAM ONAYLI BREAKOUT)
    // ═════════════════════════════════════════════════════════════════════════
    // Kύrύlύm + Volatilite + Momentum + Kapanύώ Onayύ (Repaintsiz)
    bool long_breakout ta.crossover(closedyn_res) and vol_ok and mom_bull and barstate.isconfirmed
    bool short_breakout 
    ta.crossunder(closedyn_sup) and vol_ok and mom_bear and barstate.isconfirmed

    // Ηύkύώ (Stop/TP) ήartlarύ
    bool exit_long close dyn_sup and barstate.isconfirmed
    bool exit_short 
    close dyn_res and barstate.isconfirmed

    if long_breakout
        strategy
    .entry("LONG"strategy.longcomment="Zύrhlύ Kύrύlύm (L)")
    if 
    short_breakout
        strategy
    .entry("SHORT"strategy.shortcomment="Zύrhlύ Kύrύlύm (S)")

    if 
    exit_long
        strategy
    .close("LONG"comment="Hat Kύrύldύ (Ηύkύώ)")
    if 
    exit_short
        strategy
    .close("SHORT"comment="Hat Kύrύldύ (Ηύkύώ)")

    // ═════════════════════════════════════════════════════════════════════════
    // 5. GΦRSELLEήTέRME VE HUD RADARI
    // ═════════════════════════════════════════════════════════════════════════
    plot(dyn_res"Dinamik Direnη"color=color.rgb(2558282), style=plot.style_steplinelinewidth=2)
    plot(dyn_sup"Dinamik Destek"color=color.rgb(0230118), style=plot.style_steplinelinewidth=2)

    // Renkli Arka Plan
    color trend_color strategy.position_size color.new(color.rgb(0230118), 92) : strategy.position_size color.new(color.rgb(2558282), 92) : na
    bgcolor
    (trend_color
    16.07.2024 - 10.12.2024

  5. PHP Code:
    // © Kinetik Komuta Merkezi - V8.3 Cyborg-Kinetik-Kalman Fόzyon
    //@version=6
    strategy("V8.3 Cyborg-Kinetik-Kalman Matrix"overlay=trueinitial_capital=1000)

    // 1. GέRDέLER (V8.3 + Kalman + Kinetik)
    hPeriod input.int(13"Gann HIGH Period")
    lPeriod input.int(21"Gann LOW Period")
    q_ratio input.float(0.002"Kalman Q Sabiti"step=0.001// έzotropik Dόrbόn Hassasiyeti
    smoothLen  input.int(130"Kinetik ATR Smoothing")
    bandMult   input.float(3.0"Kinetik Band Multiplier")
    guardMult  input.float(5.0"Kinetik Guard Distance")

    // 2. KALMAN DάRBάN MOTORU (έzotropik Filtreleme)
    calc_kalman(float srcfloat p_statefloat p_cv) =>
        
    float q_process 0.1 q_ratio
        float k_gain 
    = (p_cv q_process) / (p_cv q_process 1.0 1e-10)
        
    float next_state nz(p_statesrc) + k_gain * (src nz(p_statesrc))
        
    float next_cov   = (k_gain) * (p_cv q_process)
        [
    next_statenext_cov]

    var 
    float kf_state close, var float p_cov 1.0
    [new_statenew_cov] = calc_kalman(closekf_statep_cov)
    kf_state := new_statep_cov := new_cov

    // 3. CYBORG GANN MOTORU (Kalman Filtreli Fiyat άzerinde)
    sma_high ta.sma(highhPeriod), sma_low ta.sma(lowlPeriod)
    var 
    int hl_direction 0
    // Sinyal, Kalman dόrbόnόnden sόzόlmόώ fiyat ile ηalύώύr
    hl_direction := kf_state nz(sma_low[1]) ? kf_state nz(sma_high[1]) ? -hl_direction
    float hi_lo 
    = (hl_direction == 1) ? sma_low sma_high

    // 4. KέNETέK STOP MOTORU (V11 Fόzyon)
    atrVal ta.atr(smoothLen)
    float volRatio atrVal ta.highest(atrVal50)
    float dynamicBuffer guardMult atrVal + (bandMult guardMult) * atrVal volRatio

    var float stopLine na
    var int trendDir 1
    float topBand 
    high dynamicBufferbottomBand low dynamicBuffer
    if na(stopLine)
        
    stopLine := trendDir == bottomBand topBand

    if trendDir == and close stopLine
        trendDir 
    := -1stopLine := topBand
    else if trendDir == -and close stopLine
        trendDir 
    := 1stopLine := bottomBand
    else
        
    stopLine := trendDir == math.max(stopLineclose bandMult atrVal) : math.min(stopLineclose bandMult atrVal)

    // 5. TETέKLEME
    bool t_long  ta.crossover(kf_statehi_lo) and barstate.isconfirmed
    bool t_short 
    ta.crossunder(kf_statehi_lo) and barstate.isconfirmed

    if t_long
        strategy
    .entry("LONG"strategy.longcomment="Cyborg-Kalman Giriώ")
    if 
    t_short
        strategy
    .entry("SHORT"strategy.shortcomment="Cyborg-Kalman Giriώ")

    // 6. NέHAέ KέNETέK ΗIKIή
    if strategy.position_size and close stopLine and barstate.isconfirmed
        strategy
    .close("LONG"comment="Kinetik Stop")
    if 
    strategy.position_size and close stopLine and barstate.isconfirmed
        strategy
    .close("SHORT"comment="Kinetik Stop")

    // VέZYON
    plot(kf_state"Kalman Dόrbόnό"color=color.whitelinewidth=1)
    plot(hi_lo"Cyborg Gann"color=color.graylinewidth=1style=plot.style_circles)
    plot(stopLine"Kinetik Kalkan"color=trendDir == color.lime color.redlinewidth=3
    16.07.2024 - 10.12.2024

  6. PHP Code:
    // © Kinetik Komuta Merkezi - V5.3 ISOTROPIC KALMAN (NέHAέ ΗΦZάM)
    //@version=6
    strategy("Karargah V5.3 - Isotropic Kalman"overlay=trueinitial_capital=1000default_qty_type=strategy.percent_of_equitydefault_qty_value=100commission_type=strategy.commission.percentcommission_value=0.04)

    // ═════════════════════════════════════════════════════════════════════════
    //  1. GέRDέLER VE AYARLAR
    // ═════════════════════════════════════════════════════════════════════════
    grp_kalman "Kalman Radar Ayarlarύ"
    factor input.float(0.5"Ηift EMA Hύzύ 1"minval=0.1step=0.1group=grp_kalman)
    factor2 input.float(0.5"Ηift EMA Hύzύ 2"minval=0.1step=0.1group=grp_kalman)
    r_ratiob input.int(50"Yavaώ Kalman R"step=5group=grp_kalman)
    q_ratiob input.float(0.002"Yavaώ Kalman Q"step=0.001group=grp_kalman)
    r_ratios input.int(50"Hύzlύ Kalman R"step=5group=grp_kalman)
    q_ratios input.float(0.005"Hύzlύ Kalman Q"step=0.001group=grp_kalman)

    i_period input.int(19"έzotropik Dόrbόn (Kanal) Periyodu"minval=5group="έzotropik Dόrbόn")

    // ═════════════════════════════════════════════════════════════════════════
    //  2. KANITLANMIή KALMAN MOTORU (+%19 Getiren Orijinal Motor)
    // ═════════════════════════════════════════════════════════════════════════
    pine_ema(srclength) => 
        
    float alpha / (length 1)
        var 
    float sum na
        sum 
    := na(sum[1]) ? src alpha src + (alpha) * nz(sum[1])
        
    sum

    clamp
    (xab) => math.min(math.max(xa), b)

    calc_kalman(float srcfloat p_statefloat p_cvfloat R_rawfloat Q_rawfloat res_varfloat q_ratiofloat gate_mult) =>
        
    float q_process clamp(nz(Q_raw0.1), 0.00110.0) * q_ratio
        float r_dynamic_floor 
    res_var gate_mult
        float r_adaptive 
    math.max(nz(R_raw1.0), r_dynamic_floor)
        
    float current_p_cov p_cv q_process
        float k_gain 
    current_p_cov / (current_p_cov r_adaptive 1e-10)
        
    float next_state nz(p_statesrc)
        
    float next_cov   current_p_cov
        
    if not na(k_gain)
            
    next_state := next_state k_gain * (src next_state)
            
    next_cov   := (k_gain) * current_p_cov
        
    [next_statenext_cov]

    float ema1 pine_ema(closefactor)
    float ema2 pine_ema(ema1factor2)
    float vol_base math.max(ta.atr(14), 1e-6)

    // Yavaώ Kalman (Pembe)
    var float kf_stateb na, var float p_covb 1.0
    float residualb 
    ema2 nz(kf_stateb[1], ema2)
    float residual_varianceb math.pow(residualb2) / math.pow(vol_base2)
    float R_rawb nz(ta.rma(residual_variancebr_ratiob), 1.0)
    float Q_rawb nz(ta.rma(residual_varianceb5), 0.1)
    [
    new_valbnew_covb] = calc_kalman(ema2kf_statebp_covbR_rawbQ_rawbresidual_variancebq_ratiob1.0)
    kf_stateb := new_valbp_covb := new_covb
    float kalman_yavas 
    pine_ema(kf_stateb3)

    // Hύzlύ Kalman (Mavi)
    var float kf_states na, var float p_covs 1.0
    float residuals 
    ema2 nz(kf_states[1], ema2)
    float residual_variances math.pow(residuals2) / math.pow(vol_base2)
    float R_raws nz(ta.rma(residual_variancesr_ratios), 1.0)
    float Q_raws nz(ta.rma(residual_variances5), 0.1)
    [
    new_valsnew_covs] = calc_kalman(ema2kf_statesp_covsR_rawsQ_rawsresidual_variancesq_ratios1.0)
    kf_states := new_valsp_covs := new_covs
    float kalman_hizli 
    pine_ema(kf_states5)

    bool makro_boga kalman_hizli kalman_yavas
    bool makro_ayi 
    kalman_hizli kalman_yavas

    // ═════════════════════════════════════════════════════════════════════════
    //  3. έZOTROPέK KANAL (ΗEKέΗ)
    // ═════════════════════════════════════════════════════════════════════════
    // Geηmiώ 19 mumun Zirve ve Dipleri
    float iso_chUp ta.highest(highi_period)[1]
    float iso_chLo ta.lowest(lowi_period)[1]

    // Fiyat geηmiώ tepeyi/dibi anlύk olarak yuttu mu?
    bool tavan_kirildi close iso_chUp
    bool taban_kirildi 
    close iso_chLo

    // ═════════════════════════════════════════════════════════════════════════
    //  4. STRATEJέ VE TETέK 
    // ═════════════════════════════════════════════════════════════════════════
    // GέRέή: Kalman Radarύ aynύ yφnde VE έzotropik Kύrύlύm gerηekleώti
    bool t_long_giris makro_boga and tavan_kirildi
    bool t_short_giris 
    makro_ayi and taban_kirildi

    if t_long_giris
        strategy
    .entry("V5.3 LONG"strategy.long)
    if 
    t_short_giris
        strategy
    .entry("V5.3 SHORT"strategy.short)

    // ΗIKIή: Rόzgar (Kalman) tersine dφndόπό an masadan kalk
    if makro_ayi
        strategy
    .close("V5.3 LONG"comment="Kalman Ηφkόώό")
    if 
    makro_boga
        strategy
    .close("V5.3 SHORT"comment="Kalman Yόkseliώi")

    // ═════════════════════════════════════════════════════════════════════════
    //  5. GΦRSELLEήTέRME VE HUD PANEL
    // ═════════════════════════════════════════════════════════════════════════
    p_hizli plot(kalman_hizli"Hύzlύ Kalman"color=color.rgb(80100240), linewidth=2)
    p_yavas plot(kalman_yavas"Yavaώ Kalman"color=color.rgb(23065195), linewidth=2)
    fill(p_hizlip_yavascolor=makro_boga color.new(color.aqua80) : color.new(color.red80))

    plot(iso_chUp"έzotropik Tavan"color=color.new(color.aqua40), style=plot.style_stepline)
    plot(iso_chLo"έzotropik Taban"color=color.new(color.red40), style=plot.style_stepline)

    plotshape(t_long_giris and strategy.position_size <= 0"AL"shape.triangleuplocation.belowbarcolor.aquasize=size.small)
    plotshape(t_short_giris and strategy.position_size >= 0"SAT"shape.triangledownlocation.abovebarcolor.redsize=size.small
    16.07.2024 - 10.12.2024

  7. PHP Code:
    // © Kinetik Komuta Merkezi - V5.4 ISOTROPIC KALMAN + DEVIATION BANDS
    //@version=6
    strategy("Karargah V5.4 - Kalman Deviation"overlay=trueinitial_capital=1000default_qty_type=strategy.percent_of_equitydefault_qty_value=100commission_type=strategy.commission.percentcommission_value=0.04)

    // ═════════════════════════════════════════════════════════════════════════
    //  1. GέRDέLER VE AYARLAR
    // ═════════════════════════════════════════════════════════════════════════
    grp_kalman "Kalman Radar Ayarlarύ"
    factor input.float(0.5"Ηift EMA Hύzύ 1"minval=0.1step=0.1group=grp_kalman)
    factor2 input.float(0.5"Ηift EMA Hύzύ 2"minval=0.1step=0.1group=grp_kalman)
    r_ratiob input.int(50"Yavaώ Kalman R"step=5group=grp_kalman)
    q_ratiob input.float(0.002"Yavaώ Kalman Q"step=0.001group=grp_kalman)
    r_ratios input.int(50"Hύzlύ Kalman R"step=5group=grp_kalman)
    q_ratios input.float(0.005"Hύzlύ Kalman Q"step=0.001group=grp_kalman)

    i_period input.int(19"έzotropik Dόrbόn Periyodu"minval=5group="έzotropik Dόrbόn")

    grp_dev "Kalman Sapma (Deviation) Hedefleri"
    atr_len input.int(200"ATR Uzunluπu (Φlηόm)"group=grp_dev)
    dev_mult input.float(2.0"Hedef Sapma Ηarpanύ (Φrn: 2 veya 3)"step=0.5group=grp_dev)

    // ═════════════════════════════════════════════════════════════════════════
    //  2. KALMAN MOTORU 
    // ═════════════════════════════════════════════════════════════════════════
    pine_ema(srclength) => 
        
    float alpha / (length 1)
        var 
    float sum na
        sum 
    := na(sum[1]) ? src alpha src + (alpha) * nz(sum[1])
        
    sum

    clamp
    (xab) => math.min(math.max(xa), b)

    calc_kalman(float srcfloat p_statefloat p_cvfloat R_rawfloat Q_rawfloat res_varfloat q_ratiofloat gate_mult) =>
        
    float q_process clamp(nz(Q_raw0.1), 0.00110.0) * q_ratio
        float r_dynamic_floor 
    res_var gate_mult
        float r_adaptive 
    math.max(nz(R_raw1.0), r_dynamic_floor)
        
    float current_p_cov p_cv q_process
        float k_gain 
    current_p_cov / (current_p_cov r_adaptive 1e-10)
        
    float next_state nz(p_statesrc)
        
    float next_cov   current_p_cov
        
    if not na(k_gain)
            
    next_state := next_state k_gain * (src next_state)
            
    next_cov   := (k_gain) * current_p_cov
        
    [next_statenext_cov]

    float ema1 pine_ema(closefactor)
    float ema2 pine_ema(ema1factor2)
    float vol_base math.max(ta.atr(14), 1e-6)

    // Yavaώ Kalman (Pembe - Ana Eksen)
    var float kf_stateb na, var float p_covb 1.0
    float residualb 
    ema2 nz(kf_stateb[1], ema2)
    float residual_varianceb math.pow(residualb2) / math.pow(vol_base2)
    float R_rawb nz(ta.rma(residual_variancebr_ratiob), 1.0)
    float Q_rawb nz(ta.rma(residual_varianceb5), 0.1)
    [
    new_valbnew_covb] = calc_kalman(ema2kf_statebp_covbR_rawbQ_rawbresidual_variancebq_ratiob1.0)
    kf_stateb := new_valbp_covb := new_covb
    float kalman_yavas 
    pine_ema(kf_stateb3)

    // Hύzlύ Kalman (Mavi - Tetikηi)
    var float kf_states na, var float p_covs 1.0
    float residuals 
    ema2 nz(kf_states[1], ema2)
    float residual_variances math.pow(residuals2) / math.pow(vol_base2)
    float R_raws nz(ta.rma(residual_variancesr_ratios), 1.0)
    float Q_raws nz(ta.rma(residual_variances5), 0.1)
    [
    new_valsnew_covs] = calc_kalman(ema2kf_statesp_covsR_rawsQ_rawsresidual_variancesq_ratios1.0)
    kf_states := new_valsp_covs := new_covs
    float kalman_hizli 
    pine_ema(kf_states5)

    bool makro_boga kalman_hizli kalman_yavas
    bool makro_ayi 
    kalman_hizli kalman_yavas

    // ═════════════════════════════════════════════════════════════════════════
    //  3. έZOTROPέK KANAL & KALMAN DEVIATION BANTLARI (HEDEFLER)
    // ═════════════════════════════════════════════════════════════════════════
    // έzotropik (Giriώ) Sύnύrlarύ
    float iso_chUp ta.highest(highi_period)[1]
    float iso_chLo ta.lowest(lowi_period)[1]

    bool tavan_kirildi close iso_chUp
    bool taban_kirildi 
    close iso_chLo

    // Kalman Sapma (Deviation) Bantlarύ (Ηύkύώ Hedefleri)
    float makro_atr ta.atr(atr_len)
    float dev_hedef_ust kalman_yavas + (makro_atr dev_mult)
    float dev_hedef_alt kalman_yavas - (makro_atr dev_mult)

    // Fiyat hedef banda ηarptύ mύ?
    bool boga_hedefi_vuruldu high >= dev_hedef_ust
    bool ayi_hedefi_vuruldu 
    low <= dev_hedef_alt

    // ═════════════════════════════════════════════════════════════════════════
    //  4. STRATEJέ VE TETέK (DέNAMέK KΒR AL EKLENDέ)
    // ═════════════════════════════════════════════════════════════════════════
    bool t_long_giris makro_boga and tavan_kirildi
    bool t_short_giris 
    makro_ayi and taban_kirildi

    if t_long_giris
        strategy
    .entry("V5.4 LONG"strategy.long)
    if 
    t_short_giris
        strategy
    .entry("V5.4 SHORT"strategy.short)

    // ΗIKIή 1: Rόzgar tersine dφnerse (Klasik Zarar/έz Sόren Stop)
    if makro_ayi
        strategy
    .close("V5.4 LONG"comment="Kalman Ηφktό")
    if 
    makro_boga
        strategy
    .close("V5.4 SHORT"comment="Kalman Uηtu")

    // ΗIKIή 2 (YENέ): Hedef Banda (Deviation) Ηarpύnca Kβrύ Kilitle!
    if boga_hedefi_vuruldu
        strategy
    .close("V5.4 LONG"comment="Hedef Vuruldu (TP)")
    if 
    ayi_hedefi_vuruldu
        strategy
    .close("V5.4 SHORT"comment="Hedef Vuruldu (TP)")

    // ═════════════════════════════════════════════════════════════════════════
    //  5. GΦRSELLEήTέRME VE HUD PANEL
    // ═════════════════════════════════════════════════════════════════════════
    // Kalman ve έzotropik
    p_hizli plot(kalman_hizli"Hύzlύ Kalman"color=color.rgb(80100240), linewidth=2)
    p_yavas plot(kalman_yavas"Yavaώ Kalman"color=color.rgb(23065195), linewidth=2)
    fill(p_hizlip_yavascolor=makro_boga color.new(color.aqua80) : color.new(color.red80))

    plot(iso_chUp"έzotropik Tavan"color=color.new(color.aqua50), style=plot.style_stepline)
    plot(iso_chLo"έzotropik Taban"color=color.new(color.red50), style=plot.style_stepline)

    // Sapma Hedef Bantlarύ (BigBeluga'dan Kalman'a Uyarlanan Kύsύm)
    plot(dev_hedef_ust"Kalman +Deviation (TP)"color=color.new(color.aqua30), style=plot.style_circleslinewidth=1)
    plot(dev_hedef_alt"Kalman -Deviation (TP)"color=color.new(color.red30), style=plot.style_circleslinewidth=1)

    plotshape(t_long_giris and strategy.position_size <= 0"AL"shape.triangleuplocation.belowbarcolor.aquasize=size.small)
    plotshape(t_short_giris and strategy.position_size >= 0"SAT"shape.triangledownlocation.abovebarcolor.redsize=size.small)

    if 
    barstate.islast
        
    var table hud table.new(position.top_right25bgcolor=color.new(#0D0D0D, 15), border_color=color.new(color.gray, 50), border_width=1)
        
    table.cell(hud00"V5.4 DEVIATION MATRIX"text_color=color.whitetext_size=size.normalbgcolor=color.new(#111111, 0), text_halign=text.align_center)
        
    table.merge_cells(hud0010)
        
        
    string islem_durumu strategy.position_size "LONG AKTέF" strategy.position_size "SHORT AKTέF" "PUSUDA"
        
    color durum_renk strategy.position_size color.aqua strategy.position_size color.red color.gray
        table
    .cell(hud01"Operasyon"text_color=color.whitetext_size=size.smallbgcolor=color.new(#1A1A1A, 0))
        
    table.cell(hud11islem_durumutext_color=durum_renktext_size=size.smallbgcolor=color.new(#1A1A1A, 0))

        
    table.cell(hud02"Kalman Radarύ"text_color=color.whitetext_size=size.smallbgcolor=color.new(#161616, 0))
        
    table.cell(hud12makro_boga "BOΠA (YUKARI)" "AYI (AήAΠI)"text_color=makro_boga color.aqua color.redtext_size=size.smallbgcolor=color.new(#161616, 0))

        // Dinamik Hedef Gφstergesi
        
    string hedef_text strategy.position_size str.tostring(dev_hedef_ustformat.mintick) : strategy.position_size str.tostring(dev_hedef_altformat.mintick) : "BEKLEMEDE"
        
    table.cell(hud03"Sapma Hedefi (TP)"text_color=color.whitetext_size=size.smallbgcolor=color.new(#1A1A1A, 0))
        
    table.cell(hud13hedef_texttext_color=color.yellowtext_size=size.smallbgcolor=color.new(#1A1A1A, 0)) 
    16.07.2024 - 10.12.2024

Sayfa 23/23 έlkέlk ... 13212223

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
  •