Artan
Azalan
Ýþlem
BIST 30
BIST 50
BIST 100
NASDAQ 100
Hisse Fiyat Fark% Hacim (TL) Düþük / Yüksek
9,68 10% 74,53 Mn 8,80 / 9,68
70,40 10% 853,62 Mn 64,35 / 70,40
103,40 10% 4,93 Mn 101,40 / 103,40
17,51 9.99% 168,75 Mn 15,30 / 17,51
46,30 9.98% 331,77 Mn 39,00 / 46,30
Hisse Fiyat Fark% Hacim (TL) Düþük / Yüksek
7,29 -10% 1,03 Mr 7,29 / 7,99
18,02 -9.99% 13,14 Mn 18,02 / 18,02
289,00 -9.97% 5,97 Mr 289,00 / 309,75
6,95 -9.97% 2,05 Mr 6,95 / 8,49
11,70 -9.93% 2,60 Mr 11,70 / 12,40
Hisse Fiyat Fark% Hacim (TL) Düþük / Yüksek
197,40 -9.9% 16,51 Mr 197,40 / 223,70
323,50 -1.07% 12,31 Mr 319,50 / 331,25
396,50 0% 9,28 Mr 391,00 / 406,75
263,00 3.75% 8,32 Mr 253,75 / 264,25
2,97 -1.98% 8,20 Mr 2,96 / 3,10
Hisse Fiyat Fark% Hacim (TL) Düþük / Yüksek
19,20 -1.03% 1,13 Mr 19,07 / 19,88
79,25 -1.86% 7,85 Mr 78,70 / 82,10
396,50 0% 9,28 Mr 391,00 / 406,75
207,90 -3.08% 6,99 Mr 205,70 / 216,50
763,00 1.4% 3,32 Mr 752,50 / 770,50
Hisse Fiyat Fark% Hacim (TL) Düþük / Yüksek
19,20 -1.03% 1,13 Mr 19,07 / 19,88
79,25 -1.86% 7,85 Mr 78,70 / 82,10
92,40 -1.6% 409,71 Mn 91,65 / 94,60
115,20 -1.2% 175,66 Mn 114,40 / 117,30
396,50 0% 9,28 Mr 391,00 / 406,75
Hisse Fiyat Fark% Hacim (TL) Düþük / Yüksek
19,20 -1.03% 1,13 Mr 19,07 / 19,88
31,30 -2.07% 177,58 Mn 30,66 / 32,50
79,25 -1.86% 7,85 Mr 78,70 / 82,10
10,39 -1.05% 314,87 Mn 10,29 / 10,67
79,00 -1.19% 407,78 Mn 78,70 / 81,20

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 402/402 ÝlkÝlk ... 302352392400401402
Arama sonucu : 3214 madde; 3,209 - 3,214 arasý.

Konu: Tradingview

  1.  Alýntý Originally Posted by @yörük@ Yazýyý Oku
    3lü sar örneði... https://www.tradingview.com/x/8PDcCYHr/
    PHP Code:
    //@version=6
    indicator("3'lü SAR "overlay=truemax_bars_back=5000)

    // ─────────────────────────────────────────────────────────────────
    // 1. ORÝJÝNAL SAR DEÐERLERÝ (YARI YARIYA ÖLÇEKLÝ)
    // ─────────────────────────────────────────────────────────────────
    // Sarý SAR (Hýzlý - Tetikleyici / Standart Ayar)
    sarSari    ta.sar(0.020.020.20)

    // Mavi SAR (Orta - Dalga Filtresi)
    sarMavi    ta.sar(0.010.010.10)

    // Kýrmýzý SAR (En Yavaþ - Aðýr Zýrh / Ana Trend Göstergesi)
    sarKirmizi ta.sar(0.0050.0050.05)

    // ─────────────────────────────────────────────────────────────────
    // 2. MATRÝKS EKRANI GÖRSELLEÞTÝRMESÝ
    // ─────────────────────────────────────────────────────────────────
    // Resimdeki gibi kalýn, net noktalar (circles)
    plot(sarKirmizi"Kýrmýzý (Ana Trend)"color=color.red,    style=plot.style_circleslinewidth=2)
    plot(sarMavi,    "Mavi (Orta Dalga)",   color=color.blue,   style=plot.style_circleslinewidth=2)
    plot(sarSari,    "Sarý (Tetik)",        color=color.yellowstyle=plot.style_circleslinewidth=2)

    // ─────────────────────────────────────────────────────────────────
    // 3. ÝÞLEM MANTIÐI: 3 KÝLÝT ONAYI
    // ─────────────────────────────────────────────────────────────────
    // Kusursuz Yükseliþ: Fiyatýn, 3 SAR noktasýnýn da üstünde olmasý
    bogaAhenk close sarKirmizi and close sarMavi and close sarSari

    // Kusursuz Düþüþ: Fiyatýn, 3 SAR noktasýnýn da altýnda olmasý
    ayiAhenk  close sarKirmizi and close sarMavi and close sarSari

    // Sinyal tekrarýný önlemek için sadece olayýn koptuðu ÝLK barda tetikle
    alTetik  bogaAhenk and not bogaAhenk[1]
    satTetik ayiAhenk and not ayiAhenk[1]

    // ─────────────────────────────────────────────────────────────────
    // 4. EKRAN MÜHÜRLERÝ 
    // ─────────────────────────────────────────────────────────────────
    // Giriþ Sinyalleri (Elmaslar)
    plotshape(alTetik,  "AL",  shape.diamondlocation.belowbarcolor=color.greensize=size.smalltext="AL"textcolor=color.green)
    plotshape(satTetik"SAT"shape.diamondlocation.abovebarcolor=color.red,   size=size.smalltext="SAT"textcolor=color.red)

    // Erken Çýkýþ / Kar Al (Sarý SAR ihlali)
    // Üçlü onayla girdin, ama trend zayýfladý ve fiyat ilk olarak "Sarýyý" kesti. O an kârý korumak için uyarýr.
    cikisBoga bogaAhenk[1] and close sarSari
    cikisAyi  
    ayiAhenk[1] and close sarSari

    plotshape
    (cikisBoga"Kar Al (Boða)"shape.xcrosslocation.abovebarcolor=color.graysize=size.tiny)
    plotshape(cikisAyi,  "Kar Al (Ayý)",  shape.xcrosslocation.belowbarcolor=color.graysize=size.tiny
    þimdi bu hesaplama örneðini alýp...mtfsini...grafiðe chart yapma....
    görüntü.... https://www.tradingview.com/x/a8dUjypa/

    PHP Code:
    //@version=5
    indicator("Charts [3'lü SAR]"overlay=truemax_boxes_count=500max_lines_count=500max_labels_count=500)

    // ========================================================================= //
    // =============================== INPUTS ================================== //
    // ========================================================================= //

    // --- POSITIONING ---
    grp_pos "POSITIONING"
    i_width   input.int(50,   "Mini Chart Width (Bars)"group=grp_pos)
    i_offset  input.int(6,    "Horizontal Offset",       group=grp_pos)
    i_gapX    input.int(10,   "Horizontal Gap (Bars)",   group=grp_pos)
    i_vScale  input.float(35.0"Overall Height Scale",    group=grp_posstep=0.1)
    i_vBuffer input.float(0.02,"Vertical Buffer (%)",     group=grp_posstep=0.01)

    // --- TIMEFRAMES & CANDLES ---
    grp_tf "CUSTOM TIMEFRAMES & CANDLES"
    tf1  input.timeframe("5",   "Timeframe 1"inline="tf1"group=grp_tf)
    len1 input.int(20"",      inline="tf1",  group=grp_tf)
    tf2  input.timeframe("15",  "Timeframe 2"inline="tf2"group=grp_tf)
    len2 input.int(20"",      inline="tf2",  group=grp_tf)
    tf3  input.timeframe("60",  "Timeframe 3"inline="tf3"group=grp_tf)
    len3 input.int(20"",      inline="tf3",  group=grp_tf)
    tf4  input.timeframe("240""Timeframe 4"inline="tf4"group=grp_tf)
    len4 input.int(20"",      inline="tf4",  group=grp_tf)
    tf5  input.timeframe("D",   "Timeframe 5"inline="tf5"group=grp_tf)
    len5 input.int(15"",      inline="tf5",  group=grp_tf)
    tf6  input.timeframe("W",   "Timeframe 6"inline="tf6"group=grp_tf)
    len6 input.int(10"",      inline="tf6",  group=grp_tf)

    // --- STYLE ---
    grp_style "STYLE"
    c_up     input.color(color.new(color.white0), "Up Color",         group=grp_style)
    c_down   input.color(color.new(color.gray0),  "Down Color",       group=grp_style)
    c_bg     input.color(color.new(#1a1a1a, 80),    "Background Color", group=grp_style)
    c_border input.color(color.new(#1a1a1a, 50),    "Border Color",     group=grp_style)
    c_text   input.color(color.new(color.gray0),  "Text Color",       group=grp_style)

    // ========================================================================= //
    // ============================ DATA FETCHING ============================== //
    // ========================================================================= //
    // (Senin gönderdiðin orijinal, hatasýz HTF_Data yapýsý)

    type HTF_Data
        
    array<floato
        
    array<floath
        
    array<floatl
        
    array<floatc

    f_get_htf_data
    (tflength) =>
        var 
    float[] o_arr = array.new_float(0)
        var 
    float[] h_arr = array.new_float(0)
        var 
    float[] l_arr = array.new_float(0)
        var 
    float[] c_arr = array.new_float(0)
        [
    ohlc] = request.security(syminfo.tickeridtf, [openhighlowclose])
        if 
    ta.change(time(tf)) != 0
            
    array.push(o_arro[1])
            array.
    push(h_arrh[1])
            array.
    push(l_arrl[1])
            array.
    push(c_arrc[1])
            if array.
    size(o_arr) > length
                
    array.shift(o_arr)
                array.
    shift(h_arr)
                array.
    shift(l_arr)
                array.
    shift(c_arr)
        
    HTF_Data.new(o_arrh_arrl_arrc_arr)

    data1 f_get_htf_data(tf1len1)
    data2 f_get_htf_data(tf2len2)
    data3 f_get_htf_data(tf3len3)
    data4 f_get_htf_data(tf4len4)
    data5 f_get_htf_data(tf5len5)
    data6 f_get_htf_data(tf6len6)

    // ========================================================================= //
    // ========================= SAR CALCULATION =============================== //
    // ========================================================================= //
    // Çekilen HTF array'leri üzerinde lokal SAR hesaplamasý yapan motor.

    f_calc_sar(float[] highsfloat[] lowsfloat startfloat incfloat max_af) =>
        
    int n = array.size(highs)
        
    float[] out = array.new_float(nna)
        if 
    1
            int trend 
    1
            float ep 
    = array.get(highs0)
            
    float sar_val = array.get(lows0)
            
    float af start
            
            
    array.set(out0sar_val)
            
            for 
    1 to n 1
                float prev_sar 
    sar_val
                float next_sar 
    prev_sar af * (ep prev_sar)
                
                
    float h_prev = array.get(highs1)
                
    float l_prev = array.get(lows1)
                
    float h_prev2 ? array.get(highs2) : h_prev
                float l_prev2 
    ? array.get(lows2) : l_prev
                
                
    if trend == 1
                    next_sar 
    := math.min(next_sarl_prevl_prev2)
                    
    float current_low = array.get(lowsi)
                    if 
    current_low next_sar
                        trend 
    := -1
                        next_sar 
    := ep
                        ep 
    := current_low
                        af 
    := start
                    
    else
                        
    float current_high = array.get(highsi)
                        if 
    current_high ep
                            ep 
    := current_high
                            af 
    := math.min(max_afaf inc)
                else
                    
    next_sar := math.max(next_sarh_prevh_prev2)
                    
    float current_high = array.get(highsi)
                    if 
    current_high next_sar
                        trend 
    := 1
                        next_sar 
    := ep
                        ep 
    := current_high
                        af 
    := start
                    
    else
                        
    float current_low = array.get(lowsi)
                        if 
    current_low ep
                            ep 
    := current_low
                            af 
    := math.min(max_afaf inc)
                
                array.
    set(outinext_sar)
                
    sar_val := next_sar
        out

    // ========================================================================= //
    // =========================== DRAWING LOGIC =============================== //
    // ========================================================================= //

    var box[]   bg_boxes   = array.new_box()
    var 
    box[]   candle_b   = array.new_box()
    var 
    line[]  candle_w   = array.new_line()
    var 
    line[]  sar_lines  = array.new_line()

    f_cleanup() =>
        for 
    b in bg_boxes
            box
    .delete(b)
        for 
    b in candle_b
            box
    .delete(b)
        for 
    l in candle_w
            line
    .delete(l)
        for 
    l in sar_lines
            line
    .delete(l)
        array.
    clear(bg_boxes)
        array.
    clear(candle_b)
        array.
    clear(candle_w)
        array.
    clear(sar_lines)

    f_format_tf(string tf) =>
        
    float num str.tonumber(tf)
        
    string res tf
        
    if not na(num)
            
    res := num >= 60 str.tostring(int(num 60)) + "h" str.tostring(int(num)) + "m"
        
    res

    f_draw_minichart
    (HTF_Data datastring tf_labelint candlesint level) =>
        
    int n = array.size(data.c)
        if 
    2
            
    // SAR dizilerini oluþtur
            
    float[] sarK f_calc_sar(data.hdata.l0.0050.0050.05// Kýrmýzý (Yavaþ)
            
    float[] sarM f_calc_sar(data.hdata.l0.01,  0.01,  0.10// Mavi (Orta)
            
    float[] sarS f_calc_sar(data.hdata.l0.02,  0.02,  0.20// Sarý (Hýzlý)

            // Kutudan taþmamasý için genel Max/Min bulma
            
    float max_h = array.max(data.h)
            
    float min_l = array.min(data.l)
            
            for 
    0 to n 1
                float k 
    = array.get(sarKi)
                
    float m = array.get(sarMi)
                
    float s = array.get(sarSi)
                if 
    not na(k)
                    
    max_h := math.max(max_hk), min_l := math.min(min_lk)
                if 
    not na(m)
                    
    max_h := math.max(max_hm), min_l := math.min(min_lm)
                if 
    not na(s)
                    
    max_h := math.max(max_hs), min_l := math.min(min_ls)

            
    float hv ta.highest(high300)
            
    float lv ta.lowest(low300)
            
    float cr hv lv == syminfo.mintick 100 hv lv
            float my 
    = (hv lv) / 2
            float er 
    cr i_vScale

            int   col_idx 
    level 2
            int   row_idx 
    int(level 2)
            
    float row_gap er i_vBuffer
            float bh      
    = (er row_gap 2) / 3
            float start_y 
    my er 2
            float top_y   
    start_y row_idx * (bh row_gap)
            
    float bot_y   top_y bh

            int start_x 
    bar_index i_offset col_idx * (i_width i_gapX)
            
    int end_x   start_x i_width

            float itop 
    top_y bh 0.02
            float ibot 
    bot_y bh 0.02
            float ir   
    itop ibot
            float hr   
    max_h min_l == syminfo.mintick max_h min_l

            
    array.push(bg_boxesbox.new(start_xtop_yend_xbot_y,
                 
    border_color=c_borderbgcolor=c_bg,
                 
    text=f_format_tf(tf_label),
                 
    text_color=c_texttext_halign=text.align_center,
                 
    text_valign=text.align_bottomtext_size=size.small))

            
    float bs float(i_width) / candles

            
    for 0 to n 1
                int   idx 
    i
                float _o  
    = array.get(data.oidx)
                
    float _h  = array.get(data.hidx)
                
    float _l  = array.get(data.lidx)
                
    float _c  = array.get(data.cidx)

                
    float so ibot + ((_o min_l) / hr) * ir
                float sh 
    ibot + ((_h min_l) / hr) * ir
                float sl 
    ibot + ((_l min_l) / hr) * ir
                float sc 
    ibot + ((_c min_l) / hr) * ir

                int   xp  
    end_x int(bs)
                
    color col _c >= _o c_up c_down

                
    // Mum çizimi
                
    array.push(candle_wline.new(xpshxpslcolor=col))
                array.
    push(candle_bbox.new(xp 1soxp 1scborder_color=colbgcolor=col))

                
    // SAR çizimi (Küçük yatay kesikler)
                
    float valK = array.get(sarKidx)
                
    float valM = array.get(sarMidx)
                
    float valS = array.get(sarSidx)

                if 
    not na(valK)
                    
    float sy ibot + ((valK min_l) / hr) * ir
                    
    array.push(sar_linesline.new(xp-1syxp+1sycolor=color.redwidth=2))
                
                if 
    not na(valM)
                    
    float sy ibot + ((valM min_l) / hr) * ir
                    
    array.push(sar_linesline.new(xp-1syxp+1sycolor=color.bluewidth=2))
                
                if 
    not na(valS)
                    
    float sy ibot + ((valS min_l) / hr) * ir
                    
    array.push(sar_linesline.new(xp-1syxp+1sycolor=color.yellowwidth=2))

    if 
    barstate.islast
        f_cleanup
    ()
        
    f_draw_minichart(data1tf1len10)
        
    f_draw_minichart(data2tf2len21)
        
    f_draw_minichart(data3tf3len32)
        
    f_draw_minichart(data4tf4len43)
        
    f_draw_minichart(data5tf5len54)
        
    f_draw_minichart(data6tf6len65
    16.07.2024 - 10.12.2024

  2. ýcs bulut oluþturma örneði... https://www.tradingview.com/x/kJVRwPmj/

    PHP Code:
    //@version=6
    indicator("Yörük [Tek ICS Bulutu: 21]"shorttitle="ICS 21"overlay=truemax_lines_count=20max_bars_back=500)

    // ─────────────────────────────────────────────────────────────────
    //  1. SABÝTLER VE GÝRDÝLER
    // ─────────────────────────────────────────────────────────────────
    const float MIN_SIGMA 1e-10   
    const float PI        math.pi 

    color i_fillUp  
    input.color(#26a69a, "Yükseliþ Bulutu")
    color i_fillDn  input.color(#ef5350, "Düþüþ Bulutu")
    color i_fillRng input.color(#888888, "Yatay Bulut")
    int i_fillTr    input.int(85"Bulut Þeffaflýðý"minval 0maxval 100)

    // ─────────────────────────────────────────────────────────────────
    //  2. ÝZOTROPÝK KOORDÝNAT SÝSTEMÝ (ICS) MATEMATÝÐÝ
    // ─────────────────────────────────────────────────────────────────
    f_icsLine(float p1int x1float p2int x2int targetXfloat sig) =>
        
    float out p1
        
    if x1 != x2 and p1 and p2 and sig MIN_SIGMA
            float y1 
    math.log(p1) / sig
            float y2 
    math.log(p2) / sig
            float yT 
    y1 + (y2 y1) * (targetX x1) / (x2 x1)
            
    out := math.exp(yT sig)
        
    out

    f_icsAngle
    (float p1int x1float p2int x2float sig) =>
        
    float out 0.0
        
    if x1 != x2 and p1 and p2 and sig MIN_SIGMA
            float y1 
    math.log(p1) / sig
            float y2 
    math.log(p2) / sig
            out 
    := math.atan((y2 y1) / (x2 x1)) * 180.0 PI
        out

    // ─────────────────────────────────────────────────────────────────
    //  3. YANG-ZHANG VOLATÝLÝTE (σ) MANTIÐI
    // ─────────────────────────────────────────────────────────────────
    int i_sigmaLen 20
    float _yzOR 
    math.log(open nz(close[1], open))
    float _yzCO math.log(close open)
    float _yzHO math.log(high open)
    float _yzHC math.log(high close)
    float _yzLO math.log(low  open)
    float _yzLC math.log(low  close)

    float _sqOR ta.variance(_yzORi_sigmaLen)
    float _sqCO ta.variance(_yzCOi_sigmaLen)
    float _sqRS ta.sma(_yzHO _yzHC _yzLO _yzLCi_sigmaLen)

    float _k    0.34 / (1.34 + (i_sigmaLen 1.0) / math.max(i_sigmaLen 1.01.0))
    float _sq   nz(_sqOR) + _k nz(_sqCO) + (1.0 _k) * nz(_sqRS)
    float sigma math.max(math.sqrt(math.max(_sq0.0)), MIN_SIGMA)

    // ─────────────────────────────────────────────────────────────────
    //  4. SADECE 21 PERÝYODU ÝÇÝN GEÇMÝÞ BLOK VERÝLERÝ
    // ─────────────────────────────────────────────────────────────────
    float hh21 ta.highest(high21)
    float ll21 ta.lowest(low21)

    max_bars_back(hh21500)
    max_bars_back(ll21500)

    // ─────────────────────────────────────────────────────────────────
    //  5. TEKLÝ BULUT ÇÝZÝM MOTORU (NESNE YÖNELÝMLÝ YAPI)
    // ─────────────────────────────────────────────────────────────────
    type CloudDrawing
        line upLn
        line loLn
        line upPj
        line loPj
        linefill chFill
        linefill pjFill

    method updateCloud
    (CloudDrawing thisint Pseries float hhSseries float llSfloat sigcolor cUpcolor cDncolor cRngint transp) =>
        
    int groups 5
        float thresh 
    0.5
        int pjOff 
    34 // Ýleri Projeksiyon 34 Mum olarak sabitlendi
        
        
    bool _ok bar_index >= groups P
        
        
    if barstate.islastconfirmedhistory or barstate.islast
            line
    .delete(this.upLn)
            
    line.delete(this.loLn)
            
    line.delete(this.upPj)
            
    line.delete(this.loPj)
            
    linefill.delete(this.chFill)
            
    linefill.delete(this.pjFill)
            
            array<
    float_bGm = array.new<float>()
            array<
    float_bHi = array.new<float>()
            array<
    float_bLo = array.new<float>()
            array<
    int>   _bCx = array.new<int>()
            
            if 
    _ok
                
    for 0 to groups 1
                    int off 
    P
                    float hi 
    hhS[off]
                    
    float lo llS[off]
                    
    _bGm.push((hi and lo 0) ? math.exp((math.log(hi) + math.log(lo)) / 2.0) : na)
                    
    _bHi.push(hi)
                    
    _bLo.push(lo)
                    
    _bCx.push(bar_index off int(2))
                
                
    int _dir 0
                float _ang 
    0.0
                int _seg 
    0
                
                
    if _bGm.size() >= 2
                    float g0 
    _bGm.get(0)
                    
    float g1 _bGm.get(1)
                    if 
    not na(g0) and not na(g1) and g0 != g1
                        int pd 
    g0 g1 : -1
                        _seg 
    := 1
                        
    if groups 2
                            
    for 1 to groups 2
                                float a 
    _bGm.get(i)
                                
    float b _bGm.get(1)
                                if 
    not na(a) and not na(b)
                                    if (
    : (? -0)) == pd
                                        _seg 
    := 1
                                    
    else
                                        break
                                else
                                    break
                        
                        if 
    _bGm.size() > _seg
                            _ang 
    := f_icsAngle(_bGm.get(_seg), _bCx.get(_seg), _bGm.get(0), _bCx.get(0), sig)
                        
                        
    _dir := math.abs(_ang) <= thresh pd
                
                
    if _seg >= and _bHi.size() > _seg
                    float fHH 
    nafloat fLH nafloat fHL nafloat fLL na
                    int   xHH 
    naint   xLH naint   xHL naint   xLL na
                    
                    
    for 0 to _seg
                        float h 
    _bHi.get(i)
                        
    float l _bLo.get(i)
                        
    int   x _bCx.get(i)
                        if 
    na(fHH) or fHH
                            fHH 
    := hxHH := x
                        
    if na(fLH) or fLH
                            fLH 
    := hxLH := x
                        
    if na(fHL) or fHL
                            fHL 
    := lxHL := x
                        
    if na(fLL) or fLL
                            fLL 
    := lxLL := x

                    int sLx 
    _bCx.get(_seg)
                    
    int sRx _bCx.get(0)
                    
    float uY1 nafloat uY2 nafloat lY1 nafloat lY2 na
                    
                    
    if _dir == 1
                        uY1 
    := f_icsLine(fLHxLHfHHxHHsLxsig)
                        
    uY2 := f_icsLine(fLHxLHfHHxHHsRxsig)
                        
    lY1 := f_icsLine(fLLxLLfHLxHLsLxsig)
                        
    lY2 := f_icsLine(fLLxLLfHLxHLsRxsig)
                    else if 
    _dir == -1
                        uY1 
    := f_icsLine(fHHxHHfLHxLHsLxsig)
                        
    uY2 := f_icsLine(fHHxHHfLHxLHsRxsig)
                        
    lY1 := f_icsLine(fHLxHLfLLxLLsLxsig)
                        
    lY2 := f_icsLine(fHLxHLfLLxLLsRxsig)
                    else
                        
    uY1 := nz(fHH), uY2 := nz(fHH)
                        
    lY1 := nz(fLL), lY2 := nz(fLL)

                    
    int ax bar_index
                    float uYa 
    f_icsLine(uY1sLxuY2sRxaxsig)
                    
    float lYa f_icsLine(lY1sLxlY2sRxaxsig)

                    
    this.upLn := line.new(sLxuY1axuYacolor na)
                    
    this.loLn := line.new(sLxlY1axlYacolor na)

                    
    int eX ax pjOff
                    float uYe 
    f_icsLine(uY1sLxuY2sRxeXsig)
                    
    float lYe f_icsLine(lY1sLxlY2sRxeXsig)
                    
                    
    this.upPj := line.new(axuYaeXuYecolor na)
                    
    this.loPj := line.new(axlYaeXlYecolor na)

                    
    color baseColor _dir == cUp _dir == -cDn cRng
                    color fc 
    color.new(baseColortransp)
                    
                    
    this.chFill := linefill.new(this.upLnthis.loLnfc)
                    
    this.pjFill := linefill.new(this.upPjthis.loPjfc)

    // ─────────────────────────────────────────────────────────────────
    //  6. BULUTU BAÞLAT VE GÜNCELLE
    // ─────────────────────────────────────────────────────────────────
    var c21 CloudDrawing.new(nananananana)

    // Sadece tek bulut (21) iþleniyor
    c21.updateCloud(21hh21ll21sigmai_fillUpi_fillDni_fillRngi_fillTr
    16.07.2024 - 10.12.2024

  3. bulutu... yineleme... 3lü trend bulutu... 13-21-34 deðerli kullanýlmýþ örnek...
    https://www.tradingview.com/x/VkrklFje/
    16.07.2024 - 10.12.2024

  4. tek bulutu...mtf... chart gösterim... üzerinde çalýþýlacak...
    yani kutulara deðerleri yazma gibi... https://www.tradingview.com/x/w5hSL4iD/ bu çalýþmasý devam eden hali...

    PHP Code:
    //@version=5
    indicator(" [ICS 21 Bulutu]"overlay=truemax_boxes_count=500max_lines_count=500)

    // ========================================================================= //
    // =============================== GÝRDÝLER ================================ //
    // ========================================================================= //

    grp_pos "PENCERE AYARLARI"
    i_width   input.int(45,    "Grafik Geniþliði"group=grp_pos)
    i_offset  input.int(5,     "Yatay Uzaklýk",    group=grp_pos)
    i_gapX    input.int(10,    "Yatay Boþluk",     group=grp_pos)
    i_vScale  input.float(35.0"Dikey Ölçekleme",  group=grp_posstep=0.1)
    i_vBuffer input.float(0.02"Dikey Tampon (%)"group=grp_posstep=0.01)

    tf1 input.timeframe("5",  "Periyot 1"group="ZAMAN DÝLÝMLERÝ")
    tf2 input.timeframe("15",  "Periyot 2"group="ZAMAN DÝLÝMLERÝ")
    tf3 input.timeframe("60""Periyot 3"group="ZAMAN DÝLÝMLERÝ")
    tf4 input.timeframe("240",   "Periyot 4"group="ZAMAN DÝLÝMLERÝ")

    c_up      input.color(color.new(#00e676, 0), "Yükseliþ Mumu", group="RENKLER")
    c_down    input.color(color.new(#ff1744, 0), "Düþüþ Mumu",    group="RENKLER")
    c_bg      input.color(color.new(#1a1a1a, 85), "Arka Plan",    group="RENKLER")
    c_border  input.color(color.new(#ffffff, 80), "Çerçeve",      group="RENKLER")

    c_fillUp  input.color(color.new(#26a69a, 80), "Yükseliþ Bulutu", group="BULUT RENKLERÝ")
    c_fillDn  input.color(color.new(#ef5350, 80), "Düþüþ Bulutu",    group="BULUT RENKLERÝ")
    c_fillRng input.color(color.new(#888888, 80), "Yatay Bulut",     group="BULUT RENKLERÝ")

    // ========================================================================= //
    // ================== ICS 21 MATEMATÝÐÝ (DÝZÝLERDEN ARINDIRILMIÞ) ========== //
    // ========================================================================= //

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

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

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

    // Nativ ICS hesaplayýcýsý (Çökmeyi engellemek için array kullanmaz)
    f_ics_calc() =>
        
    int P 21
        float sig 
    f_yz_sigma(20)
        
        
    float h0 ta.highest(highP), float l0 ta.lowest(lowP)
        
        
    // Yeterli bar yoksa doðrudan fiyatý döndür
        
    if bar_index 5
            
    [h0l00.0]
        else
            
    float h1 h0[P],   float l1 l0[P]
            
    float h2 h0[P*2], float l2 l0[P*2]
            
    float h3 h0[P*3], float l3 l0[P*3]
            
    float h4 h0[P*4], float l4 l0[P*4]

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

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

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

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

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

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

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

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

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

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

            [
    uYalYafloat(dir)]

    // ========================================================================= //
    // =================== HTF (BÜYÜK ZAMAN) VERÝ PAKETLEYÝCÝ ================== //
    // ========================================================================= //

    // 15 mumluk veriyi çökmeyi engelleyecek þekilde sabit statik dizilere paketliyoruz.
    f_veri_paketi() =>
        
    o_arr = array.new_float(15na), h_arr = array.new_float(15na), l_arr = array.new_float(15na), c_arr = array.new_float(15na)
        
    u_arr = array.new_float(15na), dn_arr = array.new_float(15na), dir_arr = array.new_float(15na)
        
        [
    udndir] = f_ics_calc()
        
        for 
    0 to 14
            
    array.set(o_arriopen[i])
            array.
    set(h_arrihigh[i])
            array.
    set(l_arrilow[i])
            array.
    set(c_arriclose[i])
            array.
    set(u_arriu[i])
            array.
    set(dn_arridn[i])
            array.
    set(dir_arridir[i])
            
        [
    o_arrh_arrl_arrc_arru_arrdn_arrdir_arr]

    [
    o1h1l1c1u1dn1dir1] = request.security(syminfo.tickeridtf1f_veri_paketi())
    [
    o2h2l2c2u2dn2dir2] = request.security(syminfo.tickeridtf2f_veri_paketi())
    [
    o3h3l3c3u3dn3dir3] = request.security(syminfo.tickeridtf3f_veri_paketi())
    [
    o4h4l4c4u4dn4dir4] = request.security(syminfo.tickeridtf4f_veri_paketi())

    // ========================================================================= //
    // =========================== ÇÝZÝM MOTORU ================================ //
    // ========================================================================= //

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

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

    f_isim_ver(tf) =>
        
    float num str.tonumber(tf)
        
    string res tf
        
    if not na(num)
            
    res := num >= 60 str.tostring(int(num 60)) + "S" str.tostring(int(num)) + "D"
        
    else
            
    res := tf == "D" "GÜN" tf == "W" "HFT" tf
        res

    f_mini_grafik_ciz
    (o_arrh_arrl_arrc_arru_arrdn_arrdir_arrtf_labellevel) =>
        if array.
    size(c_arr) > and not na(array.get(c_arr0))
            
    float max_h = array.max(h_arr)
            
    float min_l = array.min(l_arr)
            
            
    // Bulut sýnýrlarýný da kutu dýþýna taþmamasý için kontrol ediyoruz
            
    for 0 to 14
                float u_val 
    = array.get(u_arri)
                
    float l_val = array.get(dn_arri)
                if 
    not na(u_val)
                    
    max_h := math.max(max_hu_val), min_l := math.min(min_lu_val)
                if 
    not na(l_val)
                    
    max_h := math.max(max_hl_val), min_l := math.min(min_ll_val)

            
    float hv ta.highest(high300)
            
    float lv ta.lowest(low300)
            
    float cr hv lv == syminfo.mintick 100 hv lv
            float my 
    = (hv lv) / 2
            float er 
    cr i_vScale

            int   col_idx 
    level 2
            int   row_idx 
    int(level 2)
            
    float row_gap er i_vBuffer
            float bh      
    = (er row_gap 2) / 3
            float start_y 
    my er 2
            float top_y   
    start_y row_idx * (bh row_gap)
            
    float bot_y   top_y bh

            int start_x 
    bar_index i_offset col_idx * (i_width i_gapX)
            
    int end_x   start_x i_width

            float itop 
    top_y bh 0.02
            float ibot 
    bot_y bh 0.02
            float ir   
    itop ibot
            float hr   
    max_h min_l == syminfo.mintick max_h min_l
            
            
    // 1. EKRAN ARKA PLANI
            
    box arka_plan box.new(start_xtop_yend_xbot_yborder_color=c_borderbgcolor=c_bg)
            
    box.set_text(arka_planf_isim_ver(tf_label))
            
    box.set_text_color(arka_plancolor.gray)
            
    box.set_text_halign(arka_plantext.align_center)
            
    box.set_text_valign(arka_plantext.align_bottom)
            
    box.set_text_size(arka_plansize.small)
            array.
    push(kutu_bgarka_plan)

            
    float bs float(i_width) / 15
            int box_w 
    math.max(1int(bs 2))

            for 
    0 to 14
                int   idx 
    14 i
                float _o  
    = array.get(o_arridx)
                
    float _h  = array.get(h_arridx)
                
    float _l  = array.get(l_arridx)
                
    float _c  = array.get(c_arridx)
                
                
    float u_val = array.get(u_arridx)
                
    float l_val = array.get(dn_arridx)
                
    float d_val = array.get(dir_arridx)

                
    float so ibot + ((_o min_l) / hr) * ir
                float sh 
    ibot + ((_h min_l) / hr) * ir
                float sl 
    ibot + ((_l min_l) / hr) * ir
                float sc 
    ibot + ((_c min_l) / hr) * ir

                int   xp  
    end_x int(bs)
                
    color col _c >= _o c_up c_down

                
    // 2. BULUT DOLGUSU (Mumlarýn arkasýnda kalmasý için önce çizilir)
                
    if not na(u_val) and not na(l_val)
                    
    float sy_u ibot + ((u_val min_l) / hr) * ir
                    float sy_l 
    ibot + ((l_val min_l) / hr) * ir
                    color cCloud 
    d_val == c_fillUp d_val == -c_fillDn c_fillRng
                    
                    
    // Bulut dolgusu efekti vermek için her bara þeffaf bir kutu çiziyoruz
                    
    array.push(kutu_bulutbox.new(xp box_wsy_uxp box_wsy_lbgcolor=cCloudborder_color=na))

                
    // 3. MUMLAR (Bulutun üstüne çizilir)
                
    array.push(cizgi_mumline.new(xpshxpslcolor=col))
                array.
    push(kutu_mumbox.new(xp 1soxp 1scborder_color=colbgcolor=col))

    if 
    barstate.islast
        f_temizle
    ()
        
    f_mini_grafik_ciz(o1h1l1c1u1dn1dir1tf10)
        
    f_mini_grafik_ciz(o2h2l2c2u2dn2dir2tf21)
        
    f_mini_grafik_ciz(o3h3l3c3u3dn3dir3tf32)
        
    f_mini_grafik_ciz(o4h4l4c4u4dn4dir4tf43
    denemek ve geliþtirmek isteyene...
    16.07.2024 - 10.12.2024

  5. deneme...
    PHP Code:
    //@version=5
    indicator("Little Chart [Tekil ICS 21]"overlay=truemax_boxes_count=5000max_lines_count=500max_labels_count=50)

    // ========================================================================= //
    // =============================== GÝRDÝLER ================================ //
    // ========================================================================= //

    grp_pos "PENCERE VE BOYUT AYARLARI"
    i_bars    input.int(10,    "Gösterilecek Mum Sayýsý"group=grp_posminval=10)
    i_width   input.int(20,   "Pencere Geniþliði (Bar)"group=grp_posminval=20)
    i_offset  input.int(1,    "Yatay Uzaklýk (Saða)",    group=grp_pos)
    i_vScale  input.float(100.0"Dikey Ölçekleme (%)",    group=grp_posstep=1.0)

    grp_style "RENKLER VE GÖRSELLÝK"
    c_up      input.color(color.new(#00e676, 0), "Yükseliþ Mumu", group=grp_style)
    c_down    input.color(color.new(#ff1744, 0), "Düþüþ Mumu",    group=grp_style)
    c_bg      input.color(color.new(#0b0e14, 20), "Arka Plan Kutusu",group=grp_style)
    c_border  input.color(color.new(#ffffff, 80), "Pencere Çerçevesi",group=grp_style)

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

    // ========================================================================= //
    // ================== ICS 21 MATEMATÝÐÝ (YERLEÞÝK HESAPLAMA) =============== //
    // ========================================================================= //
    // Dizi (Array) kullanmadan, doðrudan zaman serisi üzerinden çalýþýr. Çökmez.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            [
    uYalYafloat(dir)]

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

    // ========================================================================= //
    // =========================== ÇÝZÝM MOTORU (HÝYERARÞÝ) ==================== //
    // ========================================================================= //

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

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

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

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

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

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

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


Sayfa 402/402 ÝlkÝlk ... 302352392400401402

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
  •