Sayfa 287/287 ÝlkÝlk ... 187237277285286287
Arama sonucu : 2292 madde; 2,289 - 2,292 arasý.

Konu: Tradingview

  1. PHP Code:
    //@version=6
    indicator(title 'Master Trend BUY&SELL'shorttitle '.'overlay truemax_labels_count=500)
    ////
    // === Inputs ===
    fairLen     input.int(50"Fair Value EMA Length")
    zLen        input.int(100"Z-Score Lookback Length")
    zThreshold  input.float(3.0"Z-Score Threshold")
    src         input.source(close"Source")
    rsiLen      input.int(14"RSI Length")
    rsiEmaLen   input.int(7"EMA of RSI Slope")

    colorMode input.string("None""Bar Coloring Mode"options=[
         
    "None",
         
    "Reversal Solid"
         
    "Reversal Fade"
         
    "Exceeding Bands",
         
    "Classic Heat"
     
    ])

    enableSignals input.bool(false,'Show Signals')

    // === Smooth RGB Gradient Function
    f_colorGradient(_ratio_colA_colB) =>
        
    rA color.r(_colA)
        
    gA color.g(_colA)
        
    bA color.b(_colA)
        
    rB color.r(_colB)
        
    gB color.g(_colB)
        
    bB color.b(_colB)
        
    rr rA int((rB rA) * _ratio)
        
    rg gA int((gB gA) * _ratio)
        
    rb bA int((bB bA) * _ratio)
        
    color.rgb(rrrgrb0)


    // === Color Scheme ===
    bullMain     color.new(#5CF0D7, 0)
    bearMain     color.new(#B32AC3, 0)
    labelTextCol color.white
    borderCol    
    color.white

    // === Fair Value (EMA Only) ===
    fair ta.ema(srcfairLen)

    // === Z-Score Deviation
    dev        src fair
    devMean    
    ta.sma(devzLen)
    devStdev   ta.stdev(devzLen)
    zScore     devStdev != ? (dev devMean) / devStdev 0

    // === Z-Bands
    upperBand fair zThreshold devStdev
    lowerBand 
    fair zThreshold devStdev

    // === Re-entry Logic
    wasAbove src[1] > upperBand[1]
    wasBelow src[1] < lowerBand[1]
    backInsideFromAbove wasAbove and src <= upperBand
    backInsideFromBelow 
    wasBelow and src >= lowerBand

    // === RSI EMA Slope Filter
    rsi       ta.rsi(closersiLen)
    rsiEma    ta.ema(rsirsiEmaLen)
    rsiSlope  rsiEma rsiEma[1]

    slopeUp   rsiSlope 0
    slopeDown 
    rsiSlope 0

    // === Signal Memory (One per slope)
    var bool buyFiredOnSlope  false
    var bool sellFiredOnSlope false

    // Reset logic when slope flips
    buyReset  ta.crossover(rsiSlope0)
    sellReset ta.crossunder(rsiSlope0)

    if 
    buyReset
        buyFiredOnSlope 
    := false
    if sellReset
        sellFiredOnSlope 
    := false

    // Final entry conditions
    finalBuy  backInsideFromBelow and slopeUp and not buyFiredOnSlope and enableSignals
    finalSell 
    backInsideFromAbove and slopeDown and not sellFiredOnSlope and enableSignals

    if finalBuy
        buyFiredOnSlope 
    := true
    if finalSell
        sellFiredOnSlope 
    := true

    // === Bar Coloring Modes

    // Reversal Memory (for "Reversal Solid" and "Reversal Fade")
    var string lastSignal ""
    if finalBuy
        lastSignal 
    := "bull"
    if finalSell
        lastSignal 
    := "bear"

    // Reversal Fade Tracker
    var int signalAge 0
    if finalBuy or finalSell
        signalAge 
    := 0
    else
        
    signalAge += 1

    // info
    var string lastTrend ""
    if close upperBand
        lastTrend 
    := "bull"
    else if close lowerBand
        lastTrend 
    := "bear"

    // === Bar Coloring Logic
    var color barCol na

    // 1. Reversal Solid
    if colorMode == "Reversal Solid"
        
    barCol := lastSignal == "bull" color.new(bullMain0) : lastSignal == "bear" color.new(bearMain0) : na

    if colorMode == "None"
        
    barCol := na

    // 2. Reversal Fade
    if colorMode == "Reversal Fade"
        
    fade math.min(90signalAge 1)
        
    barCol := lastSignal == "bull" color.new(bullMainfade) : lastSignal == "bear" color.new(bearMainfade) : na


    // 4. Exceeding Bands Only (only when outside bands)
    if colorMode == "Exceeding Bands"
        
    barCol := close upperBand color.new(bullMain0) : close lowerBand color.new(bearMain0) : na

    // 5. Classic Heat — correct: strongest color near bands, fade near fair
    // 5. Classic Heat — fixed: most intense near boundaries, fades toward fair
    // 6. Gradient Flow — RGB blend from bull to bear based on band distance
    if colorMode == "Classic Heat"
        
    bandRange     upperBand lowerBand
        ratioRaw      
    = (close lowerBand) / bandRange
        ratioClamped  
    math.max(0.0math.min(ratioRaw1.0))
        
    barCol := f_colorGradient(ratioClampedbullMainbearMain)



    barcolor(barCol)


    // === Table Position Setting
    enableTable input.bool(true,'Enable Table')
    tablePos input.string("Top Right""Table Position"options=["Top Left""Top Right""Bottom Left""Bottom Right"])
    pos tablePos == "Top Left" position.top_left :
          
    tablePos == "Top Right" position.top_right :
          
    tablePos == "Bottom Left" position.bottom_left :
          
    position.bottom_right

    // === Scoring Logic
    score_z       zScore < -zThreshold ? +zScore zThreshold ? -0
    score_slope   
    rsiSlope ? +rsiSlope ? -0
    score_price   
    close fair ? +close fair ? -0
    score_trend   
    lastTrend == "bull" ? +lastTrend == "bear" ? -0
    score_reentry 
    finalBuy ? +finalSell ? -0

    // === Score Aggregation
    totalScore score_z score_slope score_price score_trend score_reentry
    scoreCount 
    5
    avgScore   
    totalScore scoreCount

    finalSignal 
    avgScore 0.1 "AL" avgScore < -0.1 "SAT" "Nötr"
    finalColor  avgScore 0.1 bullMain avgScore < -0.1 bearMain color.gray



    // === Shared Style
    bgcolor color.new(#000000, 0)
    textCol color.white

    // === Table Drawing
    if bar_index == and enableTable
        
    var table scoreTable table.new(pos27,frame_width 1border_width=1frame_color=color.whiteborder_color=color.white)
        
    table.cell(scoreTable00"Ýnd",      bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable10"Puan",       bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable01"Z-Score",     bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable11str.tostring(score_z),       bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable02"RSI",   bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable12str.tostring(score_slope),   bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable03"Fiyat"bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable13str.tostring(score_price),  bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable04"Trend ",  bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable14str.tostring(score_trend),  bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable05"R Giriþ",      bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable15str.tostring(score_reentry),bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable06"Sonuç"bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable16finalSignal,    bgcolor=bgcolortext_color=finalColor)


        
    table.cell_set_text_font_family(scoreTable,0,0,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,0,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,1,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,1,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,2,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,2,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,3,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,3,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,4,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,4,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,5,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,5,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,6,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,6,font.family_monospace)
    /////////////////

    src88 input.source(close,"RSI Source",group "Connors RSI")
    lenrsi input(24"RSI Length",group "Connors RSI")
    lenupdown input(20"UpDown Length",group "Connors RSI")
    lenroc input(75"ROC Length",group "Connors RSI")

    z_score_length  input(14"Z-Score Lookback",group "Filtering")
    threshold       input.float(1.5"Z-Score Threshold"step=0.025,group "Filtering")
    trendingLongThreshold input.float(65"Trending Long Threshold" ,group "Filtering")
    trendingShortThreshold input.float(35"Trending Short Threshold",group "Filtering")
    revertingLongThreshold  input.float(70title="Reverting Long Threshold",group "Filtering")
    revertingShortThreshold input.float(30title="Reverting Short Threshold",group "Filtering")

    // ─── CONNORS RSI ──────────────────────────────────────────────────────────
    updown(s) =>
        
    isEqual == s[1]
        
    isGrowing s[1]
        
    ud 0.0
        ud 
    := isEqual isGrowing ? (nz(ud[1]) <= nz(ud[1])+1) : (nz(ud[1]) >= ? -nz(ud[1])-1)
        
    ud
    rsi88 
    ta.rsi(src88lenrsi)
    updownrsi ta.rsi(updown(src88), lenupdown)
    percentrank ta.percentrank(ta.roc(src881), lenroc)
    crsi =  math.avg(rsiupdownrsipercentrank


    // ─── Z-SCORING ──────────────────────────────────────────────────────────
    mean    ta.sma(crsiz_score_length)
    stdDev  ta.stdev(crsiz_score_length)
    zScore88  = (crsi mean) / stdDev

    isTrending 
    math.abs(zScore88) > threshold

    // ─── Signal Generation ────────────────────────────────────────────────
    var int signal 0
    if barstate.isconfirmed
        
    if isTrending
            signal 
    := crsi trendingLongThreshold crsi trendingShortThreshold ? -signal[1]
        else
            
    signal := crsi revertingLongThreshold crsi revertingShortThreshold ? -signal[1]


    trendColor signal == #17dfad : signal == -1  ? #dd326b : color.gray


    //decor = plot(crsi,"Decor",style = plot.style_columns,histbase = 50,color=trendColor,linewidth = 2)
    bgcolor(color.new(trendColor,75))
    //plotcandle(open,high,low,close,"Candles",color=trendColor,wickcolor = trendColor,bordercolor = trendColor,force_overlay = true)
    /////////////

    src77         close
    rsiLen77      
    input.int(1'RSI Length'group "T3")
    minLen      input.int(3'Min T3 Length'group "T3")
    maxLen      input.int(5'Max T3 Length'group "T3")
    v           input.float(0.34'T3 Volume Factor'step 0.01maxval 2minval 0.1group "T3")
    color_up    input.color(#21b8f3)
    color_dn    input.color(#fd761b)


    grp_vol_b   'Volatility Bands'
    show_bands  input.bool(true'Display'group grp_vol_binline "vol")
    vol_col     input.color(#21c9f380, "", group = grp_vol_b, inline = "vol")
    volat       input.int(100'Volatility'group grp_vol_b)

    // Step 1: Adaptive length via RSI
    rsi77 ta.rsi(src77rsiLen77)
    rsi_scale rsi77 100
    len 
    math.round(minLen + (maxLen minLen) * rsi_scale)

    pine_ema(srclength) =>
        
    alpha / (length 1)
        
    sum 0.0
        sum 
    := na(sum[1]) ? src alpha src + (alpha) * nz(sum[1])
        
    sum

    // Step 2: T3 with adaptive length
    e1 pine_ema(srclen)
    e2 pine_ema(e1len)
    e3 pine_ema(e2len)
    e4 pine_ema(e3len)
    e5 pine_ema(e4len)
    e6 pine_ema(e5len)

    c1 = -v
    c2 
    v
    c3 
    = -v
    c4 
    v
    t3 
    c1 e6 c2 e5 c3 e4 c4 e3

    t3_col 
    t3 t3[2] ? color_up color_dn

    stdv 
    ta.stdev(t3volat)

    pt31 plot(t3color t3_collinewidth 1editable false)
    pt32 plot(t3[2], color t3_collinewidth 1editable false)
    plotchar(ta.crossover(t3t3[2]) or ta.crossunder(t3t3[2]) ? t3 na"""🞛"location.absolutet3_col)
    ////////////
    //@ Julien_Eche

    //@version=6

    length input.int(20title="SMEMA Length")
    table_size input.string("normal"title="Table Size"options=["small""normal""large"])
    table_text_size table_size

    show_deviation_lines 
    input.bool(truetitle="Show Deviation Levels")
    show_tf_cells input.bool(truetitle="Show All Timeframes")

    approach input.string("Swing Trading"title="Overall Trend Weighting"options=["Long Term""Swing Trading""Short Term"])

    color_bull input.color(#ecf405, title="Bull Color", inline="col")
    color_bear input.color(color.rgb(529247), title="Bear Color"inline="col")
    color_neutral input.color(color.rgb(2052246), title="Neutral Color"inline="col")

    get_trend_arrow(score) => score >= 0.5 "➚" score <= -0.5 "➘" "➡"
    get_trend_strength(score) => str.tostring(math.round(math.abs(score))) + "/10"
    trend_col(score) => score 0.5 color_bull score < -0.5 color_bear color_neutral
    get_dynamic_color
    (scorealpha) => color.new(trend_col(score), alpha)

    get_band_color(levelsrcscoreis_uppercol_bullcol_bear) =>
        
    math.abs(src level) / ta.percentile_linear_interpolation(math.abs(src level), 400100)
        
    score and is_upper col_bull score and not is_upper col_bear na
        result 
    na(c) ? na <= 0.03 color.new(c96) : <= 0.06 color.new(c90) : <= 0.10 color.new(c80) : <= 0.15 color.new(c68) : <= 0.20 color.new(c55) : <= 0.27 color.new(c42) : <= 0.35 color.new(c30) : color.new(c18)
        
    result

    get_score_internal
    () =>
        
    sm ta.sma(ta.ema(closelength), length)
        
    sm_prev ta.sma(ta.ema(close[1], length), length)
        
    step ta.atr(100)
        
    slope sm sm_prev
        slope_ratio 
    slope sm
        slope_ratio 
    := slope_ratio 0.1 0.1 slope_ratio < -0.1 ? -0.1 slope_ratio
        slope_weight 
    1.0 slope_ratio 10.0
        bull 
    = (close sm step 0) + (close sm step 0) + (close sm step 0)
        
    bear = (close sm step 0) + (close sm step 0) + (close sm step 0)
        
    raw_score = (bull bear) * 10.0 3.0
        adjusted_score 
    raw_score slope_weight
        adjusted_score 
    := adjusted_score 10.0 10.0 adjusted_score < -10.0 ? -10.0 adjusted_score
        adjusted_score


    sm 
    ta.sma(ta.ema(closelength), length)
    sm_prev ta.sma(ta.ema(close[1], length), length)
    step ta.atr(100)

    sm_bull = (close sm step 0) + (close sm step 0) + (close sm step 0)
    sm_bear = (close sm step 0) + (close sm step 0) + (close sm step 0)
    sm_score = (sm_bull sm_bear) * 10.0 3.0
    slope 
    sm sm_prev
    slope_ratio 
    slope step
    slope_ratio 
    := slope_ratio 2.0 2.0 slope_ratio < -2.0 ? -2.0 slope_ratio
    slope_weight 
    1.0 slope_ratio 0.25
    adjusted_sm_score 
    sm_score slope_weight
    adjusted_sm_score 
    := adjusted_sm_score 10.0 10.0 adjusted_sm_score < -10.0 ? -10.0 adjusted_sm_score

    plot
    (show_deviation_lines sm step nacolor=get_band_color(sm step 3closeadjusted_sm_scoretruecolor_bullcolor_bear))
    plot(show_deviation_lines sm step nacolor=get_band_color(sm step 2closeadjusted_sm_scoretruecolor_bullcolor_bear))
    plot(show_deviation_lines sm step     nacolor=get_band_color(sm step    closeadjusted_sm_scoretruecolor_bullcolor_bear))
    plot(smcolor=get_dynamic_color(adjusted_sm_score0), title="SMEMA"linewidth=2)
    plot(show_deviation_lines sm step     nacolor=get_band_color(sm step    closeadjusted_sm_scorefalsecolor_bullcolor_bear))
    plot(show_deviation_lines sm step nacolor=get_band_color(sm step 2closeadjusted_sm_scorefalsecolor_bullcolor_bear))
    plot(show_deviation_lines sm step nacolor=get_band_color(sm step 3closeadjusted_sm_scorefalsecolor_bullcolor_bear))
    ///////////////// 
    https://www.tradingview.com/x/Fbs3GFVX/

    kombine yapýlmýþ kod...
    16.07.2024 - 10.12.2024

  2. kombin...istediðiniz gibi deðiþtirin...
    PHP Code:
    //@version=6
    indicator(title 'Master Trend BUY&SELL'shorttitle '.'overlay truemax_lines_count 500max_labels_count=500)
    ////
    // === Inputs ===
    fairLen     input.int(50"Fair Value EMA Length")
    zLen        input.int(100"Z-Score Lookback Length")
    zThreshold  input.float(3.0"Z-Score Threshold")
    src         input.source(close"Source")
    rsiLen      input.int(14"RSI Length")
    rsiEmaLen   input.int(7"EMA of RSI Slope")

    colorMode input.string("None""Bar Coloring Mode"options=[
         
    "None",
         
    "Reversal Solid"
         
    "Reversal Fade"
         
    "Exceeding Bands",
         
    "Classic Heat"
     
    ])

    enableSignals input.bool(false,'Show Signals')

    // === Smooth RGB Gradient Function
    f_colorGradient(_ratio_colA_colB) =>
        
    rA color.r(_colA)
        
    gA color.g(_colA)
        
    bA color.b(_colA)
        
    rB color.r(_colB)
        
    gB color.g(_colB)
        
    bB color.b(_colB)
        
    rr rA int((rB rA) * _ratio)
        
    rg gA int((gB gA) * _ratio)
        
    rb bA int((bB bA) * _ratio)
        
    color.rgb(rrrgrb0)


    // === Color Scheme ===
    bullMain     color.new(#5CF0D7, 0)
    bearMain     color.new(#B32AC3, 0)
    labelTextCol color.white
    borderCol    
    color.white

    // === Fair Value (EMA Only) ===
    fair ta.ema(srcfairLen)

    // === Z-Score Deviation
    dev        src fair
    devMean    
    ta.sma(devzLen)
    devStdev   ta.stdev(devzLen)
    zScore     devStdev != ? (dev devMean) / devStdev 0

    // === Z-Bands
    upperBand fair zThreshold devStdev
    lowerBand 
    fair zThreshold devStdev

    // === Re-entry Logic
    wasAbove src[1] > upperBand[1]
    wasBelow src[1] < lowerBand[1]
    backInsideFromAbove wasAbove and src <= upperBand
    backInsideFromBelow 
    wasBelow and src >= lowerBand

    // === RSI EMA Slope Filter
    rsi       ta.rsi(closersiLen)
    rsiEma    ta.ema(rsirsiEmaLen)
    rsiSlope  rsiEma rsiEma[1]

    slopeUp   rsiSlope 0
    slopeDown 
    rsiSlope 0

    // === Signal Memory (One per slope)
    var bool buyFiredOnSlope  false
    var bool sellFiredOnSlope false

    // Reset logic when slope flips
    buyReset  ta.crossover(rsiSlope0)
    sellReset ta.crossunder(rsiSlope0)

    if 
    buyReset
        buyFiredOnSlope 
    := false
    if sellReset
        sellFiredOnSlope 
    := false

    // Final entry conditions
    finalBuy  backInsideFromBelow and slopeUp and not buyFiredOnSlope and enableSignals
    finalSell 
    backInsideFromAbove and slopeDown and not sellFiredOnSlope and enableSignals

    if finalBuy
        buyFiredOnSlope 
    := true
    if finalSell
        sellFiredOnSlope 
    := true

    // === Bar Coloring Modes

    // Reversal Memory (for "Reversal Solid" and "Reversal Fade")
    var string lastSignal ""
    if finalBuy
        lastSignal 
    := "bull"
    if finalSell
        lastSignal 
    := "bear"

    // Reversal Fade Tracker
    var int signalAge 0
    if finalBuy or finalSell
        signalAge 
    := 0
    else
        
    signalAge += 1

    // info
    var string lastTrend ""
    if close upperBand
        lastTrend 
    := "bull"
    else if close lowerBand
        lastTrend 
    := "bear"

    // === Bar Coloring Logic
    var color barCol na

    // 1. Reversal Solid
    if colorMode == "Reversal Solid"
        
    barCol := lastSignal == "bull" color.new(bullMain0) : lastSignal == "bear" color.new(bearMain0) : na

    if colorMode == "None"
        
    barCol := na

    // 2. Reversal Fade
    if colorMode == "Reversal Fade"
        
    fade math.min(90signalAge 1)
        
    barCol := lastSignal == "bull" color.new(bullMainfade) : lastSignal == "bear" color.new(bearMainfade) : na


    // 4. Exceeding Bands Only (only when outside bands)
    if colorMode == "Exceeding Bands"
        
    barCol := close upperBand color.new(bullMain0) : close lowerBand color.new(bearMain0) : na

    // 5. Classic Heat — correct: strongest color near bands, fade near fair
    // 5. Classic Heat — fixed: most intense near boundaries, fades toward fair
    // 6. Gradient Flow — RGB blend from bull to bear based on band distance
    if colorMode == "Classic Heat"
        
    bandRange     upperBand lowerBand
        ratioRaw      
    = (close lowerBand) / bandRange
        ratioClamped  
    math.max(0.0math.min(ratioRaw1.0))
        
    barCol := f_colorGradient(ratioClampedbullMainbearMain)



    barcolor(barCol)


    // === Table Position Setting
    enableTable input.bool(true,'Enable Table')
    tablePos input.string("Top Right""Table Position"options=["Top Left""Top Right""Bottom Left""Bottom Right"])
    pos tablePos == "Top Left" position.top_left :
          
    tablePos == "Top Right" position.top_right :
          
    tablePos == "Bottom Left" position.bottom_left :
          
    position.bottom_right

    // === Scoring Logic
    score_z       zScore < -zThreshold ? +zScore zThreshold ? -0
    score_slope   
    rsiSlope ? +rsiSlope ? -0
    score_price   
    close fair ? +close fair ? -0
    score_trend   
    lastTrend == "bull" ? +lastTrend == "bear" ? -0
    score_reentry 
    finalBuy ? +finalSell ? -0

    // === Score Aggregation
    totalScore score_z score_slope score_price score_trend score_reentry
    scoreCount 
    5
    avgScore   
    totalScore scoreCount

    finalSignal 
    avgScore 0.1 "AL" avgScore < -0.1 "SAT" "Nötr"
    finalColor  avgScore 0.1 bullMain avgScore < -0.1 bearMain color.gray



    // === Shared Style
    bgcolor color.new(#000000, 0)
    textCol color.white

    // === Table Drawing
    if bar_index == and enableTable
        
    var table scoreTable table.new(pos27,frame_width 1border_width=1frame_color=color.whiteborder_color=color.white)
        
    table.cell(scoreTable00"Ýnd",      bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable10"Puan",       bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable01"Z-Score",     bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable11str.tostring(score_z),       bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable02"RSI",   bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable12str.tostring(score_slope),   bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable03"Fiyat"bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable13str.tostring(score_price),  bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable04"Trend ",  bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable14str.tostring(score_trend),  bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable05"R Giriþ",      bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable15str.tostring(score_reentry),bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable06"Sonuç"bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable16finalSignal,    bgcolor=bgcolortext_color=finalColor)


        
    table.cell_set_text_font_family(scoreTable,0,0,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,0,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,1,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,1,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,2,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,2,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,3,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,3,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,4,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,4,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,5,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,5,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,6,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,6,font.family_monospace)
    /////////////////

    src88 input.source(close,"RSI Source",group "Connors RSI")
    lenrsi input(24"RSI Length",group "Connors RSI")
    lenupdown input(20"UpDown Length",group "Connors RSI")
    lenroc input(75"ROC Length",group "Connors RSI")

    z_score_length  input(14"Z-Score Lookback",group "Filtering")
    threshold       input.float(1.5"Z-Score Threshold"step=0.025,group "Filtering")
    trendingLongThreshold input.float(65"Trending Long Threshold" ,group "Filtering")
    trendingShortThreshold input.float(35"Trending Short Threshold",group "Filtering")
    revertingLongThreshold  input.float(70title="Reverting Long Threshold",group "Filtering")
    revertingShortThreshold input.float(30title="Reverting Short Threshold",group "Filtering")

    // ─── CONNORS RSI ──────────────────────────────────────────────────────────
    updown(s) =>
        
    isEqual == s[1]
        
    isGrowing s[1]
        
    ud 0.0
        ud 
    := isEqual isGrowing ? (nz(ud[1]) <= nz(ud[1])+1) : (nz(ud[1]) >= ? -nz(ud[1])-1)
        
    ud
    rsi88 
    ta.rsi(src88lenrsi)
    updownrsi ta.rsi(updown(src88), lenupdown)
    percentrank ta.percentrank(ta.roc(src881), lenroc)
    crsi =  math.avg(rsiupdownrsipercentrank


    // ─── Z-SCORING ──────────────────────────────────────────────────────────
    mean    ta.sma(crsiz_score_length)
    stdDev  ta.stdev(crsiz_score_length)
    zScore88  = (crsi mean) / stdDev

    isTrending 
    math.abs(zScore88) > threshold

    // ─── Signal Generation ────────────────────────────────────────────────
    var int signal 0
    if barstate.isconfirmed
        
    if isTrending
            signal 
    := crsi trendingLongThreshold crsi trendingShortThreshold ? -signal[1]
        else
            
    signal := crsi revertingLongThreshold crsi revertingShortThreshold ? -signal[1]


    trendColor signal == #17dfad : signal == -1  ? #dd326b : color.gray


    //decor = plot(crsi,"Decor",style = plot.style_columns,histbase = 50,color=trendColor,linewidth = 2)
    bgcolor(color.new(trendColor,90))
    //plotcandle(open,high,low,close,"Candles",color=trendColor,wickcolor = trendColor,bordercolor = trendColor,force_overlay = true)
    /////////////

    src77         close
    rsiLen77      
    input.int(1'RSI Length'group "T3")
    minLen      input.int(3'Min T3 Length'group "T3")
    maxLen      input.int(5'Max T3 Length'group "T3")
    v           input.float(0.34'T3 Volume Factor'step 0.01maxval 2minval 0.1group "T3")
    color_up    input.color(#21b8f3)
    color_dn    input.color(#fd761b)


    grp_vol_b   'Volatility Bands'
    show_bands  input.bool(true'Display'group grp_vol_binline "vol")
    vol_col     input.color(#21c9f380, "", group = grp_vol_b, inline = "vol")
    volat       input.int(100'Volatility'group grp_vol_b)

    // Step 1: Adaptive length via RSI
    rsi77 ta.rsi(src77rsiLen77)
    rsi_scale rsi77 100
    len 
    math.round(minLen + (maxLen minLen) * rsi_scale)

    pine_ema(srclength) =>
        
    alpha / (length 1)
        
    sum 0.0
        sum 
    := na(sum[1]) ? src alpha src + (alpha) * nz(sum[1])
        
    sum

    // Step 2: T3 with adaptive length
    e1 pine_ema(srclen)
    e2 pine_ema(e1len)
    e3 pine_ema(e2len)
    e4 pine_ema(e3len)
    e5 pine_ema(e4len)
    e6 pine_ema(e5len)

    c1 = -v
    c2 
    v
    c3 
    = -v
    c4 
    v
    t3 
    c1 e6 c2 e5 c3 e4 c4 e3

    t3_col 
    t3 t3[2] ? color_up color_dn

    stdv 
    ta.stdev(t3volat)

    pt31 plot(t3color t3_collinewidth 1editable false)
    pt32 plot(t3[2], color t3_collinewidth 1editable false)
    plotchar(ta.crossover(t3t3[2]) or ta.crossunder(t3t3[2]) ? t3 na"""🞛"location.absolutet3_col)
    ////////////
    //@ Julien_Eche

    //@version=6

    length input.int(20title="SMEMA Length")
    table_size input.string("normal"title="Table Size"options=["small""normal""large"])
    table_text_size table_size

    show_deviation_lines 
    input.bool(truetitle="Show Deviation Levels")
    show_tf_cells input.bool(truetitle="Show All Timeframes")

    approach input.string("Swing Trading"title="Overall Trend Weighting"options=["Long Term""Swing Trading""Short Term"])

    color_bull input.color(#ecf405, title="Bull Color", inline="col")
    color_bear input.color(color.rgb(529247), title="Bear Color"inline="col")
    color_neutral input.color(color.rgb(2052246), title="Neutral Color"inline="col")

    get_trend_arrow(score) => score >= 0.5 "➚" score <= -0.5 "➘" "➡"
    get_trend_strength(score) => str.tostring(math.round(math.abs(score))) + "/10"
    trend_col(score) => score 0.5 color_bull score < -0.5 color_bear color_neutral
    get_dynamic_color
    (scorealpha) => color.new(trend_col(score), alpha)

    get_band_color(levelsrcscoreis_uppercol_bullcol_bear) =>
        
    math.abs(src level) / ta.percentile_linear_interpolation(math.abs(src level), 400100)
        
    score and is_upper col_bull score and not is_upper col_bear na
        result 
    na(c) ? na <= 0.03 color.new(c96) : <= 0.06 color.new(c90) : <= 0.10 color.new(c80) : <= 0.15 color.new(c68) : <= 0.20 color.new(c55) : <= 0.27 color.new(c42) : <= 0.35 color.new(c30) : color.new(c18)
        
    result

    get_score_internal
    () =>
        
    sm ta.sma(ta.ema(closelength), length)
        
    sm_prev ta.sma(ta.ema(close[1], length), length)
        
    step ta.atr(100)
        
    slope sm sm_prev
        slope_ratio 
    slope sm
        slope_ratio 
    := slope_ratio 0.1 0.1 slope_ratio < -0.1 ? -0.1 slope_ratio
        slope_weight 
    1.0 slope_ratio 10.0
        bull 
    = (close sm step 0) + (close sm step 0) + (close sm step 0)
        
    bear = (close sm step 0) + (close sm step 0) + (close sm step 0)
        
    raw_score = (bull bear) * 10.0 3.0
        adjusted_score 
    raw_score slope_weight
        adjusted_score 
    := adjusted_score 10.0 10.0 adjusted_score < -10.0 ? -10.0 adjusted_score
        adjusted_score


    sm 
    ta.sma(ta.ema(closelength), length)
    sm_prev ta.sma(ta.ema(close[1], length), length)
    step ta.atr(100)

    sm_bull = (close sm step 0) + (close sm step 0) + (close sm step 0)
    sm_bear = (close sm step 0) + (close sm step 0) + (close sm step 0)
    sm_score = (sm_bull sm_bear) * 10.0 3.0
    slope 
    sm sm_prev
    slope_ratio 
    slope step
    slope_ratio 
    := slope_ratio 2.0 2.0 slope_ratio < -2.0 ? -2.0 slope_ratio
    slope_weight 
    1.0 slope_ratio 0.25
    adjusted_sm_score 
    sm_score slope_weight
    adjusted_sm_score 
    := adjusted_sm_score 10.0 10.0 adjusted_sm_score < -10.0 ? -10.0 adjusted_sm_score

    //plot(show_deviation_lines ? sm + step * 3 : na, color=get_band_color(sm + step * 3, close, adjusted_sm_score, true, color_bull, color_bear))
    //plot(show_deviation_lines ? sm + step * 2 : na, color=get_band_color(sm + step * 2, close, adjusted_sm_score, true, color_bull, color_bear))
    plot(show_deviation_lines sm step     nacolor=get_band_color(sm step    closeadjusted_sm_scoretruecolor_bullcolor_bear))
    //plot(sm, color=get_dynamic_color(adjusted_sm_score, 0), title="SMEMA", linewidth=2)
    plot(show_deviation_lines sm step     nacolor=get_band_color(sm step    closeadjusted_sm_scorefalsecolor_bullcolor_bear))
    //plot(show_deviation_lines ? sm - step * 2 : na, color=get_band_color(sm - step * 2, close, adjusted_sm_score, false, color_bull, color_bear))
    //plot(show_deviation_lines ? sm - step * 3 : na, color=get_band_color(sm - step * 3, close, adjusted_sm_score, false, color_bull, color_bear))
    /////////////////
    // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // Â© Darkoexe
    //@version=6

    ATRwithTrendFactor input(4.5'ATR with trend factor')
    ATRagainstTrendFactor input(1.5'ATR against trend factor')
    ATRperiod input(14'ATR period')

    color ColorStartUpTrend input.color(color.green'Start Up Trend Color')
    color ColorStartDownTrend input.color(color.red'Start Down Trend Color')
    color ColorEndTrend input.color(color.purple'End Trend Color')
    color ColorBoth input.color(color.gray'Color when start and end trend are the same')


    var 
    bool endTrend false


    var float fullTrendChecker 0.0
    var float counterTrendChecker close close[1] > 0.0 0.1 : -0.1

    var bool UpTrend false
    var bool DownTrend false


    var StartTrendBarTime time
    var EndTrendBarTime time
    var float previous_EndTrendBarTime time

    var float EndTrendClose close

    var bool reversal false


    if bar_index 1
        fullTrendChecker 
    := fullTrendChecker close close[1]
        
    fullTrendChecker


    if UpTrend and reversal
        counterTrendChecker 
    := counterTrendChecker close close[1]
        
    counterTrendChecker

    else if UpTrend and close close[1] < 0.0 and counterTrendChecker == 0.1
        counterTrendChecker 
    := close close[1]
        
    EndTrendBarTime := time[1]
        
    reversal := true
        EndTrendClose 
    := close[1]

        
    endTrend := true
        endTrend

    if DownTrend and reversal
        counterTrendChecker 
    := counterTrendChecker close close[1]
        
    counterTrendChecker

    else if DownTrend and close close[1] > 0.0 and counterTrendChecker == -0.1
        counterTrendChecker 
    := close close[1]
        
    EndTrendBarTime := time[1]
        
    reversal := true
        EndTrendClose 
    := close[1]

        
    endTrend := true
        endTrend


    var float endTrendATR 0
    endTrendATR 
    := endTrend ta.atr(ATRperiod)[1] : endTrendATR
    endTrend 
    := false

    var float startTrendATR 0

    var upWick 0.0
    var downWick 0.0

    if bar_index 1
        
    if close close[1] > 0.0
            upWick 
    := high close
            upWick
        
    else
            
    upWick := high close
            upWick

        
    if close close[1] < 0.0
            downWick 
    := low close
            downWick
        
    else
            
    downWick := low close
            downWick

    findIndex
    (TIME) =>
        
    int i 0
        
    while true
            
    if time[i] == TIME
                findIndex 
    i
                
    break
            
    := 1
            i

    if counterTrendChecker upWick >= ATRagainstTrendFactor endTrendATR and DownTrend //Checks if the trend has ended
        
    fullTrendChecker := fullTrendChecker EndTrendClose close

        
    if fullTrendChecker <= -ATRwithTrendFactor startTrendATR //Checks if the trend was atleast the size of "ATRwithTrendFactor" multiplied by the ATR at the start of the trend
            
    if StartTrendBarTime == previous_EndTrendBarTime

                label
    .new(point chart.point.from_time(StartTrendBarTimeclose[findIndex(StartTrendBarTime)]), style label.style_label_downxloc xloc.bar_timesize size.smalltext 'Trend Kontrol'color ColorBoth)
                
    label.new(point chart.point.from_time(EndTrendBarTimeclose[findIndex(EndTrendBarTime)]), style label.style_label_upxloc xloc.bar_timesize size.smalltext 'Trend Devam'color ColorEndTrend)
                
    // line.new(x1=StartTrendBarTime, y1=1, x2=StartTrendBarTime, y2=2, extend=extend.both, color=ColorBoth, width=4, xloc=xloc.bar_time)
                // line.new(x1=EndTrendBarTime, y1=1, x2=EndTrendBarTime, y2=2, extend=extend.both, color=ColorEndTrend, width=2, xloc=xloc.bar_time)

            
    else
                
    label.new(point chart.point.from_time(StartTrendBarTimeclose[findIndex(StartTrendBarTime)]), style label.style_label_downxloc xloc.bar_timesize size.smalltext 'Düþüþ Baþladý'color ColorStartDownTrend)
                
    label.new(point chart.point.from_time(EndTrendBarTimeclose[findIndex(EndTrendBarTime)]), style label.style_label_upxloc xloc.bar_timesize size.smalltext 'Düþüþ Bitti'color ColorEndTrend)
            
    // line.new(x1=StartTrendBarTime, y1=1, x2=StartTrendBarTime, y2=2, extend=extend.both, color=lineColorStartTrend, width=2, xloc=xloc.bar_time)
            // line.new(x1=EndTrendBarTime, y1=1, x2=EndTrendBarTime, y2=2, extend=extend.both, color=ColorEndTrend, width=2, xloc=xloc.bar_time)
            
    previous_EndTrendBarTime := EndTrendBarTime
            previous_EndTrendBarTime

        
    //ATR := ta.atr(ATRperiod)
        
    if counterTrendChecker 0.0
            StartTrendBarTime 
    := time[1]
            
    startTrendATR := ta.atr(ATRperiod)[1]
            
    fullTrendChecker := close open
            counterTrendChecker 
    := -0.1
            reversal 
    := false
            reversal
        
    else
            
    StartTrendBarTime := EndTrendBarTime
            startTrendATR 
    := endTrendATR
            fullTrendChecker 
    := counterTrendChecker
            counterTrendChecker 
    := 0.1
            UpTrend 
    := true
            DownTrend 
    := false
            reversal 
    := false
            reversal


    else if counterTrendChecker downWick <= -(ATRagainstTrendFactor endTrendATR) and UpTrend //Checks if the trend has ended
        
    fullTrendChecker := fullTrendChecker EndTrendClose close

        
    if fullTrendChecker >= ATRwithTrendFactor startTrendATR //Checks if the trend was atleast the size of "ATRwithTrendFactor" multiplied by the ATR at the start of the trend
            
    if StartTrendBarTime == previous_EndTrendBarTime

                label
    .new(point chart.point.from_time(StartTrendBarTimeclose[findIndex(StartTrendBarTime)]), style label.style_label_upxloc xloc.bar_timesize size.smalltext 'Trend Kontrol'color ColorBoth)
                
    label.new(point chart.point.from_time(EndTrendBarTimeclose[findIndex(EndTrendBarTime)]), style label.style_label_downxloc xloc.bar_timesize size.smalltext 'Trend Devam'color ColorEndTrend)
                
    // line.new(x1=StartTrendBarTime, y1=1, x2=StartTrendBarTime, y2=2, extend=extend.both, color=ColorBoth, width=4, xloc=xloc.bar_time)
                // line.new(x1=EndTrendBarTime, y1=1, x2=EndTrendBarTime, y2=2, extend=extend.both, color=ColorEndTrend, width=2, xloc=xloc.bar_time)

            
    else
                
    label.new(point chart.point.from_time(StartTrendBarTimeclose[findIndex(StartTrendBarTime)]), style label.style_label_upxloc xloc.bar_timesize size.smalltext 'Yükseliþ Baþladý'color ColorStartUpTrend)
                
    label.new(point chart.point.from_time(EndTrendBarTimeclose[findIndex(EndTrendBarTime)]), style label.style_label_downxloc xloc.bar_timesize size.smalltext 'Yükseliþ Bitti'color ColorEndTrend)
            
    // line.new(x1=StartTrendBarTime, y1=1, x2=StartTrendBarTime, y2=2, extend=extend.both, color=lineColorStartTrend, width=2, xloc=xloc.bar_time)
            // line.new(x1=EndTrendBarTime, y1=1, x2=EndTrendBarTime, y2=2, extend=extend.both, color=ColorEndTrend, width=2, xloc=xloc.bar_time)
            
    previous_EndTrendBarTime := EndTrendBarTime
            previous_EndTrendBarTime

        
    //ATR := ta.atr(ATRperiod)
        
    if counterTrendChecker 0.0
            StartTrendBarTime 
    := time[1]
            
    startTrendATR := ta.atr(ATRperiod)[1]
            
    fullTrendChecker := close open
            counterTrendChecker 
    := 0.1
            reversal 
    := false
            reversal
        
    else
            
    StartTrendBarTime := EndTrendBarTime
            startTrendATR 
    := endTrendATR
            fullTrendChecker 
    := counterTrendChecker
            counterTrendChecker 
    := -0.1
            DownTrend 
    := true
            UpTrend 
    := false
            reversal 
    := false
            reversal


    if reversal and UpTrend and close close[1] > 0.0 and counterTrendChecker 0.0
        reversal 
    := false
        counterTrendChecker 
    := 0.1
        counterTrendChecker

    else if reversal and DownTrend and close close[1] < 0.0 and counterTrendChecker 0.0
        reversal 
    := false
        counterTrendChecker 
    := -0.1
        counterTrendChecker


    if fullTrendChecker 0.0
        UpTrend 
    := true
        DownTrend 
    := false
        DownTrend


    else if fullTrendChecker 0.0
        UpTrend 
    := false
        DownTrend 
    := true
        DownTrend
    ///////////////// 
    16.07.2024 - 10.12.2024



  3. bu grafikte ne görülür... burayý okuyanlar....

    bunun kombine edilmiþ kod olduðunu,
    arka zemine hesaplama yapýldýðýný,
    içindeki stratejilerin tablo ve label kullanýlarak görselleþtiðini,
    ve hesaplamalarýn teyit için deðerler deðiþtirildiðini görür.....

    PHP Code:
    //@version=6
    indicator(title 'Master Trend BUY&SELL'shorttitle '.'overlay truemax_lines_count 500max_labels_count=500)
    ////
    // === Inputs ===
    fairLen     input.int(50"Fair Value EMA Length")
    zLen        input.int(100"Z-Score Lookback Length")
    zThreshold  input.float(3.0"Z-Score Threshold")
    src         input.source(close"Source")
    rsiLen      input.int(14"RSI Length")
    rsiEmaLen   input.int(7"EMA of RSI Slope")

    colorMode input.string("None""Bar Coloring Mode"options=[
         
    "None",
         
    "Reversal Solid"
         
    "Reversal Fade"
         
    "Exceeding Bands",
         
    "Classic Heat"
     
    ])

    enableSignals input.bool(false,'Show Signals')

    // === Smooth RGB Gradient Function
    f_colorGradient(_ratio_colA_colB) =>
        
    rA color.r(_colA)
        
    gA color.g(_colA)
        
    bA color.b(_colA)
        
    rB color.r(_colB)
        
    gB color.g(_colB)
        
    bB color.b(_colB)
        
    rr rA int((rB rA) * _ratio)
        
    rg gA int((gB gA) * _ratio)
        
    rb bA int((bB bA) * _ratio)
        
    color.rgb(rrrgrb0)


    // === Color Scheme ===
    bullMain     color.new(#5CF0D7, 0)
    bearMain     color.new(#B32AC3, 0)
    labelTextCol color.white
    borderCol    
    color.white

    // === Fair Value (EMA Only) ===
    fair ta.ema(srcfairLen)

    // === Z-Score Deviation
    dev        src fair
    devMean    
    ta.sma(devzLen)
    devStdev   ta.stdev(devzLen)
    zScore     devStdev != ? (dev devMean) / devStdev 0

    // === Z-Bands
    upperBand fair zThreshold devStdev
    lowerBand 
    fair zThreshold devStdev

    // === Re-entry Logic
    wasAbove src[1] > upperBand[1]
    wasBelow src[1] < lowerBand[1]
    backInsideFromAbove wasAbove and src <= upperBand
    backInsideFromBelow 
    wasBelow and src >= lowerBand

    // === RSI EMA Slope Filter
    rsi       ta.rsi(closersiLen)
    rsiEma    ta.ema(rsirsiEmaLen)
    rsiSlope  rsiEma rsiEma[1]

    slopeUp   rsiSlope 0
    slopeDown 
    rsiSlope 0

    // === Signal Memory (One per slope)
    var bool buyFiredOnSlope  false
    var bool sellFiredOnSlope false

    // Reset logic when slope flips
    buyReset  ta.crossover(rsiSlope0)
    sellReset ta.crossunder(rsiSlope0)

    if 
    buyReset
        buyFiredOnSlope 
    := false
    if sellReset
        sellFiredOnSlope 
    := false

    // Final entry conditions
    finalBuy  backInsideFromBelow and slopeUp and not buyFiredOnSlope and enableSignals
    finalSell 
    backInsideFromAbove and slopeDown and not sellFiredOnSlope and enableSignals

    if finalBuy
        buyFiredOnSlope 
    := true
    if finalSell
        sellFiredOnSlope 
    := true

    // === Bar Coloring Modes

    // Reversal Memory (for "Reversal Solid" and "Reversal Fade")
    var string lastSignal ""
    if finalBuy
        lastSignal 
    := "bull"
    if finalSell
        lastSignal 
    := "bear"

    // Reversal Fade Tracker
    var int signalAge 0
    if finalBuy or finalSell
        signalAge 
    := 0
    else
        
    signalAge += 1

    // info
    var string lastTrend ""
    if close upperBand
        lastTrend 
    := "bull"
    else if close lowerBand
        lastTrend 
    := "bear"

    // === Bar Coloring Logic
    var color barCol na

    // 1. Reversal Solid
    if colorMode == "Reversal Solid"
        
    barCol := lastSignal == "bull" color.new(bullMain0) : lastSignal == "bear" color.new(bearMain0) : na

    if colorMode == "None"
        
    barCol := na

    // 2. Reversal Fade
    if colorMode == "Reversal Fade"
        
    fade math.min(90signalAge 1)
        
    barCol := lastSignal == "bull" color.new(bullMainfade) : lastSignal == "bear" color.new(bearMainfade) : na


    // 4. Exceeding Bands Only (only when outside bands)
    if colorMode == "Exceeding Bands"
        
    barCol := close upperBand color.new(bullMain0) : close lowerBand color.new(bearMain0) : na

    // 5. Classic Heat â€” correct: strongest color near bands, fade near fair
    // 5. Classic Heat â€” fixed: most intense near boundaries, fades toward fair
    // 6. Gradient Flow â€” RGB blend from bull to bear based on band distance
    if colorMode == "Classic Heat"
        
    bandRange     upperBand lowerBand
        ratioRaw      
    = (close lowerBand) / bandRange
        ratioClamped  
    math.max(0.0math.min(ratioRaw1.0))
        
    barCol := f_colorGradient(ratioClampedbullMainbearMain)



    barcolor(barCol)


    // === Table Position Setting
    enableTable input.bool(true,'Enable Table')
    tablePos input.string("Top Right""Table Position"options=["Top Left""Top Right""Bottom Left""Bottom Right"])
    pos tablePos == "Top Left" position.top_left :
          
    tablePos == "Top Right" position.top_right :
          
    tablePos == "Bottom Left" position.bottom_left :
          
    position.bottom_right

    // === Scoring Logic
    score_z       zScore < -zThreshold ? +zScore zThreshold ? -0
    score_slope   
    rsiSlope ? +rsiSlope ? -0
    score_price   
    close fair ? +close fair ? -0
    score_trend   
    lastTrend == "bull" ? +lastTrend == "bear" ? -0
    score_reentry 
    finalBuy ? +finalSell ? -0

    // === Score Aggregation
    totalScore score_z score_slope score_price score_trend score_reentry
    scoreCount 
    5
    avgScore   
    totalScore scoreCount

    finalSignal 
    avgScore 0.1 "AL" avgScore < -0.1 "SAT" "Nötr"
    finalColor  avgScore 0.1 bullMain avgScore < -0.1 bearMain color.gray



    // === Shared Style
    bgcolor color.new(#000000, 0)
    textCol color.white

    // === Table Drawing
    if bar_index == and enableTable
        
    var table scoreTable table.new(pos27,frame_width 1border_width=1frame_color=color.whiteborder_color=color.white)
        
    table.cell(scoreTable00"Ýnd",      bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable10"Puan",       bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable01"Z-Score",     bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable11str.tostring(score_z),       bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable02"RSI",   bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable12str.tostring(score_slope),   bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable03"Fiyat"bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable13str.tostring(score_price),  bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable04"Trend ",  bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable14str.tostring(score_trend),  bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable05"R Giriþ",      bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable15str.tostring(score_reentry),bgcolor=bgcolortext_color=textCol)

        
    table.cell(scoreTable06"Sonuç"bgcolor=bgcolortext_color=textCol)
        
    table.cell(scoreTable16finalSignal,    bgcolor=bgcolortext_color=finalColor)


        
    table.cell_set_text_font_family(scoreTable,0,0,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,0,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,1,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,1,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,2,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,2,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,3,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,3,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,4,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,4,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,5,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,5,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,0,6,font.family_monospace)
        
    table.cell_set_text_font_family(scoreTable,1,6,font.family_monospace)
    /////////////////

    src88 input.source(close,"RSI Source",group "Connors RSI")
    lenrsi input(24"RSI Length",group "Connors RSI")
    lenupdown input(20"UpDown Length",group "Connors RSI")
    lenroc input(75"ROC Length",group "Connors RSI")

    z_score_length  input(14"Z-Score Lookback",group "Filtering")
    threshold       input.float(1.5"Z-Score Threshold"step=0.025,group "Filtering")
    trendingLongThreshold input.float(65"Trending Long Threshold" ,group "Filtering")
    trendingShortThreshold input.float(35"Trending Short Threshold",group "Filtering")
    revertingLongThreshold  input.float(70title="Reverting Long Threshold",group "Filtering")
    revertingShortThreshold input.float(30title="Reverting Short Threshold",group "Filtering")

    // â”€â”€â”€ CONNORS RSI â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
    updown(s) =>
        
    isEqual == s[1]
        
    isGrowing s[1]
        
    ud 0.0
        ud 
    := isEqual isGrowing ? (nz(ud[1]) <= nz(ud[1])+1) : (nz(ud[1]) >= ? -nz(ud[1])-1)
        
    ud
    rsi88 
    ta.rsi(src88lenrsi)
    updownrsi ta.rsi(updown(src88), lenupdown)
    percentrank ta.percentrank(ta.roc(src881), lenroc)
    crsi =  math.avg(rsiupdownrsipercentrank


    // â”€â”€â”€ Z-SCORING â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
    mean    ta.sma(crsiz_score_length)
    stdDev  ta.stdev(crsiz_score_length)
    zScore88  = (crsi mean) / stdDev

    isTrending 
    math.abs(zScore88) > threshold

    // â”€â”€â”€ Signal Generation â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
    var int signal 0
    if barstate.isconfirmed
        
    if isTrending
            signal 
    := crsi trendingLongThreshold crsi trendingShortThreshold ? -signal[1]
        else
            
    signal := crsi revertingLongThreshold crsi revertingShortThreshold ? -signal[1]


    trendColor signal == #17dfad : signal == -1  ? #dd326b : color.gray


    //decor = plot(crsi,"Decor",style = plot.style_columns,histbase = 50,color=trendColor,linewidth = 2)
    bgcolor(color.new(trendColor,90))
    //plotcandle(open,high,low,close,"Candles",color=trendColor,wickcolor = trendColor,bordercolor = trendColor,force_overlay = true)
    /////////////

    src77         close
    rsiLen77      
    input.int(1'RSI Length'group "T3")
    minLen      input.int(3'Min T3 Length'group "T3")
    maxLen      input.int(5'Max T3 Length'group "T3")
    v           input.float(0.34'T3 Volume Factor'step 0.01maxval 2minval 0.1group "T3")
    color_up    input.color(#21b8f3)
    color_dn    input.color(#fd761b)


    grp_vol_b   'Volatility Bands'
    show_bands  input.bool(true'Display'group grp_vol_binline "vol")
    vol_col     input.color(#21c9f380, "", group = grp_vol_b, inline = "vol")
    volat       input.int(100'Volatility'group grp_vol_b)

    // Step 1: Adaptive length via RSI
    rsi77 ta.rsi(src77rsiLen77)
    rsi_scale rsi77 100
    len 
    math.round(minLen + (maxLen minLen) * rsi_scale)

    pine_ema(srclength) =>
        
    alpha / (length 1)
        
    sum 0.0
        sum 
    := na(sum[1]) ? src alpha src + (alpha) * nz(sum[1])
        
    sum

    // Step 2: T3 with adaptive length
    e1 pine_ema(srclen)
    e2 pine_ema(e1len)
    e3 pine_ema(e2len)
    e4 pine_ema(e3len)
    e5 pine_ema(e4len)
    e6 pine_ema(e5len)

    c1 = -v
    c2 
    v
    c3 
    = -v
    c4 
    v
    t3 
    c1 e6 c2 e5 c3 e4 c4 e3

    t3_col 
    t3 t3[2] ? color_up color_dn

    stdv 
    ta.stdev(t3volat)

    pt31 plot(t3color t3_collinewidth 1editable false)
    pt32 plot(t3[2], color t3_collinewidth 1editable false)
    plotchar(ta.crossover(t3t3[2]) or ta.crossunder(t3t3[2]) ? t3 na"""��"location.absolutet3_col)
    ////////////
    //@ Julien_Eche

    //@version=6

    length input.int(20title="SMEMA Length")
    table_size input.string("normal"title="Table Size"options=["small""normal""large"])
    table_text_size table_size

    show_deviation_lines 
    input.bool(truetitle="Show Deviation Levels")
    show_tf_cells input.bool(truetitle="Show All Timeframes")

    approach input.string("Swing Trading"title="Overall Trend Weighting"options=["Long Term""Swing Trading""Short Term"])

    color_bull input.color(#ecf405, title="Bull Color", inline="col")
    color_bear input.color(color.rgb(529247), title="Bear Color"inline="col")
    color_neutral input.color(color.rgb(2052246), title="Neutral Color"inline="col")

    get_trend_arrow(score) => score >= 0.5 "âžš" score <= -0.5 "➘" "âž¡"
    get_trend_strength(score) => str.tostring(math.round(math.abs(score))) + "/10"
    trend_col(score) => score 0.5 color_bull score < -0.5 color_bear color_neutral
    get_dynamic_color
    (scorealpha) => color.new(trend_col(score), alpha)

    get_band_color(levelsrcscoreis_uppercol_bullcol_bear) =>
        
    math.abs(src level) / ta.percentile_linear_interpolation(math.abs(src level), 400100)
        
    score and is_upper col_bull score and not is_upper col_bear na
        result 
    na(c) ? na <= 0.03 color.new(c96) : <= 0.06 color.new(c90) : <= 0.10 color.new(c80) : <= 0.15 color.new(c68) : <= 0.20 color.new(c55) : <= 0.27 color.new(c42) : <= 0.35 color.new(c30) : color.new(c18)
        
    result

    get_score_internal
    () =>
        
    sm ta.sma(ta.ema(closelength), length)
        
    sm_prev ta.sma(ta.ema(close[1], length), length)
        
    step ta.atr(100)
        
    slope sm sm_prev
        slope_ratio 
    slope sm
        slope_ratio 
    := slope_ratio 0.1 0.1 slope_ratio < -0.1 ? -0.1 slope_ratio
        slope_weight 
    1.0 slope_ratio 10.0
        bull 
    = (close sm step 0) + (close sm step 0) + (close sm step 0)
        
    bear = (close sm step 0) + (close sm step 0) + (close sm step 0)
        
    raw_score = (bull bear) * 10.0 3.0
        adjusted_score 
    raw_score slope_weight
        adjusted_score 
    := adjusted_score 10.0 10.0 adjusted_score < -10.0 ? -10.0 adjusted_score
        adjusted_score


    sm 
    ta.sma(ta.ema(closelength), length)
    sm_prev ta.sma(ta.ema(close[1], length), length)
    step ta.atr(100)

    sm_bull = (close sm step 0) + (close sm step 0) + (close sm step 0)
    sm_bear = (close sm step 0) + (close sm step 0) + (close sm step 0)
    sm_score = (sm_bull sm_bear) * 10.0 3.0
    slope 
    sm sm_prev
    slope_ratio 
    slope step
    slope_ratio 
    := slope_ratio 2.0 2.0 slope_ratio < -2.0 ? -2.0 slope_ratio
    slope_weight 
    1.0 slope_ratio 0.25
    adjusted_sm_score 
    sm_score slope_weight
    adjusted_sm_score 
    := adjusted_sm_score 10.0 10.0 adjusted_sm_score < -10.0 ? -10.0 adjusted_sm_score

    //plot(show_deviation_lines ? sm + step * 3 : na, color=get_band_color(sm + step * 3, close, adjusted_sm_score, true, color_bull, color_bear))
    //plot(show_deviation_lines ? sm + step * 2 : na, color=get_band_color(sm + step * 2, close, adjusted_sm_score, true, color_bull, color_bear))
    plot(show_deviation_lines sm step     nacolor=get_band_color(sm step    closeadjusted_sm_scoretruecolor_bullcolor_bear))
    //plot(sm, color=get_dynamic_color(adjusted_sm_score, 0), title="SMEMA", linewidth=2)
    plot(show_deviation_lines sm step     nacolor=get_band_color(sm step    closeadjusted_sm_scorefalsecolor_bullcolor_bear))
    //plot(show_deviation_lines ? sm - step * 2 : na, color=get_band_color(sm - step * 2, close, adjusted_sm_score, false, color_bull, color_bear))
    //plot(show_deviation_lines ? sm - step * 3 : na, color=get_band_color(sm - step * 3, close, adjusted_sm_score, false, color_bull, color_bear))
    /////////////////
    // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // Â© Darkoexe
    //@version=6

    ATRwithTrendFactor input(4.5'ATR with trend factor')
    ATRagainstTrendFactor input(1.5'ATR against trend factor')
    ATRperiod input(14'ATR period')

    color ColorStartUpTrend input.color(color.green'Start Up Trend Color')
    color ColorStartDownTrend input.color(color.red'Start Down Trend Color')
    color ColorEndTrend input.color(color.purple'End Trend Color')
    color ColorBoth input.color(color.gray'Color when start and end trend are the same')


    var 
    bool endTrend false


    var float fullTrendChecker 0.0
    var float counterTrendChecker close close[1] > 0.0 0.1 : -0.1

    var bool UpTrend false
    var bool DownTrend false


    var StartTrendBarTime time
    var EndTrendBarTime time
    var float previous_EndTrendBarTime time

    var float EndTrendClose close

    var bool reversal false


    if bar_index 1
        fullTrendChecker 
    := fullTrendChecker close close[1]
        
    fullTrendChecker


    if UpTrend and reversal
        counterTrendChecker 
    := counterTrendChecker close close[1]
        
    counterTrendChecker

    else if UpTrend and close close[1] < 0.0 and counterTrendChecker == 0.1
        counterTrendChecker 
    := close close[1]
        
    EndTrendBarTime := time[1]
        
    reversal := true
        EndTrendClose 
    := close[1]

        
    endTrend := true
        endTrend

    if DownTrend and reversal
        counterTrendChecker 
    := counterTrendChecker close close[1]
        
    counterTrendChecker

    else if DownTrend and close close[1] > 0.0 and counterTrendChecker == -0.1
        counterTrendChecker 
    := close close[1]
        
    EndTrendBarTime := time[1]
        
    reversal := true
        EndTrendClose 
    := close[1]

        
    endTrend := true
        endTrend


    var float endTrendATR 0
    endTrendATR 
    := endTrend ta.atr(ATRperiod)[1] : endTrendATR
    endTrend 
    := false

    var float startTrendATR 0

    var upWick 0.0
    var downWick 0.0

    if bar_index 1
        
    if close close[1] > 0.0
            upWick 
    := high close
            upWick
        
    else
            
    upWick := high close
            upWick

        
    if close close[1] < 0.0
            downWick 
    := low close
            downWick
        
    else
            
    downWick := low close
            downWick

    findIndex
    (TIME) =>
        
    int i 0
        
    while true
            
    if time[i] == TIME
                findIndex 
    i
                
    break
            
    := 1
            i

    if counterTrendChecker upWick >= ATRagainstTrendFactor endTrendATR and DownTrend //Checks if the trend has ended
        
    fullTrendChecker := fullTrendChecker EndTrendClose close

        
    if fullTrendChecker <= -ATRwithTrendFactor startTrendATR //Checks if the trend was atleast the size of "ATRwithTrendFactor" multiplied by the ATR at the start of the trend
            
    if StartTrendBarTime == previous_EndTrendBarTime

                label
    .new(point chart.point.from_time(StartTrendBarTimeclose[findIndex(StartTrendBarTime)]), style label.style_label_downxloc xloc.bar_timesize size.smalltext 'Trend Kontrol'color ColorBoth)
                
    label.new(point chart.point.from_time(EndTrendBarTimeclose[findIndex(EndTrendBarTime)]), style label.style_label_upxloc xloc.bar_timesize size.smalltext 'Trend Devam'color ColorEndTrend)
                
    // line.new(x1=StartTrendBarTime, y1=1, x2=StartTrendBarTime, y2=2, extend=extend.both, color=ColorBoth, width=4, xloc=xloc.bar_time)
                // line.new(x1=EndTrendBarTime, y1=1, x2=EndTrendBarTime, y2=2, extend=extend.both, color=ColorEndTrend, width=2, xloc=xloc.bar_time)

            
    else
                
    label.new(point chart.point.from_time(StartTrendBarTimeclose[findIndex(StartTrendBarTime)]), style label.style_label_downxloc xloc.bar_timesize size.smalltext 'Düþüþ Baþladý'color ColorStartDownTrend)
                
    label.new(point chart.point.from_time(EndTrendBarTimeclose[findIndex(EndTrendBarTime)]), style label.style_label_upxloc xloc.bar_timesize size.smalltext 'Düþüþ Bitti'color ColorEndTrend)
            
    // line.new(x1=StartTrendBarTime, y1=1, x2=StartTrendBarTime, y2=2, extend=extend.both, color=lineColorStartTrend, width=2, xloc=xloc.bar_time)
            // line.new(x1=EndTrendBarTime, y1=1, x2=EndTrendBarTime, y2=2, extend=extend.both, color=ColorEndTrend, width=2, xloc=xloc.bar_time)
            
    previous_EndTrendBarTime := EndTrendBarTime
            previous_EndTrendBarTime

        
    //ATR := ta.atr(ATRperiod)
        
    if counterTrendChecker 0.0
            StartTrendBarTime 
    := time[1]
            
    startTrendATR := ta.atr(ATRperiod)[1]
            
    fullTrendChecker := close open
            counterTrendChecker 
    := -0.1
            reversal 
    := false
            reversal
        
    else
            
    StartTrendBarTime := EndTrendBarTime
            startTrendATR 
    := endTrendATR
            fullTrendChecker 
    := counterTrendChecker
            counterTrendChecker 
    := 0.1
            UpTrend 
    := true
            DownTrend 
    := false
            reversal 
    := false
            reversal


    else if counterTrendChecker downWick <= -(ATRagainstTrendFactor endTrendATR) and UpTrend //Checks if the trend has ended
        
    fullTrendChecker := fullTrendChecker EndTrendClose close

        
    if fullTrendChecker >= ATRwithTrendFactor startTrendATR //Checks if the trend was atleast the size of "ATRwithTrendFactor" multiplied by the ATR at the start of the trend
            
    if StartTrendBarTime == previous_EndTrendBarTime

                label
    .new(point chart.point.from_time(StartTrendBarTimeclose[findIndex(StartTrendBarTime)]), style label.style_label_upxloc xloc.bar_timesize size.smalltext 'Trend Kontrol'color ColorBoth)
                
    label.new(point chart.point.from_time(EndTrendBarTimeclose[findIndex(EndTrendBarTime)]), style label.style_label_downxloc xloc.bar_timesize size.smalltext 'Trend Devam'color ColorEndTrend)
                
    // line.new(x1=StartTrendBarTime, y1=1, x2=StartTrendBarTime, y2=2, extend=extend.both, color=ColorBoth, width=4, xloc=xloc.bar_time)
                // line.new(x1=EndTrendBarTime, y1=1, x2=EndTrendBarTime, y2=2, extend=extend.both, color=ColorEndTrend, width=2, xloc=xloc.bar_time)

            
    else
                
    label.new(point chart.point.from_time(StartTrendBarTimeclose[findIndex(StartTrendBarTime)]), style label.style_label_upxloc xloc.bar_timesize size.smalltext 'Yükseliþ Baþladý'color ColorStartUpTrend)
                
    label.new(point chart.point.from_time(EndTrendBarTimeclose[findIndex(EndTrendBarTime)]), style label.style_label_downxloc xloc.bar_timesize size.smalltext 'Yükseliþ Bitti'color ColorEndTrend)
            
    // line.new(x1=StartTrendBarTime, y1=1, x2=StartTrendBarTime, y2=2, extend=extend.both, color=lineColorStartTrend, width=2, xloc=xloc.bar_time)
            // line.new(x1=EndTrendBarTime, y1=1, x2=EndTrendBarTime, y2=2, extend=extend.both, color=ColorEndTrend, width=2, xloc=xloc.bar_time)
            
    previous_EndTrendBarTime := EndTrendBarTime
            previous_EndTrendBarTime

        
    //ATR := ta.atr(ATRperiod)
        
    if counterTrendChecker 0.0
            StartTrendBarTime 
    := time[1]
            
    startTrendATR := ta.atr(ATRperiod)[1]
            
    fullTrendChecker := close open
            counterTrendChecker 
    := 0.1
            reversal 
    := false
            reversal
        
    else
            
    StartTrendBarTime := EndTrendBarTime
            startTrendATR 
    := endTrendATR
            fullTrendChecker 
    := counterTrendChecker
            counterTrendChecker 
    := -0.1
            DownTrend 
    := true
            UpTrend 
    := false
            reversal 
    := false
            reversal


    if reversal and UpTrend and close close[1] > 0.0 and counterTrendChecker 0.0
        reversal 
    := false
        counterTrendChecker 
    := 0.1
        counterTrendChecker

    else if reversal and DownTrend and close close[1] < 0.0 and counterTrendChecker 0.0
        reversal 
    := false
        counterTrendChecker 
    := -0.1
        counterTrendChecker


    if fullTrendChecker 0.0
        UpTrend 
    := true
        DownTrend 
    := false
        DownTrend


    else if fullTrendChecker 0.0
        UpTrend 
    := false
        DownTrend 
    := true
        DownTrend
    ///////////////// 
    görüntünün kodu bu.....
    16.07.2024 - 10.12.2024













  4. Herkese Ýyi Bayramlar...
    16.07.2024 - 10.12.2024

Sayfa 287/287 ÝlkÝlk ... 187237277285286287

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
  •