Artan
Azalan
İşlem
BIST 30
BIST 50
BIST 100
Hisse Fiyat Fark% Hacim (TL) Düşük / Yüksek
341,00 10% 735.537,00? 341,00 / 341,00
45,10 10% 58,25 Mn 41,34 / 45,10
4,84 10% 13,71 Mn 4,84 / 4,84
35,42 10% 445,30 Mn 33,00 / 35,42
14,64 9.99% 8,23 Mn 14,64 / 14,64
Hisse Fiyat Fark% Hacim (TL) Düşük / Yüksek
88,25 -9.99% 2,04 Mn 88,25 / 88,25
4,21 -9.85% 126,99 Mn 4,21 / 4,84
27,04 -9.32% 52,62 Mn 27,02 / 28,40
20,16 -8.36% 30,15 Mn 19,84 / 20,98
53,25 -7.31% 3,37 Mr 52,00 / 55,40
Hisse Fiyat Fark% Hacim (TL) Düşük / Yüksek
293,00 3.9% 7,50 Mr 288,75 / 294,75
243,40 -2.74% 4,90 Mr 239,50 / 249,70
53,25 -7.31% 3,37 Mr 52,00 / 55,40
327,00 2.51% 3,08 Mr 319,25 / 328,50
76,30 3.67% 2,65 Mr 75,45 / 77,10
Hisse Fiyat Fark% Hacim (TL) Düşük / Yüksek
17,12 1.36% 188,04 Mn 17,00 / 17,49
76,30 3.67% 2,65 Mr 75,45 / 77,10
327,00 2.51% 3,08 Mr 319,25 / 328,50
185,10 2.32% 1,55 Mr 182,70 / 186,40
652,00 1.95% 762,15 Mn 650,00 / 658,00
Hisse Fiyat Fark% Hacim (TL) Düşük / Yüksek
17,12 1.36% 188,04 Mn 17,00 / 17,49
76,30 3.67% 2,65 Mr 75,45 / 77,10
94,45 1.94% 97,67 Mn 94,05 / 95,15
110,30 2.51% 47,66 Mn 110,00 / 111,80
327,00 2.51% 3,08 Mr 319,25 / 328,50
Hisse Fiyat Fark% Hacim (TL) Düşük / Yüksek
17,12 1.36% 188,04 Mn 17,00 / 17,49
30,02 3.23% 27,16 Mn 29,62 / 30,28
76,30 3.67% 2,65 Mr 75,45 / 77,10
10,23 2.71% 74,44 Mn 10,15 / 10,35
69,30 3.43% 106,12 Mn 68,25 / 69,35
Sayfa 386/387 İlkİlk ... 286336376384385386387 SonSon
Arama sonucu : 3094 madde; 3,081 - 3,088 arası.

Konu: Tradingview

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

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 1. AYARLAR VE ANA OMURGA (ATMOSFER)                                          │
    // └──────────────────────────────────────────────────────────────────────────────┘
    float ayar_genislik input.float(1.0"Genişlik (0.1 - 2.0)"minval=0.1maxval=2.0step=0.1)

    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.2200)
    float mirror_ana1 f_katman_ana(0.020.020.250)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 2. Aİ MOTOR BLOKLARI VE DERİN ÖĞRENME HESAPLAMALARI                          │
    // └──────────────────────────────────────────────────────────────────────────────┘
    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

    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

    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
    p1_top 
    plot(close dist_1"Üst"display=display.none)
    p1_bot plot(close dist_1"Alt"display=display.none)
    fill(p1_topp1_botcolor=core_colortitle="Dinamik Çekirdek")

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 3. ANA TREND RENK VE SİNYAL HAFIZASI                                         │
    // └──────────────────────────────────────────────────────────────────────────────┘
    bool makro_al mirror_ana close
    color col_mirror_ana 
    makro_al ? (mirror_ana mirror_ana[1] ? color.blue color.lime) : (mirror_ana mirror_ana[1] ? color.yellow color.red)

    var 
    int sinyal_durumu 
    bool kesin_al 
    false
    bool kesin_sat 
    false

    var string son_yon "BEKLENİYOR"
    var float son_sinyal_fiyati na

    if barstate.isconfirmed
        
    if col_mirror_ana == color.yellow and sinyal_durumu != 1
            kesin_al 
    := true
            sinyal_durumu 
    := 1
            son_yon 
    := "AL"
            
    son_sinyal_fiyati := close
            
        
    if col_mirror_ana == color.blue and sinyal_durumu != -1
            kesin_sat 
    := true
            sinyal_durumu 
    := -1
            son_yon 
    := "SAT"
            
    son_sinyal_fiyati := close

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 4. SAF MTK-3 ÇİFTE KIRILIM MOTORU (MUSA'NIN ASASI)                           │
    // └──────────────────────────────────────────────────────────────────────────────┘
    sarStart input.float(0.001"Basınç Başlangıcı"group="MTK-3 Motoru")
    sarInc   input.float(0.002"Basınç İvmesi"group="MTK-3 Motoru")
    sarMax   input.float(0.20"Maksimum Tazyik"group="MTK-3 Motoru")
    direncPeriyodu input.int(2"Kapakçık (Sınır) Periyodu"group="MTK-3 Motoru")

    psarVal  ta.sar(sarStartsarIncsarMax)
    ustKapak ta.highest(highdirencPeriyodu)[1]
    altKapak ta.lowest(lowdirencPeriyodu)[1]

    // Çifte Kırılım (Tetik)
    ciftKirilimAtim    ta.crossover(closepsarVal) and (close ustKapak)
    ciftKirilimGevseme ta.crossunder(closepsarVal) and (close altKapak)

    // Mutlak Hedefler (Evreka)
    var float tepeHedef na
    var float dipHedef  na

    if ciftKirilimAtim
        dipHedef 
    := ta.lowest(lowdirencPeriyodu 2)[1]
    if 
    ciftKirilimGevseme
        tepeHedef 
    := ta.highest(highdirencPeriyodu 2)[1]

    var 
    int mtkDongu 0
    if ciftKirilimAtim
        mtkDongu 
    := 1
    else if ciftKirilimGevseme
        mtkDongu 
    := -1

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 5. GÖRSELLEŞTİRME VE ALARMLAR                                                │
    // └──────────────────────────────────────────────────────────────────────────────┘
    plot(mirror_ana"Ana Trend"color=col_mirror_analinewidth=3style=plot.style_stepline)
    //plot(mirror_ana1, "Olası Trend", color=color.white, linewidth=2, style=plot.style_stepline)
    plot(psarVal"@yörük@"style=plot.style_crosscolor=close psarVal color.yellow color.bluelinewidth=2)

    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)

    bgcolor(mtkDongu == color.new(color.lime90) : mtkDongu == -color.new(color.red90) : natitle="Döngü Formu")

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

    // Tetiğe bağlanan bayraklar ve alarmlar
    //plotshape(ciftKirilimAtim, "(@yörük@) DİRENÇ", shape.flag, location.abovebar, color.fuchsia, text="DİR\n(@yörük@)", textcolor=color.fuchsia, size=size.small)
    //plotshape(ciftKirilimGevseme, "(@yörük@) DESTEK", shape.flag, location.belowbar, color.fuchsia, text="DES\n(@yörük@)", textcolor=color.fuchsia, size=size.small)

    alertcondition(ciftKirilimAtimtitle="💎 EVREKA (KOPUŞ!)"message="Sistem: Çifte Kırılım Gerçekleşti, Tazyik Yukarı!")
    alertcondition(ciftKirilimGevsemetitle="⚠️ EVREKA (ÇÖKÜŞ!)"message="Sistem: Çifte Kırılım Gerçekleşti, Tazyik Aşağı!")

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 6. KOMUTA MERKEZİ (DASHBOARD)                                                │
    // └──────────────────────────────────────────────────────────────────────────────┘
    var table dash table.new(position.top_right314border_width 1border_color color.new(color.gray80))

    if 
    barstate.islast
        table
    .cell(dash00"Yatırım Tavsiyesi DEĞİLDİR."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 == "BEKLENİYOR" "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)

        
    // Eski hesaplamalar yerine Saf MTK-3'ün Mutlak Hedefleri bağlandı
        
    string evreka_tepe_str na(tepeHedef) ? "BEKLENİYOR" str.tostring(tepeHedefformat.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(dipHedef) ? "BEKLENİYOR" str.tostring(dipHedefformat.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 (@yörük@) ---"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Ş (@yörük@) ---"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İ) - Eğitim çalışmasıdır. Yatırım tavsiyesi KULLANILAMAZ."text_color=color.new(color.gray50), text_size=size.small
    16.07.2024 - 10.12.2024

  2. PHP Code:
    //@version=6
    indicator(":]"overlay=truemax_labels_count=500)

    // ┌────────────────────────────── 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 (0–100). 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 = 50–69%, 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.1"Base AF Start",     minval=0.001step=0.001group=GRP_PSARtooltip=tt_base_start)
    base_increment input.float(0.1"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=2)

    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.8conf_text,
             
    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 dash table.new(position.top_center23border_width 1border_color color.new(color.gray80))

    if 
    barstate.islast
        
    // Panel Başlığı
        
    table.cell(dash00"AI @yörük@"text_color=color.whitebgcolor=color.new(color.black20), text_size=size.normaltext_halign=text.align_center)
        
    table.merge_cells(dash0010)
        
        
    // AI PSAR Güncel Değeri
        
    table.cell(dash01"AI:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash11str.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" "NÖTR"
        
    color vites_col market_regime == color.red market_regime == color.lime color.yellow
        
        table
    .cell(dash02"Sonuç:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash12vites_txttext_color=vites_colbgcolor=color.new(color.black40), text_halign=text.align_right
    16.07.2024 - 10.12.2024

  3. PHP Code:
    //@version=6
    strategy(":]"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. 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

    // ==========================================
    // 3. YAPAY ZEKA (DL) ATMOSFERİ (GENİŞLİK 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 Sınır (Kalkan Genişliği)
    float dist_base math.abs(close s_fast_1) * ai_factor
    float dist_swing  
    dist_base 2.0

    // ==========================================
    // 4. MİZAN 100 (KADİM 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"100"color=color.new(color.fuchsia0), linewidth=4)

    // ==========================================
    // 5. ÖZ ÇEKİRDEK 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"SuperTrend"color=oz_st_renkstyle=plot.style_steplinelinewidth=2)

    // ==========================================
    // 6. KUSURSUZ İTTİFAK SİNYALLERİ
    // ==========================================
    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="MİZAN+ST AL",  text="ST+M100\nAL",  style=shape.labelup,   location=location.belowbarcolor=color.rgb(0230119), textcolor=color.whitesize=size.normal)
    plotshape(ittifak_SATtitle="MİZAN+ST SAT"text="ST+M100\nSAT"style=shape.labeldownlocation=location.abovebarcolor=color.rgb(2558282), textcolor=color.whitesize=size.normal)

    // ==========================================
    // 7. SAVAŞ MEYDANI: STRATEJİ EMİRLERİ
    // ==========================================
    if ittifak_AL
        strategy
    .entry("Kusursuz_AL"strategy.long)

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

    // İMZA
    var table ytd_table table.new(position.bottom_center11)
    if 
    barstate.islast
        table
    .cell(ytd_table00"(Aİ) eğitim çalışmasıdır. Yatırım tavsiyesi KULLANILAMAZ."text_color=color.new(color.white50), text_size=size.small
    16.07.2024 - 10.12.2024

  4. PHP Code:
    //@version=6
    strategy(":] Saf Alan ve TL Cetveli"overlay=trueinitial_capital=10000default_qty_type=strategy.percent_of_equitydefault_qty_value=100commission_type=strategy.commission.percentcommission_value=0.04)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 1. SAR MOTORLARI VE DENGE HATLARI (ALANIN İÇİ)                               │
    // └──────────────────────────────────────────────────────────────────────────────┘
    float s_fast_1 ta.sar(0.010.010.2
    float s_fast_2 ta.sar(0.010.050.2)
    float s_fast_3 ta.sar(0.040.040.2)

    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)

    // Denge 1: Hızlı SAR Ortalaması
    float denge_hizli = (s_fast_1 s_fast_2 s_fast_3) / 3
    plot
    (denge_hizli"Denge Hızlı (1-3)"color=color.new(color.yellow0), linewidth=2style=plot.style_cross)

    // Denge 2: Yavaş SAR Ortalaması
    float denge_yavas = (s_slow_1 s_slow_2 s_slow_3) / 3
    plot
    (denge_yavas"Denge Yavaş (4-6)"color=color.new(color.fuchsia0), linewidth=2style=plot.style_cross)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 2. ÖNCÜ AYNA (12) VE MUTLAK SURLAR (ALANIN DIŞI)                             │
    // └──────────────────────────────────────────────────────────────────────────────┘
    float s_start_sabit 0.02
    float s_inc_sabit   
    0.02
    float s_max_sabit   
    0.2

    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)

    // Sadece Öncü Ayna'yı (12) hesaplıyoruz
    float ayna_oncu f_katman_ana(s_start_sabits_inc_sabits_max_sabit12)
    plot(ayna_oncu"Öncü Ayna"color=color.new(color.white50), linewidth=1)

    // Öncü Ayna'nın Kavis Yaptığı (Mühürlendiği) Tepe ve Dip Noktaları
    bool ayna_dondu_asagi ayna_oncu ayna_oncu[1] and ayna_oncu[1] > ayna_oncu[2]
    bool ayna_dondu_yukari ayna_oncu ayna_oncu[1] and ayna_oncu[1] < ayna_oncu[2]

    var 
    float ayna_tepe na
    var float ayna_dip  na

    if ayna_dondu_asagi
        ayna_tepe 
    := ayna_oncu[1]

    if 
    ayna_dondu_yukari
        ayna_dip 
    := ayna_oncu[1]

    // Ayna Surları (Meydanın Sınırları)
    plot(ayna_tepe"Ayna Tepe (Direnç)"color=color.new(color.red20), style=plot.style_linebrlinewidth=2)
    plot(ayna_dip"Ayna Dip (Destek)"color=color.new(color.lime20), style=plot.style_linebrlinewidth=2)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 3. TL BAZLI RİSK/ÖDÜL CETVELİ (DOĞRU TARTI)                                  │
    // └──────────────────────────────────────────────────────────────────────────────┘
    int num_contracts input.int(1"Kontrat / Lot Sayısı"group="Risk/Ödül (TL Cetveli)")
    float pnl_step    input.float(500.0"Kademe Başına Kâr/Zarar (₺)"group="Risk/Ödül (TL Cetveli)")
    int num_levels    input.int(4"Çizilecek Kademe Sayısı"group="Risk/Ödül (TL Cetveli)")

    // Borsa puanını gerçek paraya çevirme (TradingView'in içsel pointvalue değeri)
    float dpp syminfo.pointvalue
    pnl_to_dist
    (pnl) => dpp != pnl / (dpp num_contracts) : 0

    // Çizgileri ve etiketleri hafızada (array) tutuyoruz ki grafiği kasmasın
    int total_obj + (num_levels 2)
    var 
    label[] lvl_lbls = array.new<label>(total_objna)
    var 
    line[]  lvl_lns  = array.new<line>(total_objna)

    if 
    barstate.isfirst
        
    for 0 to total_obj 1
            
    array.set(lvl_lblsilabel.new(nananastyle=label.style_label_leftsize=size.smalltextcolor=color.white))
            array.
    set(lvl_lnsiline.new(nanananawidth=1))

    // Çizgi ve etiket güncelleme motoru
    f_update_cetvel(idxlxx1x2ptxtcoll_style) =>
        
    lbl = array.get(lvl_lblsidx)
        
    label.set_xy(lbllxp)
        
    label.set_text(lbltxt)
        
    label.set_color(lblcolor.new(color.black100)) // Arka plan şeffaf
        
    label.set_textcolor(lblcol)

        
    ln = array.get(lvl_lnsidx)
        
    line.set_xy1(lnx1p)
        
    line.set_xy2(lnx2p)
        
    line.set_color(lncol)
        
    line.set_style(lnl_style)

    // Sadece son mumda, anlık fiyata göre cetveli çizer
    if barstate.islast
        float anchor 
    close // Nokta-i Sıfırımız Anlık Fiyattır.
        
    int x1 bar_index 15
        int x2 
    bar_index 10
        int lx 
    bar_index 10

        
    // 0 Noktası (Giriş Yeri)
        
    f_update_cetvel(0lxx1x2anchor" ── 0 ₺"color.whiteline.style_solid)

        for 
    1 to num_levels
            float pnl_val 
    pnl_step i
            float dist 
    pnl_to_dist(pnl_val)
            
            
    float up_p anchor dist
            float dn_p 
    anchor dist
            string pnl_str 
    str.tostring(pnl_val"#,###") + " ₺"

            
    // Yukarı Seviyeler (Long için Kâr, Short için Zarar)
            
    f_update_cetvel(ilxx1x2up_p"  +" pnl_strcolor.limeline.style_dotted)
            
            
    // Aşağı Seviyeler (Long için Zarar, Short için Kâr)
            
    f_update_cetvel(num_levels ilxx1x2dn_p"  -" pnl_strcolor.redline.style_dotted)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 4. STRATEJİ / TETİK ALANI                                                    │
    // └──────────────────────────────────────────────────────────────────────────────┘
    // Tetiği neye bağlayacağımızı belirlediğimizde burayı dolduracağız. 
    16.07.2024 - 10.12.2024

  5. PHP Code:
    //@version=6
    strategy(":] Tek Kurşun + 12-32 Ayna + TL Cetveli"overlay=trueinitial_capital=10000default_qty_type=strategy.percent_of_equitydefault_qty_value=100commission_type=strategy.commission.percentcommission_value=0.04)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 1. SAR MOTORLARI VE DENGE HATLARI (ALANIN İÇİ)                               │
    // └──────────────────────────────────────────────────────────────────────────────┘
    float s_fast_1 ta.sar(0.010.010.2
    float s_fast_2 ta.sar(0.010.050.2)
    float s_fast_3 ta.sar(0.040.040.2)

    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 denge_hizli = (s_fast_1 s_fast_2 s_fast_3) / 3
    plot
    (denge_hizli"Denge Hızlı (1-3)"color=color.new(color.yellow0), linewidth=2style=plot.style_cross)

    float denge_yavas = (s_slow_1 s_slow_2 s_slow_3) / 3
    plot
    (denge_yavas"Denge Yavaş (4-6)"color=color.new(color.fuchsia0), linewidth=2style=plot.style_cross)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 2. ÇİFT AYNA (12 VE 32) VE MUTLAK SURLAR (ALANIN DIŞI)                       │
    // └──────────────────────────────────────────────────────────────────────────────┘
    float s_start_sabit 0.02
    float s_inc_sabit   
    0.02
    float s_max_sabit   
    0.2

    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)

    // GÜNEŞ (32) VE AY (12) YÖRÜNGELERİ
    float ayna_12 f_katman_ana(s_start_sabits_inc_sabits_max_sabit12)
    float ayna_32 f_katman_ana(s_start_sabits_inc_sabits_max_sabit32)

    plot(ayna_12"Öncü Ayna (12)"color=color.new(color.white0), linewidth=2)
    plot(ayna_32"Ana Ayna (32)"color=color.new(color.blue0), linewidth=2)

    // Öncü Ayna'nın Kavis Yaptığı Tepe ve Dip Noktaları
    bool ayna_dondu_asagi ayna_12 ayna_12[1] and ayna_12[1] > ayna_12[2]
    bool ayna_dondu_yukari ayna_12 ayna_12[1] and ayna_12[1] < ayna_12[2]

    var 
    float ayna_tepe na
    var float ayna_dip  na

    if ayna_dondu_asagi
        ayna_tepe 
    := ayna_12[1]

    if 
    ayna_dondu_yukari
        ayna_dip 
    := ayna_12[1]

    plot(ayna_tepe"Ayna Tepe (Direnç)"color=color.new(color.red20), style=plot.style_linebrlinewidth=2)
    plot(ayna_dip"Ayna Dip (Destek)"color=color.new(color.lime20), style=plot.style_linebrlinewidth=2)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 3. TL BAZLI RİSK/ÖDÜL CETVELİ (DOĞRU TARTI)                                  │
    // └──────────────────────────────────────────────────────────────────────────────┘
    int num_contracts input.int(1"Kontrat / Lot Sayısı"group="Risk/Ödül (TL Cetveli)")
    float pnl_step    input.float(500.0"Kademe Başına Kâr/Zarar (₺)"group="Risk/Ödül (TL Cetveli)")
    int num_levels    input.int(4"Çizilecek Kademe Sayısı"group="Risk/Ödül (TL Cetveli)")

    float dpp syminfo.pointvalue
    pnl_to_dist
    (pnl) => dpp != pnl / (dpp num_contracts) : 0

    int total_obj 
    + (num_levels 2)
    var 
    label[] lvl_lbls = array.new<label>(total_objna)
    var 
    line[]  lvl_lns  = array.new<line>(total_objna)

    if 
    barstate.isfirst
        
    for 0 to total_obj 1
            
    array.set(lvl_lblsilabel.new(nananastyle=label.style_label_leftsize=size.smalltextcolor=color.white))
            array.
    set(lvl_lnsiline.new(nanananawidth=1))

    f_update_cetvel(idxlxx1x2ptxtcoll_style) =>
        
    lbl = array.get(lvl_lblsidx)
        
    label.set_xy(lbllxp)
        
    label.set_text(lbltxt)
        
    label.set_color(lblcolor.new(color.black100))
        
    label.set_textcolor(lblcol)

        
    ln = array.get(lvl_lnsidx)
        
    line.set_xy1(lnx1p)
        
    line.set_xy2(lnx2p)
        
    line.set_color(lncol)
        
    line.set_style(lnl_style)

    if 
    barstate.islast
        float anchor 
    close 
        int x1 
    bar_index 15
        int x2 
    bar_index 10
        int lx 
    bar_index 10

        f_update_cetvel
    (0lxx1x2anchor" ── 0 ₺"color.whiteline.style_solid)

        for 
    1 to num_levels
            float pnl_val 
    pnl_step i
            float dist 
    pnl_to_dist(pnl_val)
            
            
    float up_p anchor dist
            float dn_p 
    anchor dist
            string pnl_str 
    str.tostring(pnl_val"#,###") + " ₺"

            
    f_update_cetvel(ilxx1x2up_p"  +" pnl_strcolor.limeline.style_dotted)
            
    f_update_cetvel(num_levels ilxx1x2dn_p"  -" pnl_strcolor.redline.style_dotted)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 4. TEK KURŞUN DİSİPLİNİ VE STRATEJİ TETİĞİ                                   │
    // └──────────────────────────────────────────────────────────────────────────────┘
    int gunluk_islem_siniri input.int(1"Günde Kaç İşlem Yapılsın?"group="Disiplin Kilidi")

    // Gün döndüğünde (Gece 00:00) sayacı sıfırla
    bool yeni_gun dayofmonth != dayofmonth[1]
    var 
    int islem_sayisi_bugun 0

    if yeni_gun
        islem_sayisi_bugun 
    := 0

    // TETİK: 12 ve 32 Aynaları kesiştiğinde VE bugün kotamızı doldurmadıysak vur!
    bool kesilme_AL  ta.crossover(ayna_12ayna_32)
    bool kesilme_SAT ta.crossunder(ayna_12ayna_32)

    bool bot_AL_Gir  kesilme_AL  and (islem_sayisi_bugun gunluk_islem_siniri)
    bool bot_SAT_Gir kesilme_SAT and (islem_sayisi_bugun gunluk_islem_siniri)

    if 
    bot_AL_Gir
        strategy
    .entry("AL_Ok"strategy.long)
        
    islem_sayisi_bugun += // Oku fırlattık, sayacı 1 artır

    if bot_SAT_Gir
        strategy
    .entry("SAT_Ok"strategy.short)
        
    islem_sayisi_bugun += // Oku fırlattık, sayacı 1 artır

    // ÇIKIŞ: Akıntı yön değiştirdiğinde (ters kesişim olduğunda) işlemi acımadan kapat.
    if strategy.position_size and kesilme_SAT
        strategy
    .close("AL_Ok"comment="Akıntı_Döndü")

    if 
    strategy.position_size and kesilme_AL
        strategy
    .close("SAT_Ok"comment="Akıntı_Döndü"
    16.07.2024 - 10.12.2024

  6. PHP Code:
    //@version=6
    strategy(":] Saatlik Tek Kurşun + 12-32 Ayna"overlay=trueinitial_capital=10000default_qty_type=strategy.percent_of_equitydefault_qty_value=100commission_type=strategy.commission.percentcommission_value=0.04)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 1. DİNAMİK ÇEKİRDEK VE MUM BOYAMA (GÖRSEL ZIRH)                              │
    // └──────────────────────────────────────────────────────────────────────────────┘
    float ayar_genislik 1.0
    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

    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

    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.green85) : all_fast_above color.new(color.red85) : color.new(color.yellow85)
    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"Atmosfer Üst"display=display.none)
    p1_bot plot(l1_bot"Atmosfer Alt"display=display.none)
    fill(p1_topp1_botcolor=core_colortitle="Dinamik Çekirdek Atmosferi")

    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 
    kalkan >= ? (close avg_fast color.rgb(023011900) : color.rgb(255828200)) : (kalkan == color.blue color.fuchsia)
    barcolor(bar_col)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 2. ANA BEYİN: 12-32 AYNA (GERÇEK STRATEJİ MOTORU)                            │
    // └──────────────────────────────────────────────────────────────────────────────┘
    float s_start_sabit 0.02
    float s_inc_sabit   
    0.02
    float s_max_sabit   
    0.2

    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 ayna_12 f_katman_ana(s_start_sabits_inc_sabits_max_sabit3)
    float ayna_32 f_katman_ana(s_start_sabits_inc_sabits_max_sabit102)

    plot(ayna_12"Öncü Ayna (12)"color=color.new(color.white0), linewidth=2)
    plot(ayna_32"Ana Ayna (32)"color=color.new(color.blue0), linewidth=2)

    bool kesilme_AL  ta.crossover(ayna_12ayna_32)
    bool kesilme_SAT ta.crossunder(ayna_12ayna_32)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 3. GÜNEŞ SAATİ (ZAMAN DİLİMİ VE SAAT BAŞI TEK OK DİSİPLİNİ)                  │
    // └──────────────────────────────────────────────────────────────────────────────┘
    int baslangic_saati 10
    int bitis_saati     
    18
    int maks_gunluk_ok  
    10

    int anlik_saat 
    hour(time)

    bool yeni_gun dayofmonth != dayofmonth[1]
    var 
    int islem_sayisi_bugun 0
    var int son_atis_saati = -1

    if yeni_gun
        islem_sayisi_bugun 
    := 0
        son_atis_saati 
    := -1

    // Disiplin Kilitleri (BOŞLUKLAR DÜZELTİLDİ)
    bool zaman_uygun_mu = (anlik_saat >= baslangic_saati) and (anlik_saat <= bitis_saati)
    bool bu_saat_bos_mu = (son_atis_saati != anlik_saat)
    bool kota_var_mi    = (islem_sayisi_bugun maks_gunluk_ok)

    bool bot_AL_Gir  kesilme_AL  and zaman_uygun_mu and bu_saat_bos_mu and kota_var_mi
    bool bot_SAT_Gir 
    kesilme_SAT and zaman_uygun_mu and bu_saat_bos_mu and kota_var_mi

    // Sinyal Hafızası
    var string son_sinyal_1 "Bekleniyor"
    var string son_sinyal_2 "Bekleniyor"
    var color  renk_sinyal_1 color.gray
    var color  renk_sinyal_2 color.gray

    if bot_AL_Gir
        strategy
    .entry("AL_Ok"strategy.long)
        
    islem_sayisi_bugun += 1
        son_atis_saati 
    := anlik_saat 
        son_sinyal_2 
    := son_sinyal_1
        renk_sinyal_2 
    := renk_sinyal_1
        son_sinyal_1 
    := "AL (" str.tostring(anlik_saat) + ":00)"
        
    renk_sinyal_1 := color.lime

    if bot_SAT_Gir
        strategy
    .entry("SAT_Ok"strategy.short)
        
    islem_sayisi_bugun += 1
        son_atis_saati 
    := anlik_saat 
        son_sinyal_2 
    := son_sinyal_1
        renk_sinyal_2 
    := renk_sinyal_1
        son_sinyal_1 
    := "SAT (" str.tostring(anlik_saat) + ":00)"
        
    renk_sinyal_1 := color.red

    // Çıkışlar
    if strategy.position_size and kesilme_SAT
        strategy
    .close("AL_Ok"comment="Çıkış")

    if 
    strategy.position_size and kesilme_AL
        strategy
    .close("SAT_Ok"comment="Çıkış")

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 4. TL BAZLI RİSK/ÖDÜL CETVELİ                                                │
    // └──────────────────────────────────────────────────────────────────────────────┘
    int num_contracts input.int(1"Kontrat / Lot"group="TL Cetveli")
    float pnl_step    input.float(500.0"Kademe Başına (₺)"group="TL Cetveli")
    int num_levels    input.int(3"Kademe Sayısı"group="TL Cetveli")

    float dpp syminfo.pointvalue
    pnl_to_dist
    (pnl) => dpp != pnl / (dpp num_contracts) : 0

    int total_obj 
    + (num_levels 2)
    var 
    label[] lvl_lbls = array.new<label>(total_objna)
    var 
    line[]  lvl_lns  = array.new<line>(total_objna)

    if 
    barstate.isfirst
        
    for 0 to total_obj 1
            
    array.set(lvl_lblsilabel.new(nananastyle=label.style_label_leftsize=size.smalltextcolor=color.white))
            array.
    set(lvl_lnsiline.new(nanananawidth=1))

    f_update_cetvel(idxlxx1x2ptxtcoll_style) =>
        
    lbl = array.get(lvl_lblsidx)
        
    label.set_xy(lbllxp)
        
    label.set_text(lbltxt)
        
    label.set_color(lblcolor.new(color.black100))
        
    label.set_textcolor(lblcol)

        
    ln = array.get(lvl_lnsidx)
        
    line.set_xy1(lnx1p)
        
    line.set_xy2(lnx2p)
        
    line.set_color(lncol)
        
    line.set_style(lnl_style)

    if 
    barstate.islast
        float anchor 
    close 
        int x1 
    bar_index 15
        int x2 
    bar_index 10
        int lx 
    bar_index 10

        f_update_cetvel
    (0lxx1x2anchor" ── 0 ₺"color.whiteline.style_solid)
        for 
    1 to num_levels
            float pnl_val 
    pnl_step i
            float dist 
    pnl_to_dist(pnl_val)
            
    f_update_cetvel(ilxx1x2anchor dist"  +" str.tostring(pnl_val"#,###") + " ₺"color.limeline.style_dotted)
            
    f_update_cetvel(num_levels ilxx1x2anchor dist"  -" str.tostring(pnl_val"#,###") + " ₺"color.redline.style_dotted)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 5. KOMUTA MERKEZİ                                                            │
    // └──────────────────────────────────────────────────────────────────────────────┘
    var table dash table.new(position.top_right25border_width 1border_color color.new(color.gray80))

    if 
    barstate.islast
        table
    .cell(dash00"KOMUTA MERKEZİ"text_color=color.whitebgcolor=color.new(color.black20), text_size=size.normaltext_halign=text.align_center)
        
    table.merge_cells(dash0010)
        
        
    // (BOŞLUKLAR DÜZELTİLDİ)
        
    string saat_durumu zaman_uygun_mu "Aktif (10-18)" "Uyku Modu"
        
    color  saat_renk   zaman_uygun_mu color.lime color.gray
        table
    .cell(dash01"Zaman Kilidi:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash11saat_durumutext_color=saat_renkbgcolor=color.new(color.black40), text_halign=text.align_right)

        
    string kalan_atis str.tostring(maks_gunluk_ok islem_sayisi_bugun) + " (Bu Saat: " + (bu_saat_bos_mu "Boş" "Dolu") + ")"
        
    table.cell(dash02"Kalan Atış:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash12kalan_atistext_color=(bu_saat_bos_mu color.white color.red), bgcolor=color.new(color.black40), text_halign=text.align_right)

        
    table.cell(dash03"1. Son Sinyal:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash13son_sinyal_1text_color=renk_sinyal_1bgcolor=color.new(color.black40), text_halign=text.align_right)

        
    table.cell(dash04"2. Önceki Sinyal:"text_color=color.graybgcolor=color.new(color.black40), text_halign=text.align_left)
        
    table.cell(dash14son_sinyal_2text_color=renk_sinyal_2bgcolor=color.new(color.black40), text_halign=text.align_right
    16.07.2024 - 10.12.2024

  7. PHP Code:
    //@version=6
    strategy(":] Saf Denge ve Ayna Alanı"overlay=trueinitial_capital=1000default_qty_type=strategy.percent_of_equitydefault_qty_value=100commission_type=strategy.commission.percentcommission_value=0.04)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 1. SAR MOTORLARI (HIZLI VE YAVAŞ)                                            │
    // └──────────────────────────────────────────────────────────────────────────────┘
    float s_fast_1 ta.sar(0.010.010.2
    float s_fast_2 ta.sar(0.010.050.2)
    float s_fast_3 ta.sar(0.040.040.2)

    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)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 2. DENGE HATLARI (ORTALAMALAR)                                               │
    // └──────────────────────────────────────────────────────────────────────────────┘
    // Denge 1: Hızlı SAR'ların (1, 2, 3) Ortalaması
    float denge_hizli = (s_fast_1 s_fast_2 s_fast_3) / 3
    plot
    (denge_hizli"Denge Hızlı (1-3)"color=color.new(color.yellow0), linewidth=2style=plot.style_cross)

    // Denge 2: Yavaş SAR'ların (4, 5, 6) Ortalaması
    float denge_yavas = (s_slow_1 s_slow_2 s_slow_3) / 3
    plot
    (denge_yavas"Denge Yavaş (4-6)"color=color.new(color.fuchsia0), linewidth=2style=plot.style_cross)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 3. ÖNCÜ AYNA (12) VE ALAN (RANGE) BELİRLEME                                  │
    // └──────────────────────────────────────────────────────────────────────────────┘
    float s_start_sabit 0.02
    float s_inc_sabit   
    0.02
    float s_max_sabit   
    0.2

    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)

    // Sadece Öncü Ayna'yı (12) hesaplıyoruz
    float ayna_oncu f_katman_ana(s_start_sabits_inc_sabits_max_sabit12)
    plot(ayna_oncu"Öncü Ayna"color=color.new(color.white0), linewidth=2)

    // Öncü Ayna'nın Tepelerini (Direnç) ve Diplerini (Destek) bulma mantığı
    // Ayna yön değiştirdiğinde (kavis yaptığında) o noktayı mühürler.
    bool ayna_dondu_asagi ayna_oncu ayna_oncu[1] and ayna_oncu[1] > ayna_oncu[2]
    bool ayna_dondu_yukari ayna_oncu ayna_oncu[1] and ayna_oncu[1] < ayna_oncu[2]

    var 
    float ayna_tepe na
    var float ayna_dip  na

    if ayna_dondu_asagi
        ayna_tepe 
    := ayna_oncu[1]

    if 
    ayna_dondu_yukari
        ayna_dip 
    := ayna_oncu[1]

    // ALAN (SAVAŞ MEYDANI) ÇİZİMİ
    plot(ayna_tepe"Ayna Tepe (Direnç)"color=color.new(color.red50), style=plot.style_linebrlinewidth=2)
    plot(ayna_dip"Ayna Dip (Destek)"color=color.new(color.lime50), style=plot.style_linebrlinewidth=2)

    // ┌──────────────────────────────────────────────────────────────────────────────┐
    // │ 4. STRATEJİ (TETİK MANTIĞI) - BOŞ ŞABLON                                     │
    // └──────────────────────────────────────────────────────────────────────────────┘
    // ALAN DIŞINA ÇIKIŞ (KIRILIM) VEYA DENGE KESİŞİMLERİ İÇİN ŞARTLAR BURAYA YAZILACAK

    bool bot_AL_Gir  false // Şartı Sen Belirleyeceksin
    bool bot_SAT_Gir false // Şartı Sen Belirleyeceksin

    if bot_AL_Gir
        strategy
    .entry("AL"strategy.long)

    if 
    bot_SAT_Gir
        strategy
    .entry("SAT"strategy.short
    16.07.2024 - 10.12.2024

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

    // ==========================================
    // 5. 5 KADEMELİ EXTENDED SAR (SAREXT AĞI)
    // ==========================================
    sarext(simple float start_value=0.0simple float offset_on_reverse=0.0,
           
    simple float af_init_long=0.02simple float af_long=0.02simple float af_max_long=0.20,
           
    simple float af_init_short=0.02simple float af_short=0.02simple float af_max_short=0.20) =>
        if 
    af_init_long 0
            runtime
    .error("AF init long must be >= 0")
        if 
    af_long 0
            runtime
    .error("AF long must be >= 0")
        if 
    af_max_long af_init_long
            runtime
    .error("AF max long must be >= AF init long")
        if 
    af_init_short 0
            runtime
    .error("AF init short must be >= 0")
        if 
    af_short 0
            runtime
    .error("AF short must be >= 0")
        if 
    af_max_short af_init_short
            runtime
    .error("AF max short must be >= AF init short")

        var 
    bool is_long true
        
    var float sar na
        
    var float ep na
        
    var float af af_init_long
        
    var float result na

        
    if bar_index == 0
            result 
    := na
        
    else if bar_index == 1
            
    if start_value 0
                is_long 
    := true
                sar 
    := math.abs(start_value)
            else if 
    start_value 0
                is_long 
    := false
                sar 
    := math.abs(start_value)
            else
                
    float plus_dm high high[1]
                
    float minus_dm low[1] - low
                
    if plus_dm 0
                    plus_dm 
    := 0
                
    if minus_dm 0
                    minus_dm 
    := 0
                is_long 
    := plus_dm minus_dm
                sar 
    := is_long low[1] : high[1]

            
    ep := is_long high low
            af 
    := is_long af_init_long af_init_short

            
    if is_long
                
    if sar low[1]
                    
    sar := low[1]
                if 
    sar low
                    sar 
    := low
            
    else
                if 
    sar high[1]
                    
    sar := high[1]
                if 
    sar high
                    sar 
    := high

            result 
    := is_long sar : -sar
        
    else
            
    float new_sar sar af * (ep sar)

            if 
    is_long
                new_sar 
    := math.min(new_sarlow[1])
                
    new_sar := math.min(new_sarlow[2])

                if 
    low new_sar
                    is_long 
    := false
                    new_sar 
    := ep
                    
    if offset_on_reverse != 0
                        new_sar 
    := new_sar offset_on_reverse
                    ep 
    := low
                    af 
    := af_init_short
                
    else
                    if 
    high ep
                        ep 
    := high
                        af 
    := math.min(af af_longaf_max_long)
            else
                
    new_sar := math.max(new_sarhigh[1])
                
    new_sar := math.max(new_sarhigh[2])

                if 
    high new_sar
                    is_long 
    := true
                    new_sar 
    := ep
                    
    if offset_on_reverse != 0
                        new_sar 
    := new_sar offset_on_reverse
                    ep 
    := high
                    af 
    := af_init_long
                
    else
                    if 
    low ep
                        ep 
    := low
                        af 
    := math.min(af af_shortaf_max_short)

            
    sar := new_sar
            result 
    := is_long new_sar : -new_sar

        result

    // 5 Parmaklı İvme (AF) Değerleri
    i_af_hizli1 0.20   // Çok Hızlı (Scalp)
    i_af_hizli2 0.05   // Hızlı (Kısa Vade)
    i_af_denge  0.02   // Denge (Ana Omurga)
    i_af_yavas1 0.005  // Yavaş (Orta-Uzun Vade)
    i_af_yavas2 0.001  // Çok Yavaş (Kıta Sahanlığı)
    i_af_max    0.2    // Maksimum Sınır

    // Motorların Bağımsız Çalıştırılması
    sar_h1 sarext(0.00.0i_af_hizli1i_af_hizli1math.max(i_af_hizli1i_af_max), i_af_hizli1i_af_hizli1math.max(i_af_hizli1i_af_max))
    sar_h2 sarext(0.00.0i_af_hizli2i_af_hizli2math.max(i_af_hizli2i_af_max), i_af_hizli2i_af_hizli2math.max(i_af_hizli2i_af_max))
    sar_de sarext(0.00.0i_af_denge,  i_af_denge,  math.max(i_af_denge,  i_af_max), i_af_denge,  i_af_denge,  math.max(i_af_denge,  i_af_max))
    sar_y1 sarext(0.00.0i_af_yavas1i_af_yavas1math.max(i_af_yavas1i_af_max), i_af_yavas1i_af_yavas1math.max(i_af_yavas1i_af_max))
    sar_y2 sarext(0.00.0i_af_yavas2i_af_yavas2math.max(i_af_yavas2i_af_max), i_af_yavas2i_af_yavas2math.max(i_af_yavas2i_af_max))

    // 1. Hızlı (0.2) - İnce Çarpılar
    plot(sar_h1 math.abs(sar_h1) : na"Hızlı 1 (+)"color=color.new(color.white0), style=plot.style_crosslinewidth=1)
    plot(sar_h1 math.abs(sar_h1) : na"Hızlı 1 (-)"color=color.new(color.aqua0),  style=plot.style_crosslinewidth=1)

    // 2. Hızlı (0.05) - Yuvarlak Halkalar
    plot(sar_h2 math.abs(sar_h2) : na"Hızlı 2 (+)"color=color.new(color.yellow0), style=plot.style_circleslinewidth=1)
    plot(sar_h2 math.abs(sar_h2) : na"Hızlı 2 (-)"color=color.new(color.orange0), style=plot.style_circleslinewidth=1)

    // 3. Denge (0.02) - Kesintisiz Çizgi (Omurga)
    plot(sar_de math.abs(sar_de) : na"Denge (+)"color=color.new(color.lime0), style=plot.style_linebrlinewidth=2)
    plot(sar_de math.abs(sar_de) : na"Denge (-)"color=color.new(color.red0),  style=plot.style_linebrlinewidth=2)

    // 4. Yavaş (0.005) - Basamaklı Çizgi (Stepline)
    plot(sar_y1 math.abs(sar_y1) : na"Yavaş 1 (+)"color=color.new(#d81b60, 0), style=plot.style_stepline, linewidth=2) // Morumsu
    plot(sar_y1 math.abs(sar_y1) : na"Yavaş 1 (-)"color=color.new(#ff00ff, 0), style=plot.style_stepline, linewidth=2) // Fuşya

    // 5. Çok Yavaş (0.001) - Kalın Düz Çizgi (Kıta Sahanlığı)
    plot(sar_y2 math.abs(sar_y2) : na"Yavaş 2 (+)"color=color.new(color.teal0),   style=plot.style_linebrlinewidth=3)
    plot(sar_y2 math.abs(sar_y2) : na"Yavaş 2 (-)"color=color.new(color.maroon0), style=plot.style_linebrlinewidth=3)
    // İMZA
    var table ytd_table table.new(position.bottom_center11)
    if 
    barstate.islast
        table
    .cell(ytd_table00"(Aİ) eğitim çalışmasıdır. Yatırım tavsiyesi KULLANILAMAZ."text_color=color.new(color.white50), text_size=size.small
    16.07.2024 - 10.12.2024

Sayfa 386/387 İlkİlk ... 286336376384385386387 SonSon

Yer İmleri

Yer İmleri

Gönderi Kuralları

  • Yeni konu açamazsınız
  • Konulara cevap yazamazsınız
  • Yazılara ek gönderemezsiniz
  • Yazılarınızı değiştiremezsiniz
  •