Artan

34,10 10 18:10
12,00 9.99 18:10
6.742,50 9.99 18:10
36,58 9.98 18:10
18,32 9.96 18:10
Artan Hisseler

Azalan

477,00 -10 18:10
7,92 -10 18:10
95,40 -10 18:10
31,90 -9.99 18:10
30,48 -9.98 18:10
Azalan Hisseler

İşlem

15.610.120.553,75 18:10
15.395.772.063,75 18:10
12.839.122.521,65 18:10
11.391.294.342,66 18:10
10.987.845.810,50 18:10
Tüm Hisseler
Sayfa 365/366 İlkİlk ... 265315355363364365366 SonSon
Arama sonucu : 2923 madde; 2,913 - 2,920 arası.

Konu: Tradingview

  1.  Alıntı Originally Posted by BJK Coccinella Yazıyı Oku
    KısaVade üstadım;

    Şu an için böyle bir problemim yok ama bilgi dağarcığımız gelişsin lazım olur diye soruyorum. Dediğiniz gibi fiyat üzerine atılan bazı göstergeler yeniden ölçeklendiriliyor. Bunu önlemenin yani sabitlemenin herhangi bir yolu var mıdır? MetaStock, Matriks v.b. için...
    Selamlar üstadım. MetaStock için hiç fikrim yok. Seninle fikir alışverişi için indirdiğim sürümü de sildim. Elimde yok.
    On yıldan fazla oldu Matriks de kullanmayalı. Arada başka amaçlar için demo indirdiğim oldu ama...
    Geçmişte kayıtlı olduğumdan şimdi Demo indirmeme de izin vermiyor.

    Özetle kontrol edemedim. Ama mantıken şöyle olmalı:







    NOT: AKFYE olgunlaşmış görünüyor. Hayırlısı olsun.
    Al,sat,tut,yakala,sık,bırak vb. tavsiye için aracı kurumunuzla görüşün.

  2.  Alıntı Originally Posted by KısaVade Yazıyı Oku
    Selamlar üstadım. MetaStock için hiç fikrim yok. Seninle fikir alışverişi için indirdiğim sürümü de sildim. Elimde yok.
    On yıldan fazla oldu Matriks de kullanmayalı. Arada başka amaçlar için demo indirdiğim oldu ama...
    Geçmişte kayıtlı olduğumdan şimdi Demo indirmeme de izin vermiyor.

    Özetle kontrol edemedim. Ama mantıken şöyle olmalı:







    NOT: AKFYE olgunlaşmış görünüyor. Hayırlısı olsun.
    Teşekkür ederim Üstadım...

    Evet şu aralar kanımla canımla AKFYE !!!
    “Başarısızlık yeniden ve daha zekice başlayabilme fırsatından başka bir şey değildir.” Henry Ford

  3.  Alıntı Originally Posted by KısaVade Yazıyı Oku
    Bu arada özellikle Tranigview ücretsiz plan kullanıp,
    aynı ekranda farklı zaman dilimi ve/veya gösterge kullanmak isteyenler için,
    Google Chrome'un duyurduğu yeni özellik ilaç gibi...

    Açık sekmelerden birinin tepesine sağ tuşla tıklayıp,
    "Sekmeyi yeni bölünmüş görünüme ekle" seçeneğini tıklarsanız:





    Sonra da eklemek istediğiniz 2. sekmeyi sağdan seçerseniz...:





    Windows'un ekran bölme vb. fonksiyonundan iyi. Çünkü tek bir sekme olarak hareket ediyor.
    çok çok teşekkürler.... ilaç gibi geldi.... https://hizliresim.com/e5xm7f3
    16.07.2024 - 10.12.2024

  4.  Alıntı Originally Posted by KısaVade Yazıyı Oku
    Sözünü ettiğimiz TV koduyla üretilen göstergenin bile kendi içinde bir mantığı var.

    Oysa tam tersine. Gerçek MACD sözü edilen.
    MACD göstergesini fiyatın üzerine atınca, Matriks Veri Terminali "fiyat barları anlaşılır biçimde görülebilsin" diye,
    göstergeyi fiyata göre yeniden ölçeklendirdiği için öyle bir göz yanılsamasına neden oluyor.

    Önemli olan kod yazmak değil abi. Olsa iyi olur elbet.
    Önemli olan amaca yönelik sonuçlar çıkarıp, mevcut olandan kendi kafandakine uygun bir sistem yaratabilmek.
    Ayrıca bir ara AI(Yapay Zeka) ile kodlama işini girmiştin yanlış hatırlamıyorsam. Verimli olmadı mı?
    AI olarak Gemini kullanıyorum. Verim alamadığım için yapay zeka ile kodlamayı bıraktım.
    Çünkü istediğimi tam olarak "prompt" yapamayınca, sonuç zaman kaybı oluyor.

    Yapay zekayı, yazdığım kitabı kontrol amaçlı kullanıyorum. Bu yüzden vaktimin çoğunu kitabımı daha anlaşılır hale getirmek için
    "prompt" yazmakla uğraşıyorum. Ancak istediğimi henüz elde edemedim. Dönüt için insanların fikrine ihtiyacım var.
    Yapay zeka ile ancak kısaltma, sadeleştirme, güncel dil kelimeleri, tasarım için kullanıyorum.
    16.07.2024 - 10.12.2024

  5. bir birleştirme örneği....

    not canlı veride çalışır.

    önce maç süresini 90 dakka üzerinden başlattık. Range alanını, süreyle böldük. 15-30-45-60-90 diye...
    15-30 mavi, 45 ilk yarı olacağı için beyaz....60-90 turuncu olsun.... tabi maçın sonucunu da....
    canlı takip için sonuna bu sürelerin barlarını üst üste bindirdik.

    bakınız..... https://www.tradingview.com/x/UXARQGp1/


    hakem olarak... renko barla hesaplanan trend koyduk.... https://www.tradingview.com/x/AqYwilMH/

    hakeme... kartlarını bar renkleme olarak verdik.... her 5 barı... yüksek düşük hesapla.... koştukları anı konsildasyon yap dedik.

    beyaz long, sarı konsolide, kırmızı çık dışarı gibi olurken....
    takımların kontra ataklarını... fuşya ve mavi olarak işaretledik ki... o barlarda "var" gitmek gerek.
    https://www.tradingview.com/x/Lhpr513V/

    ortaya çıkan sonuç...
    https://www.tradingview.com/x/TYAccweT/
    https://www.tradingview.com/x/hsffQXvo/
    https://www.tradingview.com/x/V5RGySWe/
    https://www.tradingview.com/x/0u7FzTXu/
    https://www.tradingview.com/x/oeVuss4I/

    denemek, değiştirmek, yeniden revize etmek isteyene birleşmiş kod örneği....
    PHP Code:
    //@version=6
    indicator('..'overlay false,  max_lines_count 500max_boxes_count 500)

    enum RenkoStyle
        atr 
    "ATR"
        
    percent "Percent"
        
    static = "Static Value"


    ////////////
    enum Direction
        up 
    "Up"
        
    down "Down"
        
    nan "No Trend"


    ///////
    type Renko
        float current
        float hold
        float high_level
        float low_level
        Direction direction
        color colour


    // //////////
    atr_rma(float sourcefloat length)=>
        
    float alpha math.min(lengthbar_index 1)
        
    float i_alpha alpha
        float rma 
    source
        rma 
    := source alpha nz(rma[1], rma) * i_alpha
        rma


    //////////////
    tr()=>
        
    math.max(high low
                 
    math.abs(high nz(close[1], math.max(openclose)))
                 , 
    math.abs(low nz(close[1], math.min(openclose)))
                 )


    /////////////
    atr(float period)=>
        
    atr_rma(tr(), period)


    // ////////////
    init_renko()=>
        var 
    Renko renko Renko.new(openopenopenopenDirection.nanna)
        
    renko


    /////////////////
    method get_color(Renko selfcolor bullishcolor bearish)=>
        var 
    color colour chart.fg_color
        float value 
    self.current
        float delta 
    value nz(value[1], value)

        
    colour := switch self.direction
            Direction
    .up => color.from_gradient(closeself.low_levelself.currentchart.fg_colorbullish)
            
    Direction.down => color.from_gradient(closeself.currentself.high_levelbearishchart.fg_color)
            => 
    color.from_gradient(closeself.low_levelself.high_levelbearishbullish)

        
    colour


    ///////////
    method atr(Renko selffloat close_sourcefloat periodfloat multiplierbool hold_until_new)=>
        
    float atr atr(period) * multiplier

        
    var float renko_atr atr

        
    if not hold_until_new
            renko_atr 
    := atr

        int new_bars 
    math.floor(math.abs(self.hold close_source) / renko_atr)
        
    int direction close_source self.hold : -1

        
    if new_bars 0
            self
    .direction := direction == Direction.up Direction.down

            
    while new_bars 0
                float new_open 
    self.hold renko_atr direction
                self
    .hold := new_open
                new_bars 
    := math.floor(math.abs(new_open close_source) / renko_atr)

            if 
    hold_until_new
                renko_atr 
    := atr

        self
    .current := self.hold
        self
    .high_level := self.hold renko_atr
        self
    .low_level := self.hold renko_atr

        self


    ////////////
    method percent(Renko selffloat close_sourcefloat percent_changebool hold_until_new)=>
        
    float percent percent_change 0.01

        float up_level 
    self.hold * (percent)
        
    float down_level self.hold * (percent)

        
    self.high_level := up_level
        self
    .low_level := down_level

        float up_range 
    math.abs(self.hold up_level)
        
    float down_range math.abs(self.hold down_level)

        
    bool new_up close_source >= up_level
        bool new_down 
    close_source <= down_level

        
    if new_up
            self
    .direction := Direction.up

            int new_bars 
    math.floor(math.abs(close_source self.hold) / up_range)

            while 
    new_bars 0
                up_range 
    := hold_until_new up_range math.abs(self.hold self.hold * (percent))
                
    float new = self.hold up_range
                self
    .hold := new
                
    new_bars := math.floor(math.abs(close_source self.hold) / up_range)

        else if 
    new_down
            self
    .direction := Direction.down

            int new_bars 
    math.floor(math.abs(close_source self.hold) / down_range)

            while 
    new_bars 0
                down_range 
    := hold_until_new down_range math.abs(self.hold self.hold * (percent))
                
    float new = self.hold down_range
                self
    .hold := new
                
    new_bars := math.floor(math.abs(close_source self.hold) / down_range)

        
    self.high_level := self.hold * (percent)
        
    self.low_level := self.hold * (percent)
        
    self.current := self.hold
        self


    //////////////
    method static(Renko selffloat close_sourcefloat static_change)=>
        
    float static_distance math.round_to_mintick(static_change)

        
    int new_bars math.floor(math.abs(self.current close_source) / static_distance)
        
    int direction close_source self.current : -1

        
    while new_bars 0
            self
    .direction := direction == Direction.up Direction.down

            float 
    new = self.hold static_distance direction
            self
    .hold := new
            
    new_bars := math.floor(math.abs(self.hold close_source) / static_distance)

        
    self.current := self.hold
        self
    .high_level := self.hold static_distance
        self
    .low_level := self.hold static_distance

        self


    /////////////////
    renko(float close_sourcefloat atr_periodfloat atr_multiplierfloat percent_changefloat static_changebool hold_atr_until_newbool hold_percent_until_newfloat smoothingcolor bullish_colorcolor bearish_colorsimple RenkoStyle style)=>
        var 
    Renko renko init_renko()

        switch 
    style
            RenkoStyle
    .atr => renko.atr(close_sourceatr_periodatr_multiplierhold_atr_until_new)
            
    RenkoStyle.percent => renko.percent(close_sourcepercent_changehold_percent_until_new)
            
    RenkoStyle.static => renko.static(close_sourcestatic_change)
            => 
    renko

        renko
    .current := atr_rma(renko.currentsmoothing)
        
    renko.high_level := atr_rma(renko.high_levelsmoothing)
        
    renko.low_level := atr_rma(renko.low_levelsmoothing)
        
    renko.colour := renko.get_color(bullish_colorbearish_color)

        
    renko


    // renko }


    var const string global_group "Global Settings"
    var const string trend_color_inline "trend_color_inline"

    var const string close_source_tt "The closing source for the renko calculations."

    var const string renko_style_tt "Renko brick size calculation method.\n\n"
     
    "• ATR - Dynamic brick size based on Average True Range.\n"
     
    "• Percent - Fixed percentage of current price for brick size.\n"
     
    "• Static Value - Fixed absolute price distance for bricks."

    var const string smoothing_tt "RMA smoothing period for Renko levels.\n"
     
    "Larger values create smoother, more stable bands.\n"
     
    "Minimum value of 1 disables smoothing."

    var const string static_color_tt "Fixed color for Renko line when trend coloring is disabled.\n"
     
    "Used when 'Use Trend Color' is turned off."

    var const string trend_color_tt "Gradient colors for trend-based coloring.\n"
     
    "Renko line and candles interpolate between these colors based on price position.\n\n"
     
    "• Left color - Bullish/uptrend color.\n"
     
    "• Right color - Bearish/downtrend color."

    var const string show_renko_line_tt "Toggle display of the main Renko centerline.\n"
     
    "The line tracks the current smoothed Renko brick price."

    var const string use_polar_color_tt "Enable dynamic gradient coloring based on trend.\n\n"
     
    "• Enabled - Uses gradient between bullish and bearish colors.\n"
     
    "• Disabled - Uses static color for Renko line."

    var const string enable_candle_color_tt "Apply trend-based gradient coloring to chart candles.\n"
     
    "Colors candles based on position relative to Renko levels."

    float close_source input.source(close"Close Source"tooltip close_source_ttgroup global_group)
    var 
    RenkoStyle renko_style input.enum(RenkoStyle.atr"Style"tooltip renko_style_ttgroup global_group)
    float smoothing input.float(1.25"Smoothing"minval 1step 0.125tooltip smoothing_ttgroup global_group)
    color static_color input.color(color.blue"Static Color"tooltip static_color_ttgroup global_group)
    color bullish_color input.color(#00FF00, "Trend Color", inline = trend_color_inline, group = global_group)
    color bearish_color input.color(#FF0000, "", inline = trend_color_inline, tooltip = trend_color_tt, group = global_group)
    bool show_renko_line input.bool(true"Show Renko Line"tooltip show_renko_line_ttgroup global_group)
    bool use_polar_color input.bool(true"Use Trend Color"tooltip use_polar_color_ttgroup global_group)
    bool enable_candle_color input.bool(false"Candle Color"tooltip enable_candle_color_ttgroup global_group)


    var const 
    string atr_group "ATR Settings"
    bool atr_active renko_style == RenkoStyle.atr

    var const string atr_period_tt "Period for ATR calculation.\n"
     
    "Longer periods create smoother, less sensitive brick sizing.\n\n"
     
    "Only active when Style is set to ATR."

    var const string atr_multiplier_tt "Multiplier applied to ATR value for brick size.\n"
     
    "Larger multipliers create wider bricks and less frequent updates.\n\n"
     
    "Only active when Style is set to ATR."

    var const string hold_atr_until_new_tt "Control when ATR brick size recalculates.\n\n"
     
    "• Enabled - Lock ATR value until a new brick forms (more stable).\n"
     
    "• Disabled - Recalculate ATR every bar (more responsive).\n\n"
     
    "Only active when Style is set to ATR."

    float atr_period input.float(14"ATR Period"minval 1tooltip atr_period_ttactive atr_activegroup atr_group)
    float atr_multiplier input.float(2"ATR Multiplier"minval 0step 0.125tooltip atr_multiplier_ttactive atr_activegroup atr_group)
    bool hold_atr_until_new input.bool(true"Hold ATR Until New Renko"tooltip hold_atr_until_new_ttactive atr_activegroup atr_group)


    var const 
    string percent_group "Percent Settings"
    bool percent_active renko_style == RenkoStyle.percent

    var const string percent_change_tt "Percentage change required for new brick formation.\n"
     
    "For example, 0.5 means a 0.5% move from the last brick creates a new brick.\n\n"
     
    "Only active when Style is set to Percent."

    var const string hold_percent_until_new_tt "Control when percentage base recalculates.\n\n"
     
    "• Enabled - Lock percentage calculation to original brick price (compounding).\n"
     
    "• Disabled - Recalculate percentage from each new brick (non-compounding).\n\n"
     
    "Only active when Style is set to Percent."

    float percent_change input.float(0.5"Percent Change"minval 0.001step 0.001tooltip percent_change_ttactive percent_activegroup percent_group)
    bool hold_percent_until_new input.bool(false"Hold Percent Until New Renko"tooltip hold_percent_until_new_ttactive percent_activegroup percent_group)


    var const 
    string static_group "Static Settings"
    bool static_active renko_style == RenkoStyle.static

    var const 
    string static_change_tt "Fixed price distance for brick formation.\n"
     
    "New bricks form when price moves this absolute amount from the last brick.\n"
     
    "Value is automatically rounded to the instrument's minimum tick size.\n\n"
     
    "Only active when Style is set to Static Value."

    float static_change input.float(25"Static Change"minval 1step 0.01tooltip static_change_ttactive static_activegroup static_group)


    // inputs }


    // calc {


    Renko renko renko(close_sourceatr_periodatr_multiplierpercent_changestatic_changehold_atr_until_newhold_percent_until_newsmoothingbullish_colorbearish_colorrenko_style)
    float renko_line show_renko_line renko.current na
    color renko_color 
    use_polar_color renko.colour static_color
    color candle_color 
    enable_candle_color renko.colour na


    // calc }


    // plot {


    plot(renko_line"Renko"renko_color2)
    //plot(renko.high_level, "Renko Max", bullish_color)
    //plot(renko.low_level, "Renko Min", bearish_color)
    //barcolor(candle_color)


    // plot }

    type input.string(defval 'High-Low'title 'Candlestick style'options = ['High-Low''Open-Close''Just Color'])
    rcol input(true'Color bars for pivots?')
    range_1 input.int(5minval 1title 'High/Low Range')
    ccol input(true'Color bars for consolidation?')
    cons input.int(2minval 1title 'Consolidation Range')

    opener = (close[1] + open[1]) / 2
    closer 
    = (open high low close) / 4
    haO1 
    = (opener[1] + closer[1]) / 2
    haC1 
    = (opener high low closer) / 4
    haO 
    = (haO1[1] + haC1[1]) / 2
    haC 
    = (haO high low haC1) / 4
    haH 
    high
    haL 
    low

    btm 
    ta.lowest(lowrange_1)
    top ta.highest(highrange_1)

    tbtm btm btm[1]

    ttop top top[1]

    sideways hl2 ta.highest(cons)[1] and hl2 ta.lowest(cons)[1]

    col tbtm and rcol color.red ttop and rcol color.white sideways and ccol color.yellow haO haC color.blue color.fuchsia

    //plot(ta.sma(close, 1), color = col, linewidth = 1, editable = false, trackprice = true, show_last = 1)

    hv = if type == 'High-Low'
        
    high
    else
        if 
    type == 'Open-Close'
            
    open
        
    else
            
    na

    lv 
    = if type == 'High-Low'
        
    low
    else
        if 
    type == 'Open-Close'
            
    close
        
    else
            
    na

    bcol 
    type == 'Just Color' col na

    //barcolor(bcol)
    plotcandle(hvhvlvlvcolor colwickcolor na)
    //////////////////

    // Global Settings
    chartTimeframe input.int(title 'Chart Timeframe (minutes)'defval 1minval 1maxval 60group 'Global Settings')
    labelPosition input.float(title 'Label Position'defval 0.4minval = -2.0maxval 2.0group 'Global Settings')

    // Candle 1 Settings (30min)
    enableCandle1 input.bool(title 'Enable Candle 1'defval truegroup 'Candle 1 Settings')
    lookbackMinutes1 input.int(title 'Candle 1 Time Period (minutes)'defval 15minval 1maxval 1440group 'Candle 1 Settings')
    offsetBars1 input.int(title 'Offset (bars) for Candle 1'defval 2minval 1maxval 500group 'Candle 1 Settings')
    showLookbackLine1 input.bool(title 'Show Lookback Line (Candle 1)'defval truegroup 'Candle 1 Settings')
    lookbackLineWidth1 input.int(title 'Lookback Line Width (Candle 1)'defval 1minval 1maxval 10group 'Candle 1 Settings')
    lookbackLineColor1 input.color(title 'Lookback Line Color (Candle 1)'defval color.rgb(0188212), group 'Candle 1 Settings')
    lookbackLineStyle1 input.string(title 'Lookback Line Style (Candle 1)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 1 Settings')
    showHighLow1 input.bool(title 'Show Lookback High & Low (Candle 1)'defval truegroup 'Candle 1 Settings')
    highLowColor1 input.color(title 'Lookback H/L Lines Color (Candle 1)'defval color.rgb(0188212), group 'Candle 1 Settings')
    highLowStyle1 input.string(title 'Lookback H/L Lines Style (Candle 1)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 1 Settings')
    //showLabel1 = input.bool(title = 'Show Label (Candle 1)', defval = true, group = 'Candle 1 Settings')
    //labelColor1 = input.color(title = 'Label Color (Candle 1)', defval = color.rgb(0, 188, 212), group = 'Candle 1 Settings')

    // Candle 2 Settings (1hr)
    enableCandle2 input.bool(title 'Enable Candle 2'defval truegroup 'Candle 2 Settings')
    lookbackMinutes2 input.int(title 'Candle 2 Time Period (minutes)'defval 30minval 1maxval 1440group 'Candle 2 Settings')
    offsetBars2 input.int(title 'Offset (bars) for Candle 2'defval 2minval 1maxval 500group 'Candle 2 Settings')
    showLookbackLine2 input.bool(title 'Show Lookback Line (Candle 2)'defval truegroup 'Candle 2 Settings')
    lookbackLineWidth2 input.int(title 'Lookback Line Width (Candle 2)'defval 1minval 1maxval 10group 'Candle 2 Settings')
    lookbackLineColor2 input.color(title 'Lookback Line Color (Candle 2)'defval color.rgb(0188212), group 'Candle 2 Settings')
    lookbackLineStyle2 input.string(title 'Lookback Line Style (Candle 2)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 2 Settings')
    showHighLow2 input.bool(title 'Show Lookback High & Low (Candle 2)'defval truegroup 'Candle 2 Settings')
    highLowColor2 input.color(title 'Lookback H/L Lines Color (Candle 2)'defval color.rgb(0188212), group 'Candle 2 Settings')
    highLowStyle2 input.string(title 'Lookback H/L Lines Style (Candle 2)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 2 Settings')
    //showLabel2 = input.bool(title = 'Show Label (Candle 2)', defval = true, group = 'Candle 2 Settings')
    //labelColor2 = input.color(title = 'Label Color (Candle 2)', defval = color.rgb(233, 30, 99), group = 'Candle 2 Settings')

    // Candle 3 Settings (2hr)
    enableCandle3 input.bool(title 'Enable Candle 3'defval truegroup 'Candle 3 Settings')
    lookbackMinutes3 input.int(title 'Candle 3 Time Period (minutes)'defval 45minval 1maxval 1440group 'Candle 3 Settings')
    offsetBars3 input.int(title 'Offset (bars) for Candle 3'defval 2minval 1maxval 500group 'Candle 3 Settings')
    showLookbackLine3 input.bool(title 'Show Lookback Line (Candle 3)'defval truegroup 'Candle 3 Settings')
    lookbackLineWidth3 input.int(title 'Lookback Line Width (Candle 3)'defval 2minval 1maxval 10group 'Candle 3 Settings')
    lookbackLineColor3 input.color(title 'Lookback Line Color (Candle 3)'defval color.rgb(240239244), group 'Candle 3 Settings')
    lookbackLineStyle3 input.string(title 'Lookback Line Style (Candle 3)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 3 Settings')
    showHighLow3 input.bool(title 'Show Lookback High & Low (Candle 3)'defval truegroup 'Candle 3 Settings')
    highLowColor3 input.color(title 'Lookback H/L Lines Color (Candle 3)'defval color.rgb(240239244), group 'Candle 3 Settings')
    highLowStyle3 input.string(title 'Lookback H/L Lines Style (Candle 3)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 3 Settings')
    //showLabel3 = input.bool(title = 'Show Label (Candle 3)', defval = true, group = 'Candle 3 Settings')
    //labelColor3 = input.color(title = 'Label Color (Candle 3)', defval = color.rgb(132, 100, 247), group = 'Candle 3 Settings')

    // Candle 4 Settings (4hr)
    enableCandle4 input.bool(title 'Enable Candle 4'defval truegroup 'Candle 4 Settings')
    lookbackMinutes4 input.int(title 'Candle 4 Time Period (minutes)'defval 60minval 1maxval 1440group 'Candle 4 Settings')
    offsetBars4 input.int(title 'Offset (bars) for Candle 4'defval 2minval 1maxval 500group 'Candle 4 Settings')
    showLookbackLine4 input.bool(title 'Show Lookback Line (Candle 4)'defval truegroup 'Candle 4 Settings')
    lookbackLineWidth4 input.int(title 'Lookback Line Width (Candle 4)'defval 1minval 1maxval 10group 'Candle 4 Settings')
    lookbackLineColor4 input.color(title 'Lookback Line Color (Candle 4)'defval color.rgb(2551520), group 'Candle 4 Settings')
    lookbackLineStyle4 input.string(title 'Lookback Line Style (Candle 4)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 4 Settings')
    showHighLow4 input.bool(title 'Show Lookback High & Low (Candle 4)'defval truegroup 'Candle 4 Settings')
    highLowColor4 input.color(title 'Lookback H/L Lines Color (Candle 4)'defval color.rgb(2551520), group 'Candle 4 Settings')
    highLowStyle4 input.string(title 'Lookback H/L Lines Style (Candle 4)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 4 Settings')
    //showLabel4 = input.bool(title = 'Show Label (Candle 4)', defval = true, group = 'Candle 4 Settings')
    //labelColor4 = input.color(title = 'Label Color (Candle 4)', defval = color.rgb(255, 152, 0), group = 'Candle 4 Settings')

    // Candle 5 Settings (12hr)
    enableCandle5 input.bool(title 'Enable Candle 5'defval truegroup 'Candle 5 Settings')
    lookbackMinutes5 input.int(title 'Candle 5 Time Period (minutes)'defval 90minval 1maxval 1440group 'Candle 5 Settings')
    offsetBars5 input.int(title 'Offset (bars) for Candle 5'defval 2minval 1maxval 500group 'Candle 5 Settings')
    showLookbackLine5 input.bool(title 'Show Lookback Line (Candle 5)'defval truegroup 'Candle 5 Settings')
    lookbackLineWidth5 input.int(title 'Lookback Line Width (Candle 5)'defval 1minval 1maxval 10group 'Candle 5 Settings')
    lookbackLineColor5 input.color(title 'Lookback Line Color (Candle 5)'defval color.rgb(2551520), group 'Candle 5 Settings')
    lookbackLineStyle5 input.string(title 'Lookback Line Style (Candle 5)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 5 Settings')
    showHighLow5 input.bool(title 'Show Lookback High & Low (Candle 5)'defval truegroup 'Candle 5 Settings')
    highLowColor5 input.color(title 'Lookback H/L Lines Color (Candle 5)'defval color.rgb(2551520), group 'Candle 5 Settings')
    highLowStyle5 input.string(title 'Lookback H/L Lines Style (Candle 5)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 5 Settings')
    //showLabel5 = input.bool(title = 'Show Label (Candle 5)', defval = true, group = 'Candle 5 Settings')
    //labelColor5 = input.color(title = 'Label Color (Candle 5)', defval = color.rgb(255, 87, 34), group = 'Candle 5 Settings')

    // Function to format time period for label
    formatTimePeriod(minutes) =>
        if 
    minutes >= 60
            hours 
    math.floor(minutes 60)
            
    str.tostring(hours) + ' hrs'
        
    else
            
    str.tostring(minutes) + ' mins'

    // Function to calculate the candle's elements
    f_getCandleData(_lookbackMinutes) =>
        
    periodsForLookback _lookbackMinutes chartTimeframe
        periodHigh 
    ta.highest(highint(periodsForLookback))
        
    periodLow ta.lowest(lowint(periodsForLookback))
        
    firstPrice close[int(periodsForLookback)]
        
    lastPrice close
        colorCandle 
    lastPrice firstPrice color.green color.red
        
    [periodHighperiodLowfirstPricelastPricecolorCandle]

    // Get data for each candle
    [periodHigh1periodLow1firstPrice1lastPrice1colorCandle1] = f_getCandleData(lookbackMinutes1)
    [
    periodHigh2periodLow2firstPrice2lastPrice2colorCandle2] = f_getCandleData(lookbackMinutes2)
    [
    periodHigh3periodLow3firstPrice3lastPrice3colorCandle3] = f_getCandleData(lookbackMinutes3)
    [
    periodHigh4periodLow4firstPrice4lastPrice4colorCandle4] = f_getCandleData(lookbackMinutes4)
    [
    periodHigh5periodLow5firstPrice5lastPrice5colorCandle5] = f_getCandleData(lookbackMinutes5)

    // Calculate the highest point among all lookback periods
    maxHigh math.max(periodHigh1math.max(periodHigh2math.max(periodHigh3math.max(periodHigh4periodHigh5))))
    minLow math.min(periodLow1math.min(periodLow2math.min(periodLow3math.min(periodLow4periodLow5))))
    labelHeight maxHigh + (maxHigh minLow) * labelPosition

    // Define variables with types and initialize with `na`
    var line bodyLine1 na
    var line highWick1 na
    var line lookbackLine1 na
    var line highLine1 na
    var line lowLine1 na
    var label lookbackLabel1 na

    var line bodyLine2 na
    var line highWick2 na
    var line lookbackLine2 na
    var line highLine2 na
    var line lowLine2 na
    var label lookbackLabel2 na

    var line bodyLine3 na
    var line highWick3 na
    var line lookbackLine3 na
    var line highLine3 na
    var line lowLine3 na
    var label lookbackLabel3 na

    var line bodyLine4 na
    var line highWick4 na
    var line lookbackLine4 na
    var line highLine4 na
    var line lowLine4 na
    var label lookbackLabel4 na

    var line bodyLine5 na
    var line highWick5 na
    var line lookbackLine5 na
    var line highLine5 na
    var line lowLine5 na
    var label lookbackLabel5 na

    // Delete previous lines and labels if they exist
    if not na(bodyLine1)
        
    line.delete(bodyLine1)
    if 
    not na(highWick1)
        
    line.delete(highWick1)
    if 
    not na(lookbackLine1)
        
    line.delete(lookbackLine1)
    if 
    not na(highLine1)
        
    line.delete(highLine1)
    if 
    not na(lowLine1)
        
    line.delete(lowLine1)
    if 
    not na(lookbackLabel1)
        
    label.delete(lookbackLabel1)

    if 
    not na(bodyLine2)
        
    line.delete(bodyLine2)
    if 
    not na(highWick2)
        
    line.delete(highWick2)
    if 
    not na(lookbackLine2)
        
    line.delete(lookbackLine2)
    if 
    not na(highLine2)
        
    line.delete(highLine2)
    if 
    not na(lowLine2)
        
    line.delete(lowLine2)
    if 
    not na(lookbackLabel2)
        
    label.delete(lookbackLabel2)

    if 
    not na(bodyLine3)
        
    line.delete(bodyLine3)
    if 
    not na(highWick3)
        
    line.delete(highWick3)
    if 
    not na(lookbackLine3)
        
    line.delete(lookbackLine3)
    if 
    not na(highLine3)
        
    line.delete(highLine3)
    if 
    not na(lowLine3)
        
    line.delete(lowLine3)
    if 
    not na(lookbackLabel3)
        
    label.delete(lookbackLabel3)

    if 
    not na(bodyLine4)
        
    line.delete(bodyLine4)
    if 
    not na(highWick4)
        
    line.delete(highWick4)
    if 
    not na(lookbackLine4)
        
    line.delete(lookbackLine4)
    if 
    not na(highLine4)
        
    line.delete(highLine4)
    if 
    not na(lowLine4)
        
    line.delete(lowLine4)
    if 
    not na(lookbackLabel4)
        
    label.delete(lookbackLabel4)

    if 
    not na(bodyLine5)
        
    line.delete(bodyLine5)
    if 
    not na(highWick5)
        
    line.delete(highWick5)
    if 
    not na(lookbackLine5)
        
    line.delete(lookbackLine5)
    if 
    not na(highLine5)
        
    line.delete(highLine5)
    if 
    not na(lowLine5)
        
    line.delete(lowLine5)
    if 
    not na(lookbackLabel5)
        
    label.delete(lookbackLabel5)

    // Calculate the starting bar index for the lookback period for each candle
    lookbackBars1 int(lookbackMinutes1 chartTimeframe)
    lookbackBars2 int(lookbackMinutes2 chartTimeframe)
    lookbackBars3 int(lookbackMinutes3 chartTimeframe)
    lookbackBars4 int(lookbackMinutes4 chartTimeframe)
    lookbackBars5 int(lookbackMinutes5 chartTimeframe)

    // Draw the candle for each period
    x1 bar_index offsetBars1
    x2 
    bar_index offsetBars2
    x3 
    bar_index offsetBars3
    x4 
    bar_index offsetBars4
    x5 
    bar_index offsetBars5

    // Calculate minute changes outside of conditional statements
    var bool minuteChanged false
    minuteChanged 
    := ta.change(time('1')) != 0

    // Calculate color changes for each candle
    var bool colorChanged1 false
    var bool colorChanged2 false
    var bool colorChanged3 false
    var bool colorChanged4 false
    var bool colorChanged5 false

    colorChanged1 
    := colorCandle1 != colorCandle1[1]
    colorChanged2 := colorCandle2 != colorCandle2[1]
    colorChanged3 := colorCandle3 != colorCandle3[1]
    colorChanged4 := colorCandle4 != colorCandle4[1]
    colorChanged5 := colorCandle5 != colorCandle5[1]

    // Calculate if all candles are the same color
    allSameColor colorCandle1 == colorCandle2 and colorCandle2 == colorCandle3 and colorCandle3 == colorCandle4 and colorCandle4 == colorCandle5

    // Alert conditions
    alertcondition(colorChanged1title 'Candle 1 Color Change'message 'Candle 1 (30min) color changed')
    alertcondition(colorChanged2title 'Candle 2 Color Change'message 'Candle 2 (1hr) color changed')
    alertcondition(colorChanged3title 'Candle 3 Color Change'message 'Candle 3 (2hr) color changed')
    alertcondition(colorChanged4title 'Candle 4 Color Change'message 'Candle 4 (4hr) color changed')
    alertcondition(colorChanged5title 'Candle 5 Color Change'message 'Candle 5 (12hr) color changed')
    alertcondition(allSameColortitle 'All Candles Same Color'message 'All candles are the same color')

    // Alert handling
    if colorChanged1
        currentColor 
    colorCandle1 == color.green 'GREEN' 'RED'
        
    previousColor colorCandle1[1] == color.green 'GREEN' 'RED'
        
    alert('Candle 1 (30min) changed from ' previousColor ' to ' currentColoralert.freq_once_per_bar_close)

    if 
    colorChanged2
        currentColor 
    colorCandle2 == color.green 'GREEN' 'RED'
        
    previousColor colorCandle2[1] == color.green 'GREEN' 'RED'
        
    alert('Candle 2 (1hr) changed from ' previousColor ' to ' currentColoralert.freq_once_per_bar_close)

    if 
    colorChanged3
        currentColor 
    colorCandle3 == color.green 'GREEN' 'RED'
        
    previousColor colorCandle3[1] == color.green 'GREEN' 'RED'
        
    alert('Candle 3 (2hr) changed from ' previousColor ' to ' currentColoralert.freq_once_per_bar_close)

    if 
    colorChanged4
        currentColor 
    colorCandle4 == color.green 'GREEN' 'RED'
        
    previousColor colorCandle4[1] == color.green 'GREEN' 'RED'
        
    alert('Candle 4 (4hr) changed from ' previousColor ' to ' currentColoralert.freq_once_per_bar_close)

    if 
    colorChanged5
        currentColor 
    colorCandle5 == color.green 'GREEN' 'RED'
        
    previousColor colorCandle5[1] == color.green 'GREEN' 'RED'
        
    alert('Candle 5 (12hr) changed from ' previousColor ' to ' currentColoralert.freq_once_per_bar_close)

    if 
    allSameColor
        colorMsg 
    colorCandle1 == color.green 'All candles are GREEN - Strong Bullish Signal' 'All candles are RED - Strong Bearish Signal'
        
    alert(colorMsgalert.freq_once_per_bar_close)


    // For Candle 5 (Draw first - will be at bottom)
    if enableCandle5
        bodyLine5 
    := line.new(x5firstPrice5x5lastPrice5color colorCandle5width 24)
        
    highWick5 := line.new(x5periodHigh5x5periodLow5color colorCandle5width 2)
        if 
    showLookbackLine5
            lookbackLine5 
    := line.new(bar_index lookbackBars5periodLow5bar_index lookbackBars5periodHigh5color lookbackLineColor5width lookbackLineWidth5style lookbackLineStyle5 == 'solid' line.style_solid lookbackLineStyle5 == 'dotted' line.style_dotted line.style_dashed)
            
    lookbackLine5
        
    if showHighLow5
            highLine5 
    := line.new(bar_index lookbackBars5periodHigh5bar_indexperiodHigh5color highLowColor5width lookbackLineWidth5style highLowStyle5 == 'solid' line.style_solid highLowStyle5 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine5 := line.new(bar_index lookbackBars5periodLow5bar_indexperiodLow5color highLowColor5width lookbackLineWidth5style highLowStyle5 == 'solid' line.style_solid highLowStyle5 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine5
        
    //if showLabel5
            //lookbackLabel5 := label.new(x5, labelHeight, text = formatTimePeriod(lookbackMinutes5), color = labelColor5, textcolor = color.black, style = label.style_label_up, size = size.normal)
            //lookbackLabel5

    // For Candle 4
    if enableCandle4
        bodyLine4 
    := line.new(x4firstPrice4x4lastPrice4color colorCandle4width 24)
        
    highWick4 := line.new(x4periodHigh4x4periodLow4color colorCandle4width 2)
        if 
    showLookbackLine4
            lookbackLine4 
    := line.new(bar_index lookbackBars4periodLow4bar_index lookbackBars4periodHigh4color lookbackLineColor4width lookbackLineWidth4style lookbackLineStyle4 == 'solid' line.style_solid lookbackLineStyle4 == 'dotted' line.style_dotted line.style_dashed)
            
    lookbackLine4
        
    if showHighLow4
            highLine4 
    := line.new(bar_index lookbackBars4periodHigh4bar_indexperiodHigh4color highLowColor4width lookbackLineWidth4style highLowStyle4 == 'solid' line.style_solid highLowStyle4 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine4 := line.new(bar_index lookbackBars4periodLow4bar_indexperiodLow4color highLowColor4width lookbackLineWidth4style highLowStyle4 == 'solid' line.style_solid highLowStyle4 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine4
        
    //if showLabel4
            //lookbackLabel4 := label.new(x4, labelHeight, text = formatTimePeriod(lookbackMinutes4), color = labelColor4, textcolor = color.black, style = label.style_label_up, size = size.normal)
            //lookbackLabel4

    // For Candle 3
    if enableCandle3
        bodyLine3 
    := line.new(x3firstPrice3x3lastPrice3color colorCandle3width 24)
        
    highWick3 := line.new(x3periodHigh3x3periodLow3color colorCandle3width 2)
        if 
    showLookbackLine3
            lookbackLine3 
    := line.new(bar_index lookbackBars3periodLow3bar_index lookbackBars3periodHigh3color lookbackLineColor3width lookbackLineWidth3style lookbackLineStyle3 == 'solid' line.style_solid lookbackLineStyle3 == 'dotted' line.style_dotted line.style_dashed)
            
    lookbackLine3
        
    if showHighLow3
            highLine3 
    := line.new(bar_index lookbackBars3periodHigh3bar_indexperiodHigh3color highLowColor3width lookbackLineWidth3style highLowStyle3 == 'solid' line.style_solid highLowStyle3 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine3 := line.new(bar_index lookbackBars3periodLow3bar_indexperiodLow3color highLowColor3width lookbackLineWidth3style highLowStyle3 == 'solid' line.style_solid highLowStyle3 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine3
        
    //if showLabel3
            //lookbackLabel3 := label.new(x3, labelHeight, text = formatTimePeriod(lookbackMinutes3), color = labelColor3, textcolor = color.black, style = label.style_label_up, size = size.normal)
            //lookbackLabel3

    // For Candle 2
    if enableCandle2
        bodyLine2 
    := line.new(x2firstPrice2x2lastPrice2color colorCandle2width 24)
        
    highWick2 := line.new(x2periodHigh2x2periodLow2color colorCandle2width 2)
        if 
    showLookbackLine2
            lookbackLine2 
    := line.new(bar_index lookbackBars2periodLow2bar_index lookbackBars2periodHigh2color lookbackLineColor2width lookbackLineWidth2style lookbackLineStyle2 == 'solid' line.style_solid lookbackLineStyle2 == 'dotted' line.style_dotted line.style_dashed)
            
    lookbackLine2
        
    if showHighLow2
            highLine2 
    := line.new(bar_index lookbackBars2periodHigh2bar_indexperiodHigh2color highLowColor2width lookbackLineWidth2style highLowStyle2 == 'solid' line.style_solid highLowStyle2 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine2 := line.new(bar_index lookbackBars2periodLow2bar_indexperiodLow2color highLowColor2width lookbackLineWidth2style highLowStyle2 == 'solid' line.style_solid highLowStyle2 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine2
        
    //if showLabel2
            //lookbackLabel2 := label.new(x2, labelHeight, text = formatTimePeriod(lookbackMinutes2), color = labelColor2, textcolor = color.black, style = label.style_label_up, size = size.normal)
            //lookbackLabel2

    // For Candle 1 (Draw last - will be on top)
    if enableCandle1
        bodyLine1 
    := line.new(x1firstPrice1x1lastPrice1color colorCandle1width 24)
        
    highWick1 := line.new(x1periodHigh1x1periodLow1color colorCandle1width 2)
        if 
    showLookbackLine1
            lookbackLine1 
    := line.new(bar_index lookbackBars1periodLow1bar_index lookbackBars1periodHigh1color lookbackLineColor1width lookbackLineWidth1style lookbackLineStyle1 == 'solid' line.style_solid lookbackLineStyle1 == 'dotted' line.style_dotted line.style_dashed)
            
    lookbackLine1
        
    if showHighLow1
            highLine1 
    := line.new(bar_index lookbackBars1periodHigh1bar_indexperiodHigh1color highLowColor1width lookbackLineWidth1style highLowStyle1 == 'solid' line.style_solid highLowStyle1 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine1 := line.new(bar_index lookbackBars1periodLow1bar_indexperiodLow1color highLowColor1width lookbackLineWidth1style highLowStyle1 == 'solid' line.style_solid highLowStyle1 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine1
        
    //if showLabel1
            //lookbackLabel1 := label.new(x1, labelHeight, text = formatTimePeriod(lookbackMinutes1), color = labelColor1, textcolor = color.black, style = label.style_label_up, size = size.normal)
            //lookbackLabel1 
    https://www.tradingview.com/x/IJoGKeqn/ https://www.tradingview.com/x/gENwIxKK/

    saçmaladığımının farkındayım. benim goygoy böyle....
    has topiktekiler beni bu hale getirdi... luppo...lololo.... derrken
    nerden bileyim... luppo yiyince... lololo....yapacağımı....

    selamlar....
    Son düzenleme : @yörük@; Bugün saat: 22:19.
    16.07.2024 - 10.12.2024

  6.  Alıntı Originally Posted by KısaVade Yazıyı Oku
    Bu arada özellikle Tranigview ücretsiz plan kullanıp,
    aynı ekranda farklı zaman dilimi ve/veya gösterge kullanmak isteyenler için,
    Google Chrome'un duyurduğu yeni özellik ilaç gibi...

    Açık sekmelerden birinin tepesine sağ tuşla tıklayıp,
    "Sekmeyi yeni bölünmüş görünüme ekle" seçeneğini tıklarsanız:





    Sonra da eklemek istediğiniz 2. sekmeyi sağdan seçerseniz...:





    Windows'un ekran bölme vb. fonksiyonundan iyi. Çünkü tek bir sekme olarak hareket ediyor.
    Teknik Analiz sanatı ikiye ayrılır;

    MTF'den önce...

    MTF'den sonra...

    Teşekkür ederim üstadım...
    “Başarısızlık yeniden ve daha zekice başlayabilme fırsatından başka bir şey değildir.” Henry Ford

  7.  Alıntı Originally Posted by @yörük@ Yazıyı Oku
    bir birleştirme örneği....

    not canlı veride çalışır.

    önce maç süresini 90 dakka üzerinden başlattık. Range alanını, süreyle böldük. 15-30-45-60-90 diye...
    15-30 mavi, 45 ilk yarı olacağı için beyaz....60-90 turuncu olsun.... tabi maçın sonucunu da....
    canlı takip için sonuna bu sürelerin barlarını üst üste bindirdik.

    bakınız..... https://www.tradingview.com/x/UXARQGp1/


    hakem olarak... renko barla hesaplanan trend koyduk.... https://www.tradingview.com/x/AqYwilMH/

    hakeme... kartlarını bar renkleme olarak verdik.... her 5 barı... yüksek düşük hesapla.... koştukları anı konsildasyon yap dedik.

    beyaz long, sarı konsolide, kırmızı çık dışarı gibi olurken....
    takımların kontra ataklarını... fuşya ve mavi olarak işaretledik ki... o barlarda "var" gitmek gerek.
    https://www.tradingview.com/x/Lhpr513V/

    ortaya çıkan sonuç...
    https://www.tradingview.com/x/TYAccweT/
    https://www.tradingview.com/x/hsffQXvo/
    https://www.tradingview.com/x/V5RGySWe/
    https://www.tradingview.com/x/0u7FzTXu/
    https://www.tradingview.com/x/oeVuss4I/

    denemek, değiştirmek, yeniden revize etmek isteyene birleşmiş kod örneği....
    PHP Code:
    //@version=6
    indicator('..'overlay false,  max_lines_count 500max_boxes_count 500)

    enum RenkoStyle
        atr 
    "ATR"
        
    percent "Percent"
        
    static = "Static Value"


    ////////////
    enum Direction
        up 
    "Up"
        
    down "Down"
        
    nan "No Trend"


    ///////
    type Renko
        float current
        float hold
        float high_level
        float low_level
        Direction direction
        color colour


    // //////////
    atr_rma(float sourcefloat length)=>
        
    float alpha math.min(lengthbar_index 1)
        
    float i_alpha alpha
        float rma 
    source
        rma 
    := source alpha nz(rma[1], rma) * i_alpha
        rma


    //////////////
    tr()=>
        
    math.max(high low
                 
    math.abs(high nz(close[1], math.max(openclose)))
                 , 
    math.abs(low nz(close[1], math.min(openclose)))
                 )


    /////////////
    atr(float period)=>
        
    atr_rma(tr(), period)


    // ////////////
    init_renko()=>
        var 
    Renko renko Renko.new(openopenopenopenDirection.nanna)
        
    renko


    /////////////////
    method get_color(Renko selfcolor bullishcolor bearish)=>
        var 
    color colour chart.fg_color
        float value 
    self.current
        float delta 
    value nz(value[1], value)

        
    colour := switch self.direction
            Direction
    .up => color.from_gradient(closeself.low_levelself.currentchart.fg_colorbullish)
            
    Direction.down => color.from_gradient(closeself.currentself.high_levelbearishchart.fg_color)
            => 
    color.from_gradient(closeself.low_levelself.high_levelbearishbullish)

        
    colour


    ///////////
    method atr(Renko selffloat close_sourcefloat periodfloat multiplierbool hold_until_new)=>
        
    float atr atr(period) * multiplier

        
    var float renko_atr atr

        
    if not hold_until_new
            renko_atr 
    := atr

        int new_bars 
    math.floor(math.abs(self.hold close_source) / renko_atr)
        
    int direction close_source self.hold : -1

        
    if new_bars 0
            self
    .direction := direction == Direction.up Direction.down

            
    while new_bars 0
                float new_open 
    self.hold renko_atr direction
                self
    .hold := new_open
                new_bars 
    := math.floor(math.abs(new_open close_source) / renko_atr)

            if 
    hold_until_new
                renko_atr 
    := atr

        self
    .current := self.hold
        self
    .high_level := self.hold renko_atr
        self
    .low_level := self.hold renko_atr

        self


    ////////////
    method percent(Renko selffloat close_sourcefloat percent_changebool hold_until_new)=>
        
    float percent percent_change 0.01

        float up_level 
    self.hold * (percent)
        
    float down_level self.hold * (percent)

        
    self.high_level := up_level
        self
    .low_level := down_level

        float up_range 
    math.abs(self.hold up_level)
        
    float down_range math.abs(self.hold down_level)

        
    bool new_up close_source >= up_level
        bool new_down 
    close_source <= down_level

        
    if new_up
            self
    .direction := Direction.up

            int new_bars 
    math.floor(math.abs(close_source self.hold) / up_range)

            while 
    new_bars 0
                up_range 
    := hold_until_new up_range math.abs(self.hold self.hold * (percent))
                
    float new = self.hold up_range
                self
    .hold := new
                
    new_bars := math.floor(math.abs(close_source self.hold) / up_range)

        else if 
    new_down
            self
    .direction := Direction.down

            int new_bars 
    math.floor(math.abs(close_source self.hold) / down_range)

            while 
    new_bars 0
                down_range 
    := hold_until_new down_range math.abs(self.hold self.hold * (percent))
                
    float new = self.hold down_range
                self
    .hold := new
                
    new_bars := math.floor(math.abs(close_source self.hold) / down_range)

        
    self.high_level := self.hold * (percent)
        
    self.low_level := self.hold * (percent)
        
    self.current := self.hold
        self


    //////////////
    method static(Renko selffloat close_sourcefloat static_change)=>
        
    float static_distance math.round_to_mintick(static_change)

        
    int new_bars math.floor(math.abs(self.current close_source) / static_distance)
        
    int direction close_source self.current : -1

        
    while new_bars 0
            self
    .direction := direction == Direction.up Direction.down

            float 
    new = self.hold static_distance direction
            self
    .hold := new
            
    new_bars := math.floor(math.abs(self.hold close_source) / static_distance)

        
    self.current := self.hold
        self
    .high_level := self.hold static_distance
        self
    .low_level := self.hold static_distance

        self


    /////////////////
    renko(float close_sourcefloat atr_periodfloat atr_multiplierfloat percent_changefloat static_changebool hold_atr_until_newbool hold_percent_until_newfloat smoothingcolor bullish_colorcolor bearish_colorsimple RenkoStyle style)=>
        var 
    Renko renko init_renko()

        switch 
    style
            RenkoStyle
    .atr => renko.atr(close_sourceatr_periodatr_multiplierhold_atr_until_new)
            
    RenkoStyle.percent => renko.percent(close_sourcepercent_changehold_percent_until_new)
            
    RenkoStyle.static => renko.static(close_sourcestatic_change)
            => 
    renko

        renko
    .current := atr_rma(renko.currentsmoothing)
        
    renko.high_level := atr_rma(renko.high_levelsmoothing)
        
    renko.low_level := atr_rma(renko.low_levelsmoothing)
        
    renko.colour := renko.get_color(bullish_colorbearish_color)

        
    renko


    // renko }


    var const string global_group "Global Settings"
    var const string trend_color_inline "trend_color_inline"

    var const string close_source_tt "The closing source for the renko calculations."

    var const string renko_style_tt "Renko brick size calculation method.\n\n"
     
    "• ATR - Dynamic brick size based on Average True Range.\n"
     
    "• Percent - Fixed percentage of current price for brick size.\n"
     
    "• Static Value - Fixed absolute price distance for bricks."

    var const string smoothing_tt "RMA smoothing period for Renko levels.\n"
     
    "Larger values create smoother, more stable bands.\n"
     
    "Minimum value of 1 disables smoothing."

    var const string static_color_tt "Fixed color for Renko line when trend coloring is disabled.\n"
     
    "Used when 'Use Trend Color' is turned off."

    var const string trend_color_tt "Gradient colors for trend-based coloring.\n"
     
    "Renko line and candles interpolate between these colors based on price position.\n\n"
     
    "• Left color - Bullish/uptrend color.\n"
     
    "• Right color - Bearish/downtrend color."

    var const string show_renko_line_tt "Toggle display of the main Renko centerline.\n"
     
    "The line tracks the current smoothed Renko brick price."

    var const string use_polar_color_tt "Enable dynamic gradient coloring based on trend.\n\n"
     
    "• Enabled - Uses gradient between bullish and bearish colors.\n"
     
    "• Disabled - Uses static color for Renko line."

    var const string enable_candle_color_tt "Apply trend-based gradient coloring to chart candles.\n"
     
    "Colors candles based on position relative to Renko levels."

    float close_source input.source(close"Close Source"tooltip close_source_ttgroup global_group)
    var 
    RenkoStyle renko_style input.enum(RenkoStyle.atr"Style"tooltip renko_style_ttgroup global_group)
    float smoothing input.float(1.25"Smoothing"minval 1step 0.125tooltip smoothing_ttgroup global_group)
    color static_color input.color(color.blue"Static Color"tooltip static_color_ttgroup global_group)
    color bullish_color input.color(#00FF00, "Trend Color", inline = trend_color_inline, group = global_group)
    color bearish_color input.color(#FF0000, "", inline = trend_color_inline, tooltip = trend_color_tt, group = global_group)
    bool show_renko_line input.bool(true"Show Renko Line"tooltip show_renko_line_ttgroup global_group)
    bool use_polar_color input.bool(true"Use Trend Color"tooltip use_polar_color_ttgroup global_group)
    bool enable_candle_color input.bool(false"Candle Color"tooltip enable_candle_color_ttgroup global_group)


    var const 
    string atr_group "ATR Settings"
    bool atr_active renko_style == RenkoStyle.atr

    var const string atr_period_tt "Period for ATR calculation.\n"
     
    "Longer periods create smoother, less sensitive brick sizing.\n\n"
     
    "Only active when Style is set to ATR."

    var const string atr_multiplier_tt "Multiplier applied to ATR value for brick size.\n"
     
    "Larger multipliers create wider bricks and less frequent updates.\n\n"
     
    "Only active when Style is set to ATR."

    var const string hold_atr_until_new_tt "Control when ATR brick size recalculates.\n\n"
     
    "• Enabled - Lock ATR value until a new brick forms (more stable).\n"
     
    "• Disabled - Recalculate ATR every bar (more responsive).\n\n"
     
    "Only active when Style is set to ATR."

    float atr_period input.float(14"ATR Period"minval 1tooltip atr_period_ttactive atr_activegroup atr_group)
    float atr_multiplier input.float(2"ATR Multiplier"minval 0step 0.125tooltip atr_multiplier_ttactive atr_activegroup atr_group)
    bool hold_atr_until_new input.bool(true"Hold ATR Until New Renko"tooltip hold_atr_until_new_ttactive atr_activegroup atr_group)


    var const 
    string percent_group "Percent Settings"
    bool percent_active renko_style == RenkoStyle.percent

    var const string percent_change_tt "Percentage change required for new brick formation.\n"
     
    "For example, 0.5 means a 0.5% move from the last brick creates a new brick.\n\n"
     
    "Only active when Style is set to Percent."

    var const string hold_percent_until_new_tt "Control when percentage base recalculates.\n\n"
     
    "• Enabled - Lock percentage calculation to original brick price (compounding).\n"
     
    "• Disabled - Recalculate percentage from each new brick (non-compounding).\n\n"
     
    "Only active when Style is set to Percent."

    float percent_change input.float(0.5"Percent Change"minval 0.001step 0.001tooltip percent_change_ttactive percent_activegroup percent_group)
    bool hold_percent_until_new input.bool(false"Hold Percent Until New Renko"tooltip hold_percent_until_new_ttactive percent_activegroup percent_group)


    var const 
    string static_group "Static Settings"
    bool static_active renko_style == RenkoStyle.static

    var const 
    string static_change_tt "Fixed price distance for brick formation.\n"
     
    "New bricks form when price moves this absolute amount from the last brick.\n"
     
    "Value is automatically rounded to the instrument's minimum tick size.\n\n"
     
    "Only active when Style is set to Static Value."

    float static_change input.float(25"Static Change"minval 1step 0.01tooltip static_change_ttactive static_activegroup static_group)


    // inputs }


    // calc {


    Renko renko renko(close_sourceatr_periodatr_multiplierpercent_changestatic_changehold_atr_until_newhold_percent_until_newsmoothingbullish_colorbearish_colorrenko_style)
    float renko_line show_renko_line renko.current na
    color renko_color 
    use_polar_color renko.colour static_color
    color candle_color 
    enable_candle_color renko.colour na


    // calc }


    // plot {


    plot(renko_line"Renko"renko_color2)
    //plot(renko.high_level, "Renko Max", bullish_color)
    //plot(renko.low_level, "Renko Min", bearish_color)
    //barcolor(candle_color)


    // plot }

    type input.string(defval 'High-Low'title 'Candlestick style'options = ['High-Low''Open-Close''Just Color'])
    rcol input(true'Color bars for pivots?')
    range_1 input.int(5minval 1title 'High/Low Range')
    ccol input(true'Color bars for consolidation?')
    cons input.int(2minval 1title 'Consolidation Range')

    opener = (close[1] + open[1]) / 2
    closer 
    = (open high low close) / 4
    haO1 
    = (opener[1] + closer[1]) / 2
    haC1 
    = (opener high low closer) / 4
    haO 
    = (haO1[1] + haC1[1]) / 2
    haC 
    = (haO high low haC1) / 4
    haH 
    high
    haL 
    low

    btm 
    ta.lowest(lowrange_1)
    top ta.highest(highrange_1)

    tbtm btm btm[1]

    ttop top top[1]

    sideways hl2 ta.highest(cons)[1] and hl2 ta.lowest(cons)[1]

    col tbtm and rcol color.red ttop and rcol color.white sideways and ccol color.yellow haO haC color.blue color.fuchsia

    //plot(ta.sma(close, 1), color = col, linewidth = 1, editable = false, trackprice = true, show_last = 1)

    hv = if type == 'High-Low'
        
    high
    else
        if 
    type == 'Open-Close'
            
    open
        
    else
            
    na

    lv 
    = if type == 'High-Low'
        
    low
    else
        if 
    type == 'Open-Close'
            
    close
        
    else
            
    na

    bcol 
    type == 'Just Color' col na

    //barcolor(bcol)
    plotcandle(hvhvlvlvcolor colwickcolor na)
    //////////////////

    // Global Settings
    chartTimeframe input.int(title 'Chart Timeframe (minutes)'defval 1minval 1maxval 60group 'Global Settings')
    labelPosition input.float(title 'Label Position'defval 0.4minval = -2.0maxval 2.0group 'Global Settings')

    // Candle 1 Settings (30min)
    enableCandle1 input.bool(title 'Enable Candle 1'defval truegroup 'Candle 1 Settings')
    lookbackMinutes1 input.int(title 'Candle 1 Time Period (minutes)'defval 15minval 1maxval 1440group 'Candle 1 Settings')
    offsetBars1 input.int(title 'Offset (bars) for Candle 1'defval 2minval 1maxval 500group 'Candle 1 Settings')
    showLookbackLine1 input.bool(title 'Show Lookback Line (Candle 1)'defval truegroup 'Candle 1 Settings')
    lookbackLineWidth1 input.int(title 'Lookback Line Width (Candle 1)'defval 1minval 1maxval 10group 'Candle 1 Settings')
    lookbackLineColor1 input.color(title 'Lookback Line Color (Candle 1)'defval color.rgb(0188212), group 'Candle 1 Settings')
    lookbackLineStyle1 input.string(title 'Lookback Line Style (Candle 1)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 1 Settings')
    showHighLow1 input.bool(title 'Show Lookback High & Low (Candle 1)'defval truegroup 'Candle 1 Settings')
    highLowColor1 input.color(title 'Lookback H/L Lines Color (Candle 1)'defval color.rgb(0188212), group 'Candle 1 Settings')
    highLowStyle1 input.string(title 'Lookback H/L Lines Style (Candle 1)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 1 Settings')
    //showLabel1 = input.bool(title = 'Show Label (Candle 1)', defval = true, group = 'Candle 1 Settings')
    //labelColor1 = input.color(title = 'Label Color (Candle 1)', defval = color.rgb(0, 188, 212), group = 'Candle 1 Settings')

    // Candle 2 Settings (1hr)
    enableCandle2 input.bool(title 'Enable Candle 2'defval truegroup 'Candle 2 Settings')
    lookbackMinutes2 input.int(title 'Candle 2 Time Period (minutes)'defval 30minval 1maxval 1440group 'Candle 2 Settings')
    offsetBars2 input.int(title 'Offset (bars) for Candle 2'defval 2minval 1maxval 500group 'Candle 2 Settings')
    showLookbackLine2 input.bool(title 'Show Lookback Line (Candle 2)'defval truegroup 'Candle 2 Settings')
    lookbackLineWidth2 input.int(title 'Lookback Line Width (Candle 2)'defval 1minval 1maxval 10group 'Candle 2 Settings')
    lookbackLineColor2 input.color(title 'Lookback Line Color (Candle 2)'defval color.rgb(0188212), group 'Candle 2 Settings')
    lookbackLineStyle2 input.string(title 'Lookback Line Style (Candle 2)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 2 Settings')
    showHighLow2 input.bool(title 'Show Lookback High & Low (Candle 2)'defval truegroup 'Candle 2 Settings')
    highLowColor2 input.color(title 'Lookback H/L Lines Color (Candle 2)'defval color.rgb(0188212), group 'Candle 2 Settings')
    highLowStyle2 input.string(title 'Lookback H/L Lines Style (Candle 2)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 2 Settings')
    //showLabel2 = input.bool(title = 'Show Label (Candle 2)', defval = true, group = 'Candle 2 Settings')
    //labelColor2 = input.color(title = 'Label Color (Candle 2)', defval = color.rgb(233, 30, 99), group = 'Candle 2 Settings')

    // Candle 3 Settings (2hr)
    enableCandle3 input.bool(title 'Enable Candle 3'defval truegroup 'Candle 3 Settings')
    lookbackMinutes3 input.int(title 'Candle 3 Time Period (minutes)'defval 45minval 1maxval 1440group 'Candle 3 Settings')
    offsetBars3 input.int(title 'Offset (bars) for Candle 3'defval 2minval 1maxval 500group 'Candle 3 Settings')
    showLookbackLine3 input.bool(title 'Show Lookback Line (Candle 3)'defval truegroup 'Candle 3 Settings')
    lookbackLineWidth3 input.int(title 'Lookback Line Width (Candle 3)'defval 2minval 1maxval 10group 'Candle 3 Settings')
    lookbackLineColor3 input.color(title 'Lookback Line Color (Candle 3)'defval color.rgb(240239244), group 'Candle 3 Settings')
    lookbackLineStyle3 input.string(title 'Lookback Line Style (Candle 3)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 3 Settings')
    showHighLow3 input.bool(title 'Show Lookback High & Low (Candle 3)'defval truegroup 'Candle 3 Settings')
    highLowColor3 input.color(title 'Lookback H/L Lines Color (Candle 3)'defval color.rgb(240239244), group 'Candle 3 Settings')
    highLowStyle3 input.string(title 'Lookback H/L Lines Style (Candle 3)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 3 Settings')
    //showLabel3 = input.bool(title = 'Show Label (Candle 3)', defval = true, group = 'Candle 3 Settings')
    //labelColor3 = input.color(title = 'Label Color (Candle 3)', defval = color.rgb(132, 100, 247), group = 'Candle 3 Settings')

    // Candle 4 Settings (4hr)
    enableCandle4 input.bool(title 'Enable Candle 4'defval truegroup 'Candle 4 Settings')
    lookbackMinutes4 input.int(title 'Candle 4 Time Period (minutes)'defval 60minval 1maxval 1440group 'Candle 4 Settings')
    offsetBars4 input.int(title 'Offset (bars) for Candle 4'defval 2minval 1maxval 500group 'Candle 4 Settings')
    showLookbackLine4 input.bool(title 'Show Lookback Line (Candle 4)'defval truegroup 'Candle 4 Settings')
    lookbackLineWidth4 input.int(title 'Lookback Line Width (Candle 4)'defval 1minval 1maxval 10group 'Candle 4 Settings')
    lookbackLineColor4 input.color(title 'Lookback Line Color (Candle 4)'defval color.rgb(2551520), group 'Candle 4 Settings')
    lookbackLineStyle4 input.string(title 'Lookback Line Style (Candle 4)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 4 Settings')
    showHighLow4 input.bool(title 'Show Lookback High & Low (Candle 4)'defval truegroup 'Candle 4 Settings')
    highLowColor4 input.color(title 'Lookback H/L Lines Color (Candle 4)'defval color.rgb(2551520), group 'Candle 4 Settings')
    highLowStyle4 input.string(title 'Lookback H/L Lines Style (Candle 4)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 4 Settings')
    //showLabel4 = input.bool(title = 'Show Label (Candle 4)', defval = true, group = 'Candle 4 Settings')
    //labelColor4 = input.color(title = 'Label Color (Candle 4)', defval = color.rgb(255, 152, 0), group = 'Candle 4 Settings')

    // Candle 5 Settings (12hr)
    enableCandle5 input.bool(title 'Enable Candle 5'defval truegroup 'Candle 5 Settings')
    lookbackMinutes5 input.int(title 'Candle 5 Time Period (minutes)'defval 90minval 1maxval 1440group 'Candle 5 Settings')
    offsetBars5 input.int(title 'Offset (bars) for Candle 5'defval 2minval 1maxval 500group 'Candle 5 Settings')
    showLookbackLine5 input.bool(title 'Show Lookback Line (Candle 5)'defval truegroup 'Candle 5 Settings')
    lookbackLineWidth5 input.int(title 'Lookback Line Width (Candle 5)'defval 1minval 1maxval 10group 'Candle 5 Settings')
    lookbackLineColor5 input.color(title 'Lookback Line Color (Candle 5)'defval color.rgb(2551520), group 'Candle 5 Settings')
    lookbackLineStyle5 input.string(title 'Lookback Line Style (Candle 5)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 5 Settings')
    showHighLow5 input.bool(title 'Show Lookback High & Low (Candle 5)'defval truegroup 'Candle 5 Settings')
    highLowColor5 input.color(title 'Lookback H/L Lines Color (Candle 5)'defval color.rgb(2551520), group 'Candle 5 Settings')
    highLowStyle5 input.string(title 'Lookback H/L Lines Style (Candle 5)'defval 'dotted'options = ['solid''dotted''dashed'], group 'Candle 5 Settings')
    //showLabel5 = input.bool(title = 'Show Label (Candle 5)', defval = true, group = 'Candle 5 Settings')
    //labelColor5 = input.color(title = 'Label Color (Candle 5)', defval = color.rgb(255, 87, 34), group = 'Candle 5 Settings')

    // Function to format time period for label
    formatTimePeriod(minutes) =>
        if 
    minutes >= 60
            hours 
    math.floor(minutes 60)
            
    str.tostring(hours) + ' hrs'
        
    else
            
    str.tostring(minutes) + ' mins'

    // Function to calculate the candle's elements
    f_getCandleData(_lookbackMinutes) =>
        
    periodsForLookback _lookbackMinutes chartTimeframe
        periodHigh 
    ta.highest(highint(periodsForLookback))
        
    periodLow ta.lowest(lowint(periodsForLookback))
        
    firstPrice close[int(periodsForLookback)]
        
    lastPrice close
        colorCandle 
    lastPrice firstPrice color.green color.red
        
    [periodHighperiodLowfirstPricelastPricecolorCandle]

    // Get data for each candle
    [periodHigh1periodLow1firstPrice1lastPrice1colorCandle1] = f_getCandleData(lookbackMinutes1)
    [
    periodHigh2periodLow2firstPrice2lastPrice2colorCandle2] = f_getCandleData(lookbackMinutes2)
    [
    periodHigh3periodLow3firstPrice3lastPrice3colorCandle3] = f_getCandleData(lookbackMinutes3)
    [
    periodHigh4periodLow4firstPrice4lastPrice4colorCandle4] = f_getCandleData(lookbackMinutes4)
    [
    periodHigh5periodLow5firstPrice5lastPrice5colorCandle5] = f_getCandleData(lookbackMinutes5)

    // Calculate the highest point among all lookback periods
    maxHigh math.max(periodHigh1math.max(periodHigh2math.max(periodHigh3math.max(periodHigh4periodHigh5))))
    minLow math.min(periodLow1math.min(periodLow2math.min(periodLow3math.min(periodLow4periodLow5))))
    labelHeight maxHigh + (maxHigh minLow) * labelPosition

    // Define variables with types and initialize with `na`
    var line bodyLine1 na
    var line highWick1 na
    var line lookbackLine1 na
    var line highLine1 na
    var line lowLine1 na
    var label lookbackLabel1 na

    var line bodyLine2 na
    var line highWick2 na
    var line lookbackLine2 na
    var line highLine2 na
    var line lowLine2 na
    var label lookbackLabel2 na

    var line bodyLine3 na
    var line highWick3 na
    var line lookbackLine3 na
    var line highLine3 na
    var line lowLine3 na
    var label lookbackLabel3 na

    var line bodyLine4 na
    var line highWick4 na
    var line lookbackLine4 na
    var line highLine4 na
    var line lowLine4 na
    var label lookbackLabel4 na

    var line bodyLine5 na
    var line highWick5 na
    var line lookbackLine5 na
    var line highLine5 na
    var line lowLine5 na
    var label lookbackLabel5 na

    // Delete previous lines and labels if they exist
    if not na(bodyLine1)
        
    line.delete(bodyLine1)
    if 
    not na(highWick1)
        
    line.delete(highWick1)
    if 
    not na(lookbackLine1)
        
    line.delete(lookbackLine1)
    if 
    not na(highLine1)
        
    line.delete(highLine1)
    if 
    not na(lowLine1)
        
    line.delete(lowLine1)
    if 
    not na(lookbackLabel1)
        
    label.delete(lookbackLabel1)

    if 
    not na(bodyLine2)
        
    line.delete(bodyLine2)
    if 
    not na(highWick2)
        
    line.delete(highWick2)
    if 
    not na(lookbackLine2)
        
    line.delete(lookbackLine2)
    if 
    not na(highLine2)
        
    line.delete(highLine2)
    if 
    not na(lowLine2)
        
    line.delete(lowLine2)
    if 
    not na(lookbackLabel2)
        
    label.delete(lookbackLabel2)

    if 
    not na(bodyLine3)
        
    line.delete(bodyLine3)
    if 
    not na(highWick3)
        
    line.delete(highWick3)
    if 
    not na(lookbackLine3)
        
    line.delete(lookbackLine3)
    if 
    not na(highLine3)
        
    line.delete(highLine3)
    if 
    not na(lowLine3)
        
    line.delete(lowLine3)
    if 
    not na(lookbackLabel3)
        
    label.delete(lookbackLabel3)

    if 
    not na(bodyLine4)
        
    line.delete(bodyLine4)
    if 
    not na(highWick4)
        
    line.delete(highWick4)
    if 
    not na(lookbackLine4)
        
    line.delete(lookbackLine4)
    if 
    not na(highLine4)
        
    line.delete(highLine4)
    if 
    not na(lowLine4)
        
    line.delete(lowLine4)
    if 
    not na(lookbackLabel4)
        
    label.delete(lookbackLabel4)

    if 
    not na(bodyLine5)
        
    line.delete(bodyLine5)
    if 
    not na(highWick5)
        
    line.delete(highWick5)
    if 
    not na(lookbackLine5)
        
    line.delete(lookbackLine5)
    if 
    not na(highLine5)
        
    line.delete(highLine5)
    if 
    not na(lowLine5)
        
    line.delete(lowLine5)
    if 
    not na(lookbackLabel5)
        
    label.delete(lookbackLabel5)

    // Calculate the starting bar index for the lookback period for each candle
    lookbackBars1 int(lookbackMinutes1 chartTimeframe)
    lookbackBars2 int(lookbackMinutes2 chartTimeframe)
    lookbackBars3 int(lookbackMinutes3 chartTimeframe)
    lookbackBars4 int(lookbackMinutes4 chartTimeframe)
    lookbackBars5 int(lookbackMinutes5 chartTimeframe)

    // Draw the candle for each period
    x1 bar_index offsetBars1
    x2 
    bar_index offsetBars2
    x3 
    bar_index offsetBars3
    x4 
    bar_index offsetBars4
    x5 
    bar_index offsetBars5

    // Calculate minute changes outside of conditional statements
    var bool minuteChanged false
    minuteChanged 
    := ta.change(time('1')) != 0

    // Calculate color changes for each candle
    var bool colorChanged1 false
    var bool colorChanged2 false
    var bool colorChanged3 false
    var bool colorChanged4 false
    var bool colorChanged5 false

    colorChanged1 
    := colorCandle1 != colorCandle1[1]
    colorChanged2 := colorCandle2 != colorCandle2[1]
    colorChanged3 := colorCandle3 != colorCandle3[1]
    colorChanged4 := colorCandle4 != colorCandle4[1]
    colorChanged5 := colorCandle5 != colorCandle5[1]

    // Calculate if all candles are the same color
    allSameColor colorCandle1 == colorCandle2 and colorCandle2 == colorCandle3 and colorCandle3 == colorCandle4 and colorCandle4 == colorCandle5

    // Alert conditions
    alertcondition(colorChanged1title 'Candle 1 Color Change'message 'Candle 1 (30min) color changed')
    alertcondition(colorChanged2title 'Candle 2 Color Change'message 'Candle 2 (1hr) color changed')
    alertcondition(colorChanged3title 'Candle 3 Color Change'message 'Candle 3 (2hr) color changed')
    alertcondition(colorChanged4title 'Candle 4 Color Change'message 'Candle 4 (4hr) color changed')
    alertcondition(colorChanged5title 'Candle 5 Color Change'message 'Candle 5 (12hr) color changed')
    alertcondition(allSameColortitle 'All Candles Same Color'message 'All candles are the same color')

    // Alert handling
    if colorChanged1
        currentColor 
    colorCandle1 == color.green 'GREEN' 'RED'
        
    previousColor colorCandle1[1] == color.green 'GREEN' 'RED'
        
    alert('Candle 1 (30min) changed from ' previousColor ' to ' currentColoralert.freq_once_per_bar_close)

    if 
    colorChanged2
        currentColor 
    colorCandle2 == color.green 'GREEN' 'RED'
        
    previousColor colorCandle2[1] == color.green 'GREEN' 'RED'
        
    alert('Candle 2 (1hr) changed from ' previousColor ' to ' currentColoralert.freq_once_per_bar_close)

    if 
    colorChanged3
        currentColor 
    colorCandle3 == color.green 'GREEN' 'RED'
        
    previousColor colorCandle3[1] == color.green 'GREEN' 'RED'
        
    alert('Candle 3 (2hr) changed from ' previousColor ' to ' currentColoralert.freq_once_per_bar_close)

    if 
    colorChanged4
        currentColor 
    colorCandle4 == color.green 'GREEN' 'RED'
        
    previousColor colorCandle4[1] == color.green 'GREEN' 'RED'
        
    alert('Candle 4 (4hr) changed from ' previousColor ' to ' currentColoralert.freq_once_per_bar_close)

    if 
    colorChanged5
        currentColor 
    colorCandle5 == color.green 'GREEN' 'RED'
        
    previousColor colorCandle5[1] == color.green 'GREEN' 'RED'
        
    alert('Candle 5 (12hr) changed from ' previousColor ' to ' currentColoralert.freq_once_per_bar_close)

    if 
    allSameColor
        colorMsg 
    colorCandle1 == color.green 'All candles are GREEN - Strong Bullish Signal' 'All candles are RED - Strong Bearish Signal'
        
    alert(colorMsgalert.freq_once_per_bar_close)


    // For Candle 5 (Draw first - will be at bottom)
    if enableCandle5
        bodyLine5 
    := line.new(x5firstPrice5x5lastPrice5color colorCandle5width 24)
        
    highWick5 := line.new(x5periodHigh5x5periodLow5color colorCandle5width 2)
        if 
    showLookbackLine5
            lookbackLine5 
    := line.new(bar_index lookbackBars5periodLow5bar_index lookbackBars5periodHigh5color lookbackLineColor5width lookbackLineWidth5style lookbackLineStyle5 == 'solid' line.style_solid lookbackLineStyle5 == 'dotted' line.style_dotted line.style_dashed)
            
    lookbackLine5
        
    if showHighLow5
            highLine5 
    := line.new(bar_index lookbackBars5periodHigh5bar_indexperiodHigh5color highLowColor5width lookbackLineWidth5style highLowStyle5 == 'solid' line.style_solid highLowStyle5 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine5 := line.new(bar_index lookbackBars5periodLow5bar_indexperiodLow5color highLowColor5width lookbackLineWidth5style highLowStyle5 == 'solid' line.style_solid highLowStyle5 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine5
        
    //if showLabel5
            //lookbackLabel5 := label.new(x5, labelHeight, text = formatTimePeriod(lookbackMinutes5), color = labelColor5, textcolor = color.black, style = label.style_label_up, size = size.normal)
            //lookbackLabel5

    // For Candle 4
    if enableCandle4
        bodyLine4 
    := line.new(x4firstPrice4x4lastPrice4color colorCandle4width 24)
        
    highWick4 := line.new(x4periodHigh4x4periodLow4color colorCandle4width 2)
        if 
    showLookbackLine4
            lookbackLine4 
    := line.new(bar_index lookbackBars4periodLow4bar_index lookbackBars4periodHigh4color lookbackLineColor4width lookbackLineWidth4style lookbackLineStyle4 == 'solid' line.style_solid lookbackLineStyle4 == 'dotted' line.style_dotted line.style_dashed)
            
    lookbackLine4
        
    if showHighLow4
            highLine4 
    := line.new(bar_index lookbackBars4periodHigh4bar_indexperiodHigh4color highLowColor4width lookbackLineWidth4style highLowStyle4 == 'solid' line.style_solid highLowStyle4 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine4 := line.new(bar_index lookbackBars4periodLow4bar_indexperiodLow4color highLowColor4width lookbackLineWidth4style highLowStyle4 == 'solid' line.style_solid highLowStyle4 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine4
        
    //if showLabel4
            //lookbackLabel4 := label.new(x4, labelHeight, text = formatTimePeriod(lookbackMinutes4), color = labelColor4, textcolor = color.black, style = label.style_label_up, size = size.normal)
            //lookbackLabel4

    // For Candle 3
    if enableCandle3
        bodyLine3 
    := line.new(x3firstPrice3x3lastPrice3color colorCandle3width 24)
        
    highWick3 := line.new(x3periodHigh3x3periodLow3color colorCandle3width 2)
        if 
    showLookbackLine3
            lookbackLine3 
    := line.new(bar_index lookbackBars3periodLow3bar_index lookbackBars3periodHigh3color lookbackLineColor3width lookbackLineWidth3style lookbackLineStyle3 == 'solid' line.style_solid lookbackLineStyle3 == 'dotted' line.style_dotted line.style_dashed)
            
    lookbackLine3
        
    if showHighLow3
            highLine3 
    := line.new(bar_index lookbackBars3periodHigh3bar_indexperiodHigh3color highLowColor3width lookbackLineWidth3style highLowStyle3 == 'solid' line.style_solid highLowStyle3 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine3 := line.new(bar_index lookbackBars3periodLow3bar_indexperiodLow3color highLowColor3width lookbackLineWidth3style highLowStyle3 == 'solid' line.style_solid highLowStyle3 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine3
        
    //if showLabel3
            //lookbackLabel3 := label.new(x3, labelHeight, text = formatTimePeriod(lookbackMinutes3), color = labelColor3, textcolor = color.black, style = label.style_label_up, size = size.normal)
            //lookbackLabel3

    // For Candle 2
    if enableCandle2
        bodyLine2 
    := line.new(x2firstPrice2x2lastPrice2color colorCandle2width 24)
        
    highWick2 := line.new(x2periodHigh2x2periodLow2color colorCandle2width 2)
        if 
    showLookbackLine2
            lookbackLine2 
    := line.new(bar_index lookbackBars2periodLow2bar_index lookbackBars2periodHigh2color lookbackLineColor2width lookbackLineWidth2style lookbackLineStyle2 == 'solid' line.style_solid lookbackLineStyle2 == 'dotted' line.style_dotted line.style_dashed)
            
    lookbackLine2
        
    if showHighLow2
            highLine2 
    := line.new(bar_index lookbackBars2periodHigh2bar_indexperiodHigh2color highLowColor2width lookbackLineWidth2style highLowStyle2 == 'solid' line.style_solid highLowStyle2 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine2 := line.new(bar_index lookbackBars2periodLow2bar_indexperiodLow2color highLowColor2width lookbackLineWidth2style highLowStyle2 == 'solid' line.style_solid highLowStyle2 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine2
        
    //if showLabel2
            //lookbackLabel2 := label.new(x2, labelHeight, text = formatTimePeriod(lookbackMinutes2), color = labelColor2, textcolor = color.black, style = label.style_label_up, size = size.normal)
            //lookbackLabel2

    // For Candle 1 (Draw last - will be on top)
    if enableCandle1
        bodyLine1 
    := line.new(x1firstPrice1x1lastPrice1color colorCandle1width 24)
        
    highWick1 := line.new(x1periodHigh1x1periodLow1color colorCandle1width 2)
        if 
    showLookbackLine1
            lookbackLine1 
    := line.new(bar_index lookbackBars1periodLow1bar_index lookbackBars1periodHigh1color lookbackLineColor1width lookbackLineWidth1style lookbackLineStyle1 == 'solid' line.style_solid lookbackLineStyle1 == 'dotted' line.style_dotted line.style_dashed)
            
    lookbackLine1
        
    if showHighLow1
            highLine1 
    := line.new(bar_index lookbackBars1periodHigh1bar_indexperiodHigh1color highLowColor1width lookbackLineWidth1style highLowStyle1 == 'solid' line.style_solid highLowStyle1 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine1 := line.new(bar_index lookbackBars1periodLow1bar_indexperiodLow1color highLowColor1width lookbackLineWidth1style highLowStyle1 == 'solid' line.style_solid highLowStyle1 == 'dotted' line.style_dotted line.style_dashed)
            
    lowLine1
        
    //if showLabel1
            //lookbackLabel1 := label.new(x1, labelHeight, text = formatTimePeriod(lookbackMinutes1), color = labelColor1, textcolor = color.black, style = label.style_label_up, size = size.normal)
            //lookbackLabel1 
    https://www.tradingview.com/x/IJoGKeqn/ https://www.tradingview.com/x/gENwIxKK/

    saçmaladığımının farkındayım. benim goygoy böyle....
    has topiktekiler beni bu hale getirdi... luppo...lololo.... derrken
    nerden bileyim... luppo yiyince... lololo....yapacağımı....

    selamlar....
    Eline sağlık üstadım

    Trend Reversal Predictor ile kombine bir deneyeyim ben bunu bu gece.
    Yarın geri bildirim veririm inşallah.

    Al,sat,tut,yakala,sık,bırak vb. tavsiye için aracı kurumunuzla görüşün.

  8.  Alıntı Originally Posted by BJK Coccinella Yazıyı Oku
    Teknik Analiz sanatı ikiye ayrılır;

    MTF'den önce...

    MTF'den sonra...

    Teşekkür ederim üstadım...
    Aynen öyle abi. MTF önemli.
    Al,sat,tut,yakala,sık,bırak vb. tavsiye için aracı kurumunuzla görüşün.

Sayfa 365/366 İlkİlk ... 265315355363364365366 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
  •