Sayfa 260/352 İlkİlk ... 160210250258259260261262270310 ... SonSon
Arama sonucu : 2814 madde; 2,073 - 2,080 arası.

Konu: Tradingview

  1.  Alıntı Originally Posted by @yörük@ Yazıyı Oku
    size gönderdiğim kodda...veriyi kapanış olarak aldığımızda....

    eğer doğru anladıysam....

    fiyat farkını...fuşya renkle gösterdiğim gibi yazılmış olur.....


    ancak...kıyas yapabilmek için.....

    kodda yineleme yapmak gerekir ki.....
    yani q5 ve z5 değerlerini değiştirip....hep fiyatın üstüne almak gerekir gibi...


    bu durumda...kodun nasıl sinyal ürettiği belli....

    yineleme yapılınca...farktan yeniden sinyal üretmek gerekir gibi....

    sinyali tanılamak için de....kodun kendiyle kıyaslamalı gibi....
    yani fark....sizin normal kullandığınız kodda ki...
    dediğiniz gibi...Q5 aşağı yukarı kesmesine göre...

    ortaya daha hızlı...daha çok işleme sokan....
    algoritmik kod gibi olur....


    görüntüdeki yeşil kırmızı sinyaller sizin kodunuz....
    sarı mavi sinyaller ise....
    farkın...sizin kodunuzla kesişmesi ile ortaya çıkmış olur....

    periyotlardaki görüntüleri böyle gözükür....
    not sinyaller birbirini örtmemesi için....
    farkdan oluşan sinyaller alt üst şeklinde...
    strateji testlerini yapmadım....





    PHP Code:
      //yörükten...başkaraya selamlarla......
    //@version=5
    indicator("Başkara"overlay true)

    src input(closetitle="Source")
    highlight input(truetitle="Highlighting?")
    showSignals input(truetitle="Show Signals?")

    Q1 input.int(3title="Q1")
    Q2 input.float(0.8title="Q2")
    Q3 Q2/100
    Q4 
    ta.wma(srcQ1)
    Q5 0.0
    Q5 
    := (Q4*(1-Q3))>nz(Q5[1],0) ? Q4*(1-Q3) : (Q4*(1+Q3))<nz(Q5[1],0) ? Q4*(1+Q3) : nz(Q5[1],0)

    Z1 input.int(3title="Z1")
    Z2 input.float(1.23title="Z2")
    Z3 Z2/100
    Z4 
    ta.wma(srcZ1)
    Z5 0.0
    Z5 
    := (Z4*(1-Z3))>nz(Z5[1],0) ? Z4*(1-Z3) : (Z4*(1+Z3))<nz(Z5[1],0) ? Z4*(1+Z3) : nz(Z5[1],0)

    BuySignal ta.crossover(Q5,Z5)
    SellSignal ta.crossunder(Q5,Z5)
    Q5pl=plot(int(Q5/0.025+0.50)*0.025color=color.greenlinewidth=1)
    Z5pl=plot(int(Z5/0.025+0.50)*0.025color=color.redlinewidth=1)
    //fill(Q5pl,Z5pl, color= highlight ? Q5>Z5 ? color.new(color.green,50) : color.new(color.red,50) : na)
    plotshape(showSignals and BuySignaltitle="Buy Signal"style=shape.labeluptext="Al"textcolor=color.whitecolor=color.greenlocation=location.belowbar)
    plotshape(showSignals and SellSignaltitle="Sell Signal"style=shape.labeldowntext="SAT"textcolor=color.whitecolor=color.redlocation=location.abovebar


    farkx=close-(Q5-close[1])
    fiyat=plot(farkxcolor=color.fuchsialinewidth=1)

    BuySignalx ta.crossover(farkx,Q5[0])
    SellSignalx ta.crossunder(farkx,Q5[0])
    Q5plx=plot(int(Q5/1.025+0.50)*1.025color=color.greenlinewidth=1)
    Z5plx=plot(int(Z5/1.025+0.50)*1.025color=color.redlinewidth=1)
    fill(Q5plx,Z5plxcolorhighlight Q5>Z5 color.new(color.yellow,50) : color.new(color.aqua,50) : na)
    plotshape(showSignals and BuySignalxtitle="Buy Signal"style=shape.labeluptext="Al"textcolor=color.blackcolor=color.aqualocation=location.bottom)
    plotshape(showSignals and SellSignalxtitle="Sell Signal"style=shape.labeldowntext="SAT"textcolor=color.blackcolor=color.yellowlocation=location.top
    16.07.2024 - 10.12.2024

  2. PHP Code:
     //@version=5
    //Created and maintained by Josh Baus.
    //With contributions from Wim Van Ertvelde.
    indicator('Wayne\'s Pivots'shorttitle='..'overlay=truemax_bars_back 500max_lines_count 500)

    // Pivot point bias drop down selection for bulish, bearish, and Out Of Position highlights.
    biasInput input.string(title='Pivot Point Bias'defval='All'options=['Bullish''Bearish''Out of Position''Range''All'])

    // Automaticly selects a daily, weekly, or monthly pivot point based on the timeframe being used.
    defaultTimeFrame timeframe.period == '1' 'D' timeframe.period == '5' 'D' timeframe.period == '15' 'D' timeframe.period == '30' 'D' timeframe.period == '60' 'D' timeframe.period == '240' 'W' timeframe.period == 'D' 'M' timeframe.isweekly '12M' timeframe.ismonthly '12M' '120M'
    inputTimeFrame input.timeframe(title='Time Frame'defval='')
    pResolution inputTimeFrame == '' defaultTimeFrame inputTimeFrame

    // Creating the "avg_resOffset" value to plot the future pivot points.
    // Credit and thanks to PineCoders for creating the function making this script possible.
    // Source: https://www.tradingview.com/script/90mqACUV-MTF-Selection-Framework-PineCoders-FAQ/
    f_avgDilationOf(pResolution) =>
        
    ta.barssince(ta.change(time(pResolution)))
        
    cumTotal ta.cum(== b[1] + 0)
        
    cumCount ta.cum(== 0)
        
    cumTotal cumCount
    avg_resOffset 
    pResolution == 'D' math.ceil(f_avgDilationOf(pResolution)) + math.ceil(f_avgDilationOf(pResolution))

    // Hide or display pivot point labels, such as S1, M2, P, M3, R1, etc.
    bShowLabels input(title='Show All Pivot Labels'defval=true)

    pLabel input(title='Show P Label'defval=false)



    // Enables each pivot point level plot to be editied in the "Style" tab.
    bPlotEditable true

    // Color stylization by support and resistance grouping.
    // Colors for each support and resistance line can be set individually under the Style tab so long 

    c_orange1 color.new(color.orange45)

    c_orange2 color.new(color.orange35)



    plotColorP input(c_orange1'Central Pivot')

    plotColorPL input(c_orange2'Central Pivot Label')


    // Get the high, low, open, and close of the "pResolution" function for pivot point math.
    prevCloseHTF request.security(syminfo.tickeridpResolutionclose[0], lookahead=barmerge.lookahead_on)
    prevOpenHTF request.security(syminfo.tickeridpResolutionopen[0], lookahead=barmerge.lookahead_on)
    prevHighHTF request.security(syminfo.tickeridpResolutionhigh[0], lookahead=barmerge.lookahead_on)
    prevLowHTF request.security(syminfo.tickeridpResolutionlow[0], lookahead=barmerge.lookahead_on)

    // Math for pivot point levels
    pLevel = (prevHighHTF prevLowHTF prevCloseHTF) / 3



    // Bool conditions for bias settings

    var bool allBias false

    // Bool tree for bias settings

    if biasInput == 'All'

        
    allBias := true
        allBias

    // The indicator's pivot point plots. Pivot level stylization, used for buy and sell zone fills, biased pivots settings, and a gap or breakline "()!=0?na:" between pivots is here.


    pPlot plot(allBias pLevel natitle='PP'offset=int(avg_resOffset), color=ta.change(pLevel) != na plotColorPeditable=bPlotEditable)

    // "p"
    plotchar(ta.change(time(pResolution)) ? allBias pLevel na naoffset=int(avg_resOffset), location=location.absolutecolor=bShowLabels or pLabel plotColorPL natext=''char='P'size=size.tinyeditable=false)

    // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © aksharmty


    pivet2 = (close[2] + low[2] + high[2]) / 3
    plot
    (pivet2color=color.new(#ffeb3b, 100), title='önceki bar', linewidth=1)
    pivet1 = (close[1] + low[1] + high[1]) / 3

    orc 
    pivet2 pivet1 color.rgb(0187212100) : color.rgb(2558282100)
    plot(pivet1color=orctitle='son bar'linewidth=1)
    pivet = (close[0] + low[0] + high[0]) / 3
    plot
    (pivetcolor=color.new(#ffffff, 100), title='şimdiki bar', linewidth=1)

    bcolor ta.crossunder(pivet,pivet1) ? color.rgb(24844) :  ta.crossover(pivet,pivet2) ? color.rgb(424812): close>pivet color.rgb(524513) : close<pivet color.rgb(25022): color.rgb(2362534// : color.black 
    barcolor(bcolor)

    ///
    // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © Dr_Roboto


    //---------------------------------------------------------------------------
    price_high input(title='Price high source'defval=high)
    price_low input(title='Price low source'defval=low)

    pivot_left_bars input.int(defval=1minval=0title='Pivot left bars (increasing looks farther back in history)')
    pivot_right_bars input.int(defval=1minval=0title='Pivot right bars (increasing causes more latency but better accuracy)')


    higher_color input(title='Higher plot color'defval=color.rgb(7617579100))
    lower_color input(title='Lower plot color'defval=color.rgb(2558282100))


    //---------------------------------------------------------------------------
    // PIVOTS
    pivot_high ta.pivothigh(price_highpivot_left_barspivot_right_bars)

    pivot_low ta.pivotlow(price_lowpivot_left_barspivot_right_bars)

    //---------------------------------------------------------------------------
    // *** value at each bar is either nan or pivot price --> can't use nan to compare --> need to convert nan to previous value ***
    pivot_high_fixnan fixnan(pivot_high)

    pivot_low_fixnan fixnan(pivot_low)
    //---------------------------------------------------------------------------
    // HIGHER-HIGH or LOWER-HIGH???
    higher_pivot_high_fixnan pivot_high_fixnan[0] > pivot_high_fixnan[1]
    higher_pivot_high higher_pivot_high_fixnan pivot_high na
    higher_pivot_high_color 
    higher_pivot_high higher_color lower_color
    plot
    (pivot_highlinewidth=1color=higher_pivot_high_coloroffset=-pivot_right_bars)

    // LOWER LOW or HIGHER LOW???
    lower_pivot_low_fixnan pivot_low_fixnan[0] < pivot_low_fixnan[1]
    lower_pivot_low lower_pivot_low_fixnan pivot_low na
    lower_pivot_low_color 
    lower_pivot_low lower_color higher_color
    plot
    (pivot_lowlinewidth=1color=lower_pivot_low_coloroffset=-pivot_right_bars)

    // This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
    // © LuxAlgo


    //Basic
    length input.int(2group='Basic Settings'tooltip='Pivot length. Use higher values for having lines connected to more significant pivots')
    lookback input.int(2minval=1group='Basic Settings'tooltip='Number of lines connecting a pivot high/low to display')
    Slope input.float(0.5minval=-1maxval=1step=0.1group='Basic Settings'tooltip='Allows to multiply the linear regression slope by a number within -1 and 1')

    //Style
    ph_col input.color(#2157f3, 'Pivot High Lines Color', group='Line Colors')
    pl_col input.color(#ff1100, 'Pivot Low Lines Color', group='Line Colors')

    //──────────────────────────────────────────────────────────────────────────────
    Sma(srcp) =>
        
    ta.cum(src)
        (
    a[math.max(p0)]) / math.max(p0)
    Variance(srcp) =>
        
    == Sma(src srcp) - math.pow(Sma(srcp), 2)
    Covariance(xyp) =>
        
    Sma(yp) - Sma(xp) * Sma(yp)
    //──────────────────────────────────────────────────────────────────────────────
    bar_index
    ph 
    ta.pivothigh(lengthlength)
    pl ta.pivotlow(lengthlength)
    //──────────────────────────────────────────────────────────────────────────────
    varip ph_array = array.new_float(0)
    varip pl_array = array.new_float(0)
    varip ph_n_array = array.new_int(0)
    varip pl_n_array = array.new_int(0)
    if 
    ph
        
    array.insert(ph_array0ph)
        array.
    insert(ph_n_array0n)
    if 
    pl
        
    array.insert(pl_array0pl)
        array.
    insert(pl_n_array0n)
    //──────────────────────────────────────────────────────────────────────────────
    val_ph ta.valuewhen(phlengthlookback 1)
    val_pl ta.valuewhen(pllengthlookback 1)
    val math.min(val_phval_pl)
    val val 2
    slope 
    Covariance(closenk) / Variance(nk) * Slope
    var line ph_l na
    var line pl_l na
    if barstate.islast
        
    for 0 to lookback 1 by 1
            ph_y2 
    = array.get(ph_arrayi)
            
    ph_x1 = array.get(ph_n_arrayi) - length
            pl_y2 
    = array.get(pl_arrayi)
            
    pl_x1 = array.get(pl_n_arrayi) - length
            ph_l 
    := line.new(ph_x1ph_y2ph_x1 1ph_y2 slopeextend=extend.rightcolor=ph_col)
            
    pl_l := line.new(pl_x1pl_y2pl_x1 1pl_y2 slopeextend=extend.rightcolor=pl_col)
            
    pl_l

    // This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
    // © LuxAlgo

    //@version=5

    //------------------------------------------------------------------------------
    //Settings
    //-----------------------------------------------------------------------------{
    lengthx input.int(2minval 1maxval 50)
    backpaint input(falsetooltip 'Backpainting offset displayed elements in the past. Disable backpainting to see real time information returned by the indicator.')

    //Style
    maxCss input.color(color.rgb(222222100), 'Trailing Maximum Color'group 'Style')
    minCss input.color(color.rgb(222222100) , 'Trailing Minimum Color'group 'Style')
    avgCss input.color(color.new(color.fuchsia,100)   , 'Trailing Maximum Color'group 'Style')

    bullFill input.color(color.new(color.teal,80), 'Uptrend Area'  group 'Style')
    bearFill input.color(color.new(color.red,80) , 'Downtrend Area'group 'Style')

    //-----------------------------------------------------------------------------}
    //Calculation
    //-----------------------------------------------------------------------------{
    var float max na
    var float min na
    var offset backpaint length 0

    phx 
    ta.pivothigh(lengthxlengthx)
    plx ta.pivotlow(lengthxlengthx)

    if 
    phx or plx
        max 
    := high[lengthx]
        
    min := low[lengthx]

    max := math.max(high[offset], max)
    min := math.min(low[offset], min)

    avg math.avg(max,min)

    //-----------------------------------------------------------------------------}
    //Non offset trailing max/min
    //-----------------------------------------------------------------------------{
    nx bar_index

    max_prev 
    max
    min_prev 
    min
    avg_prev 
    avg
    max2 
    max
    min2 
    min

    fill_css 
    fixnan(phx bearFill plx bullFill na)

    if 
    barstate.islast and backpaint
        
    //Delete previously set lines
        
    for line_object in line.all
            line
    .delete(line_object)

        
    //Loop trough calculation window
        
    for 0 to lengthx-1
            max2 
    := math.max(high[lengthx-1-i], max_prev)
            
    min2 := math.min(low[lengthx-1-i], min_prev)
            
    avg2 math.avg(max2min2)
            
            
    //Set lines
            
    line1 line.new(nx-(lengthx-i), max_prevnx-(lengthx-1-i), max2colormaxCss)
            
    line2 line.new(nx-(lengthx-i), min_prevnx-(lengthx-1-i), min2colorminCss)
            
    linefill.new(line1,line2,color.new(fill_css80))

            
    line.new(nx-(lengthx-i), avg_prevnx-(lengthx-1-i), avg2coloravgCss)
            
            
    max_prev := max2
            min_prev 
    := min2
            avg_prev 
    := avg2

    //-----------------------------------------------------------------------------}
    //Plots
    //-----------------------------------------------------------------------------{
    plot1 plot(max'max'
      
    phx or plx na maxCss
      
    1
      
    plot.style_linebr
      
    offset = -offset)

    plot2 plot(min'min'
      
    phx or plx na minCss
      
    1
      
    plot.style_linebr
      
    offset = -offset)

    plot(avg'ort'
      
    phx or plx na avgCss
      
    1
      
    plot.style_linebr
      
    offset = -offset)

    fill(plot1plot2phx or plx na fill_css
    16.07.2024 - 10.12.2024

  3. PHP Code:
     ///
    //@version=5
    indicator("."overlay true)

    src33 input(closetitle="Source")
    highlight input(truetitle="Highlighting?")
    showSignals input(truetitle="Show Signals?")

    Q1 input.int(1title="Q1")
    Q2 input.float(1title="Q2")
    Q3 Q2/100
    Q4 
    ta.ema(src33Q1)
    Q5 0.0
    Q5 
    := (Q4*(1-Q3))>nz(Q5[1],0) ? Q4*(1-Q3) : (Q4*(1+Q3))<nz(Q5[1],0) ? Q4*(1+Q3) : nz(Q5[1],0)

    Z1 input.int(1title="Z1")
    Z2 input.float(1title="Z2")
    Z3 Z2/100
    Z4 
    ta.ema(src33Z1)
    Z5 0.0
    Z5 
    := (Z4*(1-Z3))>nz(Z5[1],0) ? Z4*(1-Z3) : (Z4*(1+Z3))<nz(Z5[1],0) ? Z4*(1+Z3) : nz(Z5[1],0)

    BuySignal ta.crossover(Q5,Z5)
    SellSignal ta.crossunder(Q5,Z5)
    //Q5pl=plot(int(Q5/0.025+0.50)*0.025, color=color.green, linewidth=1,title="Direnç")
    //Z5pl=plot(int(Z5/0.025+0.50)*0.025, color=color.red, linewidth=1,title="Destek")
    //fill(Q5pl,Z5pl, color= highlight ? Q5>Z5 ? color.new(color.green,50) : color.new(color.red,50) : na)
    //plotshape(showSignals and BuySignal, title="Buy Signal", style=shape.labelup, text="AL", textcolor=color.white, color=color.green, location=location.belowbar)
    //plotshape(showSignals and SellSignal, title="Sell Signal", style=shape.labeldown, text="SAT", textcolor=color.white, color=color.red, location=location.abovebar)

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    // ~~ ToolTips {
    t1 "Volatility Period defines the length of the look-back period for calculating volatility. Higher values make the bands adapt more slowly to volatility changes. Lower values make them adapt more quickly."
    t2 "Trend Factor adjusts the sensitivity of the trend line to price movements. A higher value makes the trend line less sensitive and smoother. Lower values make it more sensitive and reactive to price changes."
    t3 "Trend Step controls how quickly the trend line adjusts to sudden price changes. Higher values cause slower adjustments, leading to smoother trend lines. Lower values result in quicker adjustments to sudden changes."
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    // ~~ Inputs {
    volatilityPeriod   input.int(5title="Period"step=10minval=2maxval=1000inline="vol"group="Volatility Settings"tooltip=t1)
    trendFactor        input.float(9step=0.1title='Factor'minval 0.1inline=""group="Trend Settings"tooltip=t2)
    trendStep          input.float(1"Step"step=0.1,minval 0.5maxval 5.0inline=""group="Trend Settings"tooltip=t3)

    color_trend        input.color(color.rgb(2092453), title="Trend Line  "inline="trend"group="Style")
    colorForUpperBand  input.color(color.new(#862458, 10), title="Upper Band", inline="band", group="Style")
    colorForLowerBand  input.color(color.new(#493893, 10), title="Lower Band", inline="band", group="Style")
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    // ~~  Initialize Variables
    var float currentTrend        0.0
    var int trendDirection        0
    averageTrueRange              
    ta.atr(200)
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    // ~~  Function to determine the trend direction
    determineTrendDirection(direction) => direction direction[1] > : (direction direction[1] < ? -0)
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    // ~~  Calculate Trend Direction
    closingPrice      close
    scaledStandardDev 
    = (nz(averageTrueRange) * trendFactor)
    trendDirection    := determineTrendDirection(currentTrend) * int(scaledStandardDev)
    priceTrendDiff    closingPrice currentTrend closingPrice currentTrend currentTrend closingPrice
    reciprocalFactor  
    = (scaledStandardDev * (trendFactor)) * math.pow(2100)
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    // ~~ Calculate the Current Trend
    trendAdjustment   priceTrendDiff scaledStandardDev trendStep math.avg(closingPricecurrentTrend) : trendDirection reciprocalFactor currentTrend
    currentTrend      
    := trendAdjustment
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    // ~~  Calculate Upper and Lower Bands
    upperBand currentTrend scaledStandardDev averageTrueRange ta.ema(ta.stdev(closingPricevolatilityPeriod), 200)
    lowerBand currentTrend scaledStandardDev averageTrueRange ta.ema(ta.stdev(closingPricevolatilityPeriod), 200)
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    // ~~ Plot
    isTrendConsistent trendDirection == trendDirection[1]
    colorForPlot      trendDirection == color_trend color_trend

    //plotTrend   = plot(isTrendConsistent ? currentTrend : na, title="VTrend ", color=colorForPlot)
    //plotUpper   = plot(isTrendConsistent ? upperBand : na, title="VDirenç", color = color.new(color.black, 100))
    //plotLower   = plot(isTrendConsistent ? lowerBand : na, title="VDestek", color = color.new(color.black, 100))

    //fill(plotUpper, plotTrend, top_color = colorForLowerBand, bottom_color =color.new(na,100), top_value = upperBand, bottom_value = currentTrend, title="Background Upper")
    //fill(plotTrend, plotLower, top_color = color.new(na,100), bottom_color = colorForUpperBand, top_value = currentTrend, bottom_value = lowerBand, title="Background Lower")
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}

    //Trend Sar
    psar(start1inc1maximum1) =>
        
    out1 float(na)
        
    isUpTrend1 bool(na)
        
    maxMin1 float(na)
        
    acc1 float(na)
        
    prev1 float(na)

        if 
    bar_index >= 1
            prev1 
    := out1[1]
            if 
    bar_index == 1
                
    if close close[1]
                    
    isUpTrend1 := true
                    maxMin1 
    := math.max(highhigh[1])
                    
    prev1 := math.min(lowlow[1])
                    
    prev1
                
    else
                    
    isUpTrend1 := false
                    maxMin1 
    := math.min(lowlow[1])
                    
    prev1 := math.max(highhigh[1])
                    
    prev1

                acc1 
    := start1
                acc1
            
    else
                
    isUpTrend1 := isUpTrend1[1]
                
    acc1 := acc1[1]
                
    maxMin1 := maxMin1[1]
                
    maxMin1

            
    if isUpTrend1
                
    if high maxMin1
                    maxMin1 
    := high
                    acc1 
    := math.min(acc1 inc1maximum1)
                    
    acc1
            
    else
                if 
    low maxMin1
                    maxMin1 
    := low
                    acc1 
    := math.min(acc1 inc1maximum1)
                    
    acc1

            
    if na(out1)
                
    out1 := prev1 acc1 * (maxMin1 prev1)
                
    out1

            
    if isUpTrend1
                
    if low <= out1
                    isUpTrend1 
    := false
                    out1 
    := maxMin1
                    maxMin1 
    := low
                    acc1 
    := start1
                    acc1
            
    else
                if 
    high >= out1
                    isUpTrend1 
    := true
                    out1 
    := maxMin1
                    maxMin1 
    := high
                    acc1 
    := start1
                    acc1

            
    if na(out1)
                if 
    isUpTrend1
                    out1 
    := math.min(out1bar_index == low[1] : math.min(low[1], low[2]))
                    
    out1
                
    else
                    
    out1 := math.max(out1bar_index == high[1] : math.max(high[1], high[2]))
                    
    out1

        
    [out1acc1maxMin1isUpTrend1]


    start1 input(0)
    increment1 input(0.01)
    maximum1 input(0.02)
    [
    p1AF1EP1isUpTrend1] = psar(start1increment1maximum1)

    newEP1 EP1 != EP1[1]
    epNew1 newEP1 EP1 na

    plot
    (p1'STrend'style=plot.style_steplinecolor=isUpTrend1 color.rgb(252485100) : color.rgb(24355100), linewidth=1)
    plot(EP1'STrend Devam'style=plot.style_circlescolor=isUpTrend1 color.rgb(252485100) : color.rgb(24355100), linewidth=2)
    /// sar hesaplamasını 1 dakika üzerinden bar renlendirmesi....
    x1 input.timeframe('1'title='Periyot')
    ta.sar(00.020.02)
    y1 request.security(syminfo.tickeridx1z)
    xz input(truetitle='Renk')
    //Functions Sar for support and resistance
    q3 ta.sar(0.010.020.2)
    q2 ta.sar(0.010.040.4)
    q1 ta.sar(0.010.060.6)
    //plot(q3, title='UVSar', style=plot.style_circles, color=xz ? y1 > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.rgb(178, 181, 190, 100), linewidth=1)
    //plot(q2, title='OVSar', style=plot.style_circles, color=xz ? y1 > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.rgb(178, 181, 190, 100), linewidth=1)
    //plot(q1, title='KVSar', style=plot.style_circles, color=xz ? y1 > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.rgb(178, 181, 190, 100), linewidth=1)
    //Signal
    xyzq = (y1
    //plot(xyzq, title='Yörük', style=plot.style_linebr, color=xz ? y1 > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.rgb(178, 181, 190, 100), linewidth=1)


    //bcolor = ta.crossunder(close,q3) ? color.red :  ta.crossover(close,q3) ? color.green: close>q2 ? color.green : close<q2 ? color.red: color.rgb(216, 4, 253) // : color.black 
    //barcolor(bcolor)
    ////
    //Function 
    inp input(title='Source'defval=close)
    res input.timeframe(title='Resolution'defval='60')
    rep input(title='Allow Repainting?'defval=true)
    //////////////////////////////////////////////////////
    src1 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    fastLength1 input.int(title='FastLength'defval=12minval=1)
    slowLength1 input.int(title='SlowLength'defval=26minval=1)
    signalLength1 input.int(title='SignalLength'defval=9minval=1)
    macdLevel1 input.float(title='MacdLevel'defval=0minval=0)

    fastAlpha1 2.0 / (fastLength1)
    slowAlpha1 2.0 / (slowLength1)

    fastEma1 ta.ema(src1fastLength1)
    slowEma1 ta.ema(src1slowLength1)

    pMacdEq1 fastAlpha1 slowAlpha1 != ? ((nz(fastEma1[1]) * fastAlpha1) - (nz(slowEma1[1]) * slowAlpha1)) / (fastAlpha1 slowAlpha1) : 0
    pMacdEqSig1 
    ta.ema(pMacdEq1signalLength1)
    pMacdLevel1 fastAlpha1 slowAlpha1 != ? (macdLevel1 - (nz(fastEma1[1]) * (fastAlpha1)) + (nz(slowEma1[1]) * (slowAlpha1))) / (fastAlpha1 slowAlpha1) : 0

    slo1 
    src1 pMacdEq1
    sig1 
    slo1 slo1 nz(slo1[1]) ? slo1 slo1 nz(slo1[1]) ? -: -0

    rmacdColor 
    sig1 color.rgb(0230119100) : sig1 color.rgb(0230119100) : sig1 < -color.rgb(2558282100) : sig1 color.rgb(2558282100) : color.white

    //plot(pMacdEq1, title='MacdTrend',style=plot.style_stepline, color=rmacdColor, linewidth=2)
    //plot(pMacdEqSig1, title='MacdStop', color=color.rgb(255, 255, 255, 100), linewidth=1)
    ///////////////////////////////////////////////////////////////////////////
    lenxc20 input(1)
    lenxc50 input(1)

    z20(closelenxc20) =>
        
    hcx20 0.0
        dxc20 
    0.0
        
    for 0 to lenxc20 1 by 1
            kxc20 
    = (lenxc20 i) * lenxc20
            hcx20 
    += kxc20
            dxc20 
    += close[i] * kxc20
            dxc20
        dxc20 
    hcx20

    cxc20 
    z20(closemath.floor(math.sqrt(lenxc20)))
    //
    z50(closelenxc50) =>
        
    hxc50 0.0
        dxc50 
    0.0
        
    for 0 to lenxc50 1 by 1
            kxc50 
    = (lenxc50 i) * lenxc50
            hxc50 
    += kxc50
            dxc50 
    += close[i] * kxc50
            dxc50
        dxc50 
    hxc50

    cxc50 
    z50(closemath.floor(math.sqrt(lenxc50)))
    //
    //

    startsx20 0.1
    incrementsx20 
    0.1
    maximumsx20 
    0.1
    ssx20 
    ta.sar(startsx20incrementsx20maximumsx20)
    s1sx20 z20(ssx20lenxc20)
    pcsx20 close s1sx20 color.rgb(2558282100) : color.rgb(7617579100)
    //plot(s1sx20, title="YavaşDöngü",style=plot.style_line, color=pcsx20, linewidth=1)

    startsx50 0
    incrementsx50 
    0.1
    maximumsx50 
    1
    ssx50 
    ta.sar(startsx50incrementsx50maximumsx50)
    s1sx50 z50(ssx50lenxc50)
    pcsx50 close s1sx50 color.rgb(2558282100) : color.rgb(7617579100)
    //plot(s1sx50, title="HızlıDöngü",style=plot.style_line, color=pcsx50, linewidth=1)
    ////
    //Stop Function
    mult156 input.float(1'Multiplicative Factor'minval 0)
    slope156 input.float(100'Slope'minval 0)
    width156 input.float(100'Width %'minval 0maxval 100) / 100
    //Style
    bullCss156 input.color(color.rgb(0230119100), 'Average Color'inline 'avg'group 'Style')
    bearCss156 input.color(color.rgb(2558282100), ''              inline 'avg'group 'Style')

    //Calculation
    //-----------------------------------------------------------------------------{
    var float upper156 na
    var float lower156 na
    var float avg156   close

    var hold156 0.
    var os156 1.
        
    atr156 
    nz(ta.atr(200)) * mult156

    avg156 
    := math.abs(close avg156) > atr156 
      
    math.avg(closeavg156)
      : 
    avg156 os156 * (hold156 mult156 slope156)

    os156 := math.sign(avg156 avg156[1])
    hold156 := os156 != os156[1] ? atr156 hold156

    upper156 
    := avg156 width156 hold156
    lower156 
    := avg156 width156 hold156

    css156 
    os156 == bullCss156 bearCss156
    plot_avg156 
    plot(avg156'TrendDeğişim'os156 != os156[1] ? na css156style=plot.style_line,linewidth 4)
    //END
    import TradingView/ta/5

    lnt 
    input(200"Lenght")
    lnt2 lnt 2
    off 
    input(1"Offset")

    reg ta.linreg(closelnt0)
    reg2 ta.linreg(closelnt20)
    regavg math.avg(regreg2)

    barc reg reg[1] and reg2 reg2[1] ? #79f504 : reg < reg[1] and reg2 < reg2[1] ? #e91e63 : color.rgb(11, 7, 236)

    //barcolor(barc, 0, true, title = "Bar Color")
    //plot(regavg, "Regression", color.rgb(255, 255, 255, 100), 1, plot.style_line, offset = off)
    //End
    //2 Pole Super Smoother Function
    SSF(xt) =>
        
    omega math.atan(1) * t
        a 
    math.exp(-math.sqrt(2) * math.atan(1) * t)
        
    math.cos(math.sqrt(2) / omega)
        
    c2 b
        c3 
    = -math.pow(a2)
        
    c1 c2 c3
        SSF 
    0.0
        SSF 
    := c1 c2 nz(SSF[1], x) + c3 nz(SSF[2], nz(SSF[1], x))
        
    SSF

    //Getter Function For Pseudo 2D Matrix
    get_val(matrowcolrowsize) =>
        array.
    get(matint(rowsize row col))

    //Setter Function For Pseudo 2D Matrix
    set_val(matrowcolrowsizeval) =>
        array.
    set(matint(rowsize row col), val)

    //LU Decomposition Function
    LU(AB) =>
        
    A_size = array.size(A)
        
    B_size = array.size(B)
        var 
    = array.new_float(A_size)
        var 
    = array.new_float(A_size)
        
    L_temp 0.0
        U_temp 
    0.0
        
    for 0 to B_size 1 by 1
            set_val
    (U0cB_sizeget_val(A0cB_size))
        for 
    1 to B_size 1 by 1
            set_val
    (Lr0B_sizeget_val(Ar0B_size) / get_val(U00B_size))
        for 
    0 to B_size 1 by 1
            
    for 0 to B_size 1 by 1
                
    if == c
                    set_val
    (LrcB_size1)
                if 
    c
                    set_val
    (LrcB_size0)
                if 
    c
                    set_val
    (UrcB_size0)
        for 
    0 to B_size 1 by 1
            
    for 0 to B_size 1 by 1
                
    if na(get_val(LrcB_size))
                    
    L_temp := get_val(ArcB_size)
                    for 
    0 to math.max(10by 1
                        L_temp 
    -= get_val(UkcB_size) * get_val(LrkB_size)
                        
    L_temp
                    set_val
    (LrcB_sizeL_temp get_val(UccB_size))
                if 
    na(get_val(UrcB_size))
                    
    U_temp := get_val(ArcB_size)
                    for 
    0 to math.max(10by 1
                        U_temp 
    -= get_val(UkcB_size) * get_val(LrkB_size)
                        
    U_temp
                    set_val
    (UrcB_sizeU_temp)
        [
    LU]

    //Lower Triangular Solution Function (Forward Substitution)
    LT_solve(L_B) =>
        
    B_size = array.size(B)
        var 
    = array.new_float(B_size)
        
    Y_temp 0.0
        
    array.set(Y0, array.get(B0) / get_val(L_00B_size))
        for 
    1 to B_size 1 by 1
            Y_temp 
    := array.get(Br)
            for 
    0 to math.max(10by 1
                Y_temp 
    -= get_val(L_rkB_size) * array.get(Yk)
                
    Y_temp
            
    array.set(YrY_temp get_val(L_rrB_size))
        
    Y

    //Upper Triangular Solution Function (Backward Substitution)
    UT_solve(U_Y_) =>
        
    Y_size = array.size(Y_)
        
    U_rev = array.copy(U_)
        
    Y_rev = array.copy(Y_)
        array.
    reverse(U_rev)
        array.
    reverse(Y_rev)
        
    X_rev LT_solve(U_revY_rev)
        
    = array.copy(X_rev)
        array.
    reverse(X)
        
    X

    //Regression Function
    regression_val(X_index_order_offset_) =>
        
    reg 0.0
        
    for 0 to order_ by 1
            reg 
    += array.get(X_i) * math.pow(index_ offset_i)
            
    reg
        reg

    //Curve Segment Drawing Function
    draw_curve(Ysdevnstep_collslwdrawconf) =>
        var 
    line segment line.new(x1=time[step_], y1=array.get(Yn) + sdevx2=time[(1) * step_], y2=array.get(Y1) + sdevxloc=xloc.bar_time)
        if 
    draw
            
    if conf barstate.isconfirmed 1
                line
    .set_xy1(segmenttime[step_], array.get(Yn) + sdev)
                
    line.set_xy2(segmenttime[(1) * step_], array.get(Y1) + sdev)
                
    line.set_color(segmentcol)
                
    line.set_width(segmentlw)
                
    line.set_style(segmentls == 'Solid' line.style_solid ls == 'Dotted' line.style_dotted line.style_dashed)
        else
            
    line.delete(segment)

    //-----------------------------------------------------------------------------------------------------------------------------------------------------------------
    //Inputs
    //-----------------------------------------------------------------------------------------------------------------------------------------------------------------

    //Source Inputs
    src44 input(defval=closetitle='Input Source Value')
    use_filt input(defval=truetitle='Smooth Data Before Curve Fitting')
    filt_per input.int(defval=10minval=2title='Data Smoothing Period ═══════════════════')

    //Calculation Inputs
    per input.int(defval=100minval=2title='Regression Sample Period')
    order input.int(defval=2minval=1title='Polynomial Order')
    calc_offs input(defval=0title='Regression Offset')
    ndev input.float(defval=2.0minval=0title='Width Coefficient')
    equ_from input.int(defval=0minval=0title='Forecast From _ Bars Ago ═══════════════════')

    //Channel Display Inputs
    show_curve input(defval=truetitle='Show Fitted Curve')
    show_high input(defval=truetitle='Show Fitted Channel High')
    show_low input(defval=truetitle='Show Fitted Channel Low')
    draw_step1 input.int(defval=10minval=1title='Curve Drawing Step Size')
    auto_step input(defval=truetitle='Auto Decide Step Size Instead')
    draw_freq input.string(defval='Close Only'options=['Continuous''Close Only'], title='Curve Update Frequency')
    poly_col_h input(defval=color.yellowtitle='Channel High Line Color')
    poly_lw_h input.int(defval=1minval=1title='Channel High Line Width')
    poly_ls_h input.string(defval='Dashed'options=['Solid''Dotted''Dashed'], title='Channel High Line Style')
    poly_col_m input(defval=color.rgb(25523559100), title='Channel Middle Line Color')
    poly_lw_m input.int(defval=1minval=1title='Channel Middle Line Width')
    poly_ls_m input.string(defval='Dotted'options=['Solid''Dotted''Dashed'], title='Channel Middle Line Style')
    poly_col_l input(defval=color.yellowtitle='Channel Low Line Color')
    poly_lw_l input.int(defval=1minval=1title='Channel Low Line Width')
    poly_ls_l input.string(defval='Dashed'options=['Solid''Dotted''Dashed'], title='Channel Low Line Style ═══════════════════')

    //Smooth data and determine source type for calculation.
    filt SSF(src44filt_per)
    src144 use_filt filt src44

    //Populate a period sized array with bar values.
    var x_vals = array.new_float(per)
    for 
    0 to per 1 by 1
        
    array.set(x_valsi1)

    //Populate a period sized array with historical source values.
    var src_vals = array.new_float(per)
    for 
    0 to per 1 by 1
        
    array.set(src_valsisrc144[per equ_from])

    //Populate an order*2 + 1 sized array with bar power sums.
    var xp_sums = array.new_float(order 1)
    xp_sums_temp 0.0
    for 0 to order 2 by 1
        xp_sums_temp 
    := 0
        
    for 0 to per 1 by 1
            xp_sums_temp 
    += math.pow(array.get(x_valsj), i)
            
    xp_sums_temp
        
    array.set(xp_sumsixp_sums_temp)

    //Populate an order + 1 sized array with (bar power)*(source value) sums.
    var xpy_sums = array.new_float(order 1)
    xpy_sums_temp 0.0
    for 0 to order by 1
        xpy_sums_temp 
    := 0
        
    for 0 to per 1 by 1
            xpy_sums_temp 
    += math.pow(array.get(x_valsj), i) * array.get(src_valsj)
            
    xpy_sums_temp
        
    array.set(xpy_sumsixpy_sums_temp)

    //Generate a pseudo square matrix with row and column sizes of order + 1 using bar power sums.
    var xp_matrix = array.new_float(int(math.pow(order 12)))
    for 
    0 to order by 1
        
    for 0 to order by 1
            set_val
    (xp_matrixrcorder 1, array.get(xp_sumsc))

    //Factor the power sum matrix into lower and upper triangular matrices with order + 1 rows and columns.
    [lowerupper] = LU(xp_matrixxpy_sums)

    //Find lower triangular matrix solutions using (bar power)*(source value) sums.
    l_solutions LT_solve(lowerxpy_sums)

    //Find upper triangular matrix solutions using lower matrix solutions. This gives us our regression coefficients.
    reg_coefs UT_solve(upperl_solutions)

    //Define curve drawing step size.
    draw_step auto_step math.ceil(per 10) : draw_step1

    //Calculate curve values.
    var inter_vals = array.new_float(11)
    for 
    0 to 10 by 1
        
    array.set(inter_valsiregression_val(reg_coefsperordercalc_offs equ_from draw_step i))

    //Calculate standard deviation for channel.
    Stdev = array.stdev(src_vals) * ndev
    //Draw interpolated segments.
    draw_curve(inter_vals01draw_steppoly_col_mpoly_ls_mpoly_lw_mshow_curvedraw_freq == 'Close Only')
    draw_curve(inter_vals02draw_steppoly_col_mpoly_ls_mpoly_lw_mshow_curvedraw_freq == 'Close Only')
    draw_curve(inter_vals03draw_steppoly_col_mpoly_ls_mpoly_lw_mshow_curvedraw_freq == 'Close Only')
    draw_curve(inter_vals04draw_steppoly_col_mpoly_ls_mpoly_lw_mshow_curvedraw_freq == 'Close Only')
    draw_curve(inter_vals05draw_steppoly_col_mpoly_ls_mpoly_lw_mshow_curvedraw_freq == 'Close Only')
    draw_curve(inter_vals06draw_steppoly_col_mpoly_ls_mpoly_lw_mshow_curvedraw_freq == 'Close Only')
    draw_curve(inter_vals07draw_steppoly_col_mpoly_ls_mpoly_lw_mshow_curvedraw_freq == 'Close Only')
    draw_curve(inter_vals08draw_steppoly_col_mpoly_ls_mpoly_lw_mshow_curvedraw_freq == 'Close Only')
    draw_curve(inter_vals09draw_steppoly_col_mpoly_ls_mpoly_lw_mshow_curvedraw_freq == 'Close Only')
    draw_curve(inter_vals010draw_steppoly_col_mpoly_ls_mpoly_lw_mshow_curvedraw_freq == 'Close Only')

    //Draw channel high segments.
    draw_curve(inter_valsStdev1draw_steppoly_col_hpoly_ls_hpoly_lw_hshow_highdraw_freq == 'Close Only')
    draw_curve(inter_valsStdev2draw_steppoly_col_hpoly_ls_hpoly_lw_hshow_highdraw_freq == 'Close Only')
    draw_curve(inter_valsStdev3draw_steppoly_col_hpoly_ls_hpoly_lw_hshow_highdraw_freq == 'Close Only')
    draw_curve(inter_valsStdev4draw_steppoly_col_hpoly_ls_hpoly_lw_hshow_highdraw_freq == 'Close Only')
    draw_curve(inter_valsStdev5draw_steppoly_col_hpoly_ls_hpoly_lw_hshow_highdraw_freq == 'Close Only')
    draw_curve(inter_valsStdev6draw_steppoly_col_hpoly_ls_hpoly_lw_hshow_highdraw_freq == 'Close Only')
    draw_curve(inter_valsStdev7draw_steppoly_col_hpoly_ls_hpoly_lw_hshow_highdraw_freq == 'Close Only')
    draw_curve(inter_valsStdev8draw_steppoly_col_hpoly_ls_hpoly_lw_hshow_highdraw_freq == 'Close Only')
    draw_curve(inter_valsStdev9draw_steppoly_col_hpoly_ls_hpoly_lw_hshow_highdraw_freq == 'Close Only')
    draw_curve(inter_valsStdev10draw_steppoly_col_hpoly_ls_hpoly_lw_hshow_highdraw_freq == 'Close Only')

    //Draw channel low segments.
    draw_curve(inter_vals, -Stdev1draw_steppoly_col_lpoly_ls_lpoly_lw_lshow_lowdraw_freq == 'Close Only')
    draw_curve(inter_vals, -Stdev2draw_steppoly_col_lpoly_ls_lpoly_lw_lshow_lowdraw_freq == 'Close Only')
    draw_curve(inter_vals, -Stdev3draw_steppoly_col_lpoly_ls_lpoly_lw_lshow_lowdraw_freq == 'Close Only')
    draw_curve(inter_vals, -Stdev4draw_steppoly_col_lpoly_ls_lpoly_lw_lshow_lowdraw_freq == 'Close Only')
    draw_curve(inter_vals, -Stdev5draw_steppoly_col_lpoly_ls_lpoly_lw_lshow_lowdraw_freq == 'Close Only')
    draw_curve(inter_vals, -Stdev6draw_steppoly_col_lpoly_ls_lpoly_lw_lshow_lowdraw_freq == 'Close Only')
    draw_curve(inter_vals, -Stdev7draw_steppoly_col_lpoly_ls_lpoly_lw_lshow_lowdraw_freq == 'Close Only')
    draw_curve(inter_vals, -Stdev8draw_steppoly_col_lpoly_ls_lpoly_lw_lshow_lowdraw_freq == 'Close Only')
    draw_curve(inter_vals, -Stdev9draw_steppoly_col_lpoly_ls_lpoly_lw_lshow_lowdraw_freq == 'Close Only')
    draw_curve(inter_vals, -Stdev10draw_steppoly_col_lpoly_ls_lpoly_lw_lshow_lowdraw_freq == 'Close Only')
    //END 

    //Reverse
    requestSecurity(string _symbolstring _resbool _repaints) => 
        
    repIndex _repaints barstate.isrealtime 0
        resIndex 
    _repaints barstate.isrealtime 1
        
    [hlt] = request.security(_symbol_res, [high[repIndex], low[repIndex], time[repIndex]])
        [
    h[resIndex], l[resIndex], t[resIndex]]

    var 
    GRP1 "General Settings"
    string res88 =         input.timeframe(title "Resolution"defval ""group GRP1)
    bool ignoreInsideBars input.bool(title "Ignore Inside Bars?"defval truegroup GRP1)
    bool rep88 =           input.bool(title "Allow Repainting?"defval falsegroup GRP1)
    var 
    string GRP2 "Short Term Settings"
    bool showSTHighs =   input.bool(title "Show Short Term Highs?"defval truegroup GRP2)
    color stHighsColor =    input.color(color.red"Short Term Highs Color"group GRP2)
    bool showSTLows =       input.bool(title "Show Short Term Lows?"defval truegroup GRP2)
    color stLowsColor =     input.color(color.yellow"Short Term Lows Color"group GRP2)
    var 
    string GRP3 "Mid Term Settings"
    bool showMTHighs =      input.bool(title "Show Mid Term Highs?"defval truegroup GRP3)
    color mtHighsColor =    input.color(color.red"Mid Term Highs Color"group GRP3)
    bool showMTLows =       input.bool(title "Show Mid Term Lows?"defval truegroup GRP3)
    color mtLowsColor =     input.color(color.aqua"Mid Term Lows Color"group GRP3)
    var 
    string GRP4 "Long Term Settings"
    bool showLTHighs =      input.bool(title "Show Long Term Highs?"defval truegroup GRP4)
    color ltHighsColor =    input.color(color.red"Long Term Highs Color"group GRP4)
    bool showLTLows =       input.bool(title "Show Long Term Lows?"defval truegroup GRP4)
    color ltLowsColor =     input.color(color.white"Long Term Lows Color"group GRP4)
    [
    hlt] = requestSecurity(syminfo.tickerres88rep88)

    type ReversalPoint
        int     bar_time
        float   price

    var lowShortRevPoints  = array.new<ReversalPoint>()
    var 
    highShortRevPoints = array.new<ReversalPoint>()
    var 
    lowMediumRevPoints  = array.new<ReversalPoint>()
    var 
    highMediumRevPoints = array.new<ReversalPoint>()

    isReversalPoint(bool isLowfloat firstSrcfloat midSrcfloat lastSrcbool isInsideBar) =>
        
    bool isReversalPoint false

        
    if not (isInsideBar and ignoreInsideBars)
            if 
    isLow
                isReversalPoint 
    := lastSrc midSrc and midSrc firstSrc
            
    else
                
    isReversalPoint := lastSrc midSrc and midSrc firstSrc

        isReversalPoint

    plotReversalPoint
    (bool isLowReversalPoint revPointcolor revPointColorstring labelSizebool createLabel) =>
        if 
    createLabel
            label
    .new(revPoint.bar_timerevPoint.priceisLow '▲' '▼'
             
    xloc xloc.bar_timeyloc isLow yloc.belowbar yloc.abovebarsize labelSizecolor color(na), 
             
    textcolor revPointColorstyle label.style_text_outline)

    getReversalPoints(bool isLowReversalPoint[] sourceArraycolor plotColorReversalPoint newRpstring labelSize
     
    bool createLabelbool isInsideBar) =>
        
    ReversalPoint result na
        sourceArray
    .push(newRp)
        
    plotReversalPoint(isLownewRpplotColorlabelSizecreateLabel)
        
    int arraySize sourceArray.size()
        
    float midArrayValue arraySize >= sourceArray.get(arraySize 2).price na
        float firstArrayValue 
    arraySize >= sourceArray.get(arraySize 3).price na

        
    if not na(firstArrayValue) and not na(midArrayValue) and isReversalPoint(isLowfirstArrayValuemidArrayValuenewRp.priceisInsideBar)
            
    result := sourceArray.get(arraySize 2)

        
    result

    bool isInsideBar 
    nz(h[1]) and nz(l[1])
    ReversalPoint shortTermLow isReversalPoint(truenz(l[2]), nz(l[1]), lisInsideBar) ? ReversalPoint.new(nz(t[1]), nz(l[1])) : na
    ReversalPoint midTermLow 
    na
    ReversalPoint longTermLow 
    na

    if not na(shortTermLow)
        
    midTermLow := getReversalPoints(truelowShortRevPointsstLowsColorshortTermLowsize.tinyshowSTLowsisInsideBar)

    if 
    not na(midTermLow)
        
    longTermLow := getReversalPoints(truelowMediumRevPointsmtLowsColormidTermLowsize.smallshowMTLowsisInsideBar)

    if 
    not na(longTermLow)
        
    plotReversalPoint(truelongTermLowltLowsColorsize.normalshowLTLows)

    ReversalPoint shortTermHigh isReversalPoint(falsenz(h[2]), nz(h[1]), hisInsideBar) ? ReversalPoint.new(nz(t[1]), nz(h[1])) : na
    ReversalPoint midTermHigh 
    na
    ReversalPoint longTermHigh 
    na

    if not na(shortTermHigh)
        
    midTermHigh := getReversalPoints(falsehighShortRevPointsstHighsColorshortTermHighsize.tinyshowSTHighsisInsideBar)

    if 
    not na(midTermHigh)
        
    longTermHigh := getReversalPoints(falsehighMediumRevPointsmtHighsColormidTermHighsize.smallshowMTHighsisInsideBar)

    if 
    not na(longTermHigh)
        
    plotReversalPoint(falselongTermHighltHighsColorsize.normalshowLTHighs)


    //
    //Top-Bottom
    plot input.bool(truetitle="Display past dots")
    OverSold input(0)
    OverBought input(100)
    length1 input.int(1title "Length")
    tr input.int(1title "Trigger Length")

    // Define the function
    func(sourceint lenint tr) =>
        
    HP 0.00a1 0.00b1 0.00c1 0.00c2 0.00c3 0.00ag 0.00Sp 0.000.00Quotient1 0.00Quotient2 0.00math.sqrt(.5)
        
    HP := 2500 * (source nz(source[1]) + nz(source[2])) + 1.92 nz(HP[1]) - .9216 nz(HP[2])
        
    a1 := math.exp(-math.sqrt(2) * math.pi len)
        
    b1 := a1 math.cos(math.sqrt(2) * math.pi len)
        
    c2 := b1
        c3 
    := -a1 a1
        c1 
    := c2 c3
        ag 
    := c1 * (HP nz(HP[1])) / c2 nz(ag[1]) + c3 nz(ag[2])
        
    Sp := .991 nz(Sp[1])
        if 
    math.abs(ag) > Sp
            Sp 
    := math.abs(ag)
            
    Sp
        
    if Sp != 0
            X 
    := ag Sp
            X
        q1 
    60 50
        out
    ta.sma(q1tr)
        [
    out]

    [
    k] = func(closelength1,tr)
    OverboughtCond OverBought
    OversoldCond 
    OverSold

    //plotshape(plot? OverboughtCond:na, style=shape.cross, location=location.abovebar, color=color.new(color.red, 50), size=size.tiny)
    //plotshape(plot? OversoldCond:na, style=shape.cross, location=location.belowbar, color=color.new(color.lime, 50), size=size.tiny)
    var label myLabel_Overbought na
    if OverboughtCond
        
    // Delete the previous label if there is one
        
    if not na(myLabel_Overbought)
            
    label.delete(myLabel_Overbought[1])
        
    // Create a new label
        
    myLabel_Overbought := label.new(bar_indexhigh'Tepe',yloc=yloc.abovebar,style=label.style_circlesize=size.normalcolor=color.rgb(255828250), textcolor=color.white)
        
    myLabel_Overbought
    var label myLabel_Oversold na
    if OversoldCond
        
    // Delete the previous label if there is one
        
    if not na(myLabel_Oversold)
            
    label.delete(myLabel_Oversold[1])
        
    // Create a new label
        
    myLabel_Oversold := label.new(bar_indexlow'Dip',yloc=yloc.belowbar,style=label.style_circlesize=size.normalcolor=color.rgb(023011950), textcolor=color.white)
        
    myLabel_Oversold


    //

    startsa input.float(0"Starting value")
    incsa input.float(0.01"Increment")
    maxsa input.float(1"Max Value")
    widthsa input.float(9.00"Zone width")

    atrs ta.atr(100) * widthsa
    sarone 
    ta.sar(startsaincsamaxsa)
    sarzone = if close sarone
        sarone 
    atrs
    else if close sarone
        sarone 
    atrs
    sartwo 
    ta.sar(startsa/2incsa/2maxsa/2)

    p1sa plot(sarone"Kanal"color close sarone #2962ff00 : #e91e6200, style=plot.style_circles)
    p3sa plot(sarzone"Kanal"color close sarone #2962ff00 : #e91e6200, style=plot.style_circles)
    fill(p1sap3sacolor close sarone color.new(#848486, 60) : color.new(#e91e62, 100))

    ////Emas
    q156 ta.ema(ohlc41)
    q5 ta.ema(ohlc42)
    q9 ta.ema(ohlc43)
    q13 ta.ema(ohlc44)
    q26 ta.ema(ohlc45)
    q50 ta.ema(ohlc46)
    q100 ta.ema(ohlc47)
    q200 ta.ema(ohlc48)

    qeq=(q156+q5+q9+q13+q26+q50+q100+q200)/8
    //plot(qeq,"AVG-EMA",color.rgb(255, 235, 59, 100), linewidth=1) 
    16.07.2024 - 10.12.2024

  4. PHP Code:
     // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © carefulCode53358

    //@version=2
    study("*",overlay=true)
    //resolution
    x1=input("1"type=resolutiontitle="Resolution")
    x3=input("3"type=resolutiontitle="Resolution")
    x5=input("5"type=resolutiontitle="Resolution")
    x15=input("15"type=resolutiontitle="Resolution")
    x30=input("30"type=resolutiontitle="Resolution")
    x45=input("45"type=resolutiontitle="Resolution")
    x60=input("60"type=resolutiontitle="Resolution")
    x120=input("120"type=resolutiontitle="Resolution")
    x180=input("180"type=resolutiontitle="Resolution")
    x240=input("240"type=resolutiontitle="Resolution")
    x720=input("D"type=resolutiontitle="Resolution")
    //output functions
    sar(00.011)
    // Security
    y1 security(tickeridx1z)
    y3 security(tickeridx3z)
    y5 security(tickeridx5z)
    y15 security(tickeridx15z)
    y30 security(tickeridx30z)
    y45 security(tickeridx45z)
    y60 security(tickeridx60z)
    y120 security(tickeridx120z)
    y180 security(tickeridx180z)
    y240 security(tickeridx240z)
    y720 security(tickeridx720z)
    //Plots
    xz input(truetitle="Adaptive Coloring"type=bool)
    //plot(y1, title="1", style=circles, color=xz?(y1>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y3, title="3", style=circles, color=xz?(y3>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y5, title="5", style=circles, color=xz?(y5>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y15, title="15", style=circles, color=xz?(y15>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y30, title="30", style=circles, color=xz?(y30>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y45, title="45", style=circles, color=xz?(y45>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y60, title="60", style=circles, color=xz?(y60>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y120, title="120", style=circles, color=xz?(y120>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y180, title="180", style=circles, color=xz?(y180>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y240, title="240", style=circles, color=xz?(y240>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y720, title="720", style=circles, color=xz?(y720>close?red:lime) : silver, transp=100, linewidth=1)
    //Functions Sar for support and resistance
    q3 sar(0.01,0.02,0.2)
    q2 sar(0.01,0.04,0.4)
    q1 sar(0.01,0.06,0.6)
    plot(q1title="KVSar"style=crosscolor=xz?(q1>close?red:lime) : silvertransp=00linewidth=1)
    plot(q2title="OVSar"style=circlescolor=xz?(q2>close?red:lime) : silvertransp=00linewidth=1)
    plot(q3title="UVSar"style=crosscolor=xz?(q3>close?red:lime) : silvertransp=00linewidth=1)
    //Signal
    xyzq=(q1+q2+q3)/3
    //plot(xyzq, title="TREND", style=linebr, color=xz?(y15>close?red:lime) : silver, transp=00, linewidth=2)
    //Bar Coloring
    Green close xyzq
    Red 
    close xyzq
    BarColor 
    iff(Green,lime,red)
    Buy cross(close,xyzq)
    Sell cross(xyzq,close
    barcolor(color=BarColor)
    //END
    //Signal

    xyzq0=(y1+y3+y5+y15+y30+y45+y60+y120+y180+y240+y720+q1+q2+q3+close)/14
    xyzq1
    =(y1+y3+y5+y15+y30+y45+y60+y120+y180+y240+y720+q1+q2+q3-close)/14
    xyzq12
    =(xyzq0+xyzq1)/2
    //plot(xyzq0, title="Yükseliş Trendi", style=linebr, color=xz?(y15>close?red:lime) : silver, transp=100, linewidth=2)
    //plot(xyzq1, title="DüşüşTrendi", style=linebr, color=xz?(y15>close?red:lime) : silver, transp=100, linewidth=2)
    //plot(xyzq12, title="15TrendTakip", style=linebr, color=xz?(y15>close?red:lime) : silver, transp=00, linewidth=1)

    xyzqsd=(q1+q2+q3+y15+y60+y240+y720+close)/7
    xyzq1sd
    =(q1+q2+q3+y15+y60+y240+y720-close)/7
    xyzq12sd
    =(xyzqsd+xyzq1sd)/2
    //plot(xyzqsd, title="OlasıYüksek", style=linebr, color=xz?(y15>close?red:lime) : silver, transp=100, linewidth=2)
    //plot(xyzq1sd, title="OlasıDüşük", style=linebr, color=xz?(y15>close?red:lime) : silver, transp=100, linewidth=2)
    //plot(xyzq12sd, title="AvgTime", style=linebr, color=xz?(y15>close?red:lime) : silver, transp=100, linewidth=1)
    ///////
    //@version=2
    //resolution
    x1gh=input("15"type=resolutiontitle="Resolution")

    //output functions
    zgh sar(00.11)
    z1gh sar(00.011)
    z2gh sar(00.020.2)
    z3gh sar(00.040.4)
    z4gh sar(00.060.6)
    z5gh sar(0.10.020.2)
    z6gh sar(0.10.040.4)
    z7gh sar(0.10.060.6)
    z8gh sar(0.010.020.2)
    z9gh sar(0.010.040.4)
    z10gh sar(0.010.060.6)
    // Security
    y1gh security(tickeridx1ghzgh)
    y3gh security(tickeridx1ghz1gh)
    y5gh security(tickeridx1ghz2gh)
    y15gh security(tickeridx1ghz3gh)
    y30gh security(tickeridx1ghz4gh)
    y45gh security(tickeridx1ghz5gh)
    y60gh security(tickeridx1ghz6gh)
    y120gh security(tickeridx1ghz7gh)
    y180gh security(tickeridx1ghz8gh)
    y240gh security(tickeridx1ghz9gh)
    y720gh security(tickeridx1ghz10gh)
    //Plots
    xzgh input(truetitle="Adaptive Coloring"type=bool)
    //plot(y1, title="1", style=circles, color=xz?(y1>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y3, title="3", style=circles, color=xz?(y3>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y5, title="5", style=circles, color=xz?(y5>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y15, title="15", style=circles, color=xz?(y15>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y30, title="30", style=circles, color=xz?(y30>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y45, title="45", style=circles, color=xz?(y45>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y60, title="60", style=circles, color=xz?(y60>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y120, title="120", style=circles, color=xz?(y120>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y180, title="180", style=circles, color=xz?(y180>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y240, title="240", style=circles, color=xz?(y240>close?red:lime) : silver, transp=100, linewidth=1)
    //plot(y720, title="720", style=circles, color=xz?(y720>close?red:lime) : silver, transp=100, linewidth=1)

    //Signal

    xyzqgh=(y1gh+y3gh+y5gh+y15gh+y30gh+y45gh+y60gh+y120gh+y180gh+y240gh+y720gh+close)/12
    xyzq1gh
    =(y1gh+y3gh+y5gh+y15gh+y30gh+y45gh+y60gh+y120gh+y180gh+y240gh+y720gh-close)/12
    xyzq12gh
    =(xyzqgh+xyzq1gh)/2
    //plot(xyzqgh, title="15Trend", style=line, color=xzgh?(y15gh>close?red:lime) : silver, transp=00, linewidth=1)
    //plot(xyzq1gh, title="N-Major15", style=linebr, color=xzgh?(y15gh>close?red:lime) : silver, transp=00, linewidth=2)
    //plot(xyzq12gh, title="15", style=line, color=xzgh?(y15gh>close?red:lime) : silver, transp=00, linewidth=1)

    //Fractal Reverses
    extremePast_len input(7,title="# Values to Consider for Pivot Determination, try 5-7")
    use_shading input(true,title="Use shading?")
    use_pattern_helpers input(true,title="Use Pattern Helpers (new dotted lines)?")
    use_slope_extensions input(false,title="Use Slope Extensions (old dotted lines)?")
    pattern_slope_tol input(20.0,title="Slope Tolerance for Line Continuation (x0.01%), try 20-1000")
    extremePast_len_valid extremePast_len>1?extremePast_len:2
    offset_len 
    extremePast_len_valid/// plot breaks if I take the floor here
    offset_len_floor max(floor(offset_len),1)
    minimum_ticks 20
    //up and down are true now, when the extreme occurred offset_len_floor ago. up\down are never true until after 50 ticks
    up n>minimum_ticks?(high[offset_len_floor]>=highest(high,extremePast_len_valid)):false// and (useVol?volume>=vam:true)):false
    down n>minimum_ticks?(low[offset_len_floor]<=lowest(low,extremePast_len_valid)):false// and (useVol?volume>=vam:true)):false
    //if an extreme occurred offset_len_floor ago, put it in fractalup\down now, otherwise remember last extreme
    fractalup =  up?high[offset_len_floor]:fractalup[1]
    fractaldown down?low[offset_len_floor]:fractaldown[1]

    //if an extreme occurred offset_len_floor ago, capture the n value at that time and remember it
    nUp up?n[offset_len_floor]:nz(nUp[1],n)
    nDown down?n[offset_len_floor]:nz(nDown[1],n)
    //calculate how many ticks it HAD been, offset_len_floor ago, since last extreme
    nUpAgo n>minimum_ticks?(n[offset_len_floor]-nUp):0
    nDownAgo 
    n>minimum_ticks?(n[offset_len_floor]-nDown):0

    //if extreme has occurred offset_len_floor ago, capture that extreme value once.
    tops up?fractalup:na
    bottoms 
    down?fractaldown:na
    //if an extreme occurred offset_len_floor ago, calculate rise/run
    topsSlope up?((fractalup-fractalup[nUpAgo[1]])/(nUpAgo[1]+1))://nUpAgo will already have the latest extreme's n value
    bottomsSlope down?((fractaldown-fractaldown[nDownAgo[1]])/(nDownAgo[1]+1)):0

    //if an extreme occurred offset_len_floor ago, capture the calculated slope, otherwise remember last slope
    topsLastSlope up?(topsSlope):(nz(topsLastSlope[1]))
    bottomsLastSlope down?(bottomsSlope):(nz(bottomsLastSlope[1]))

    //if an extreme occurred offset_len_floor ago, start at that extreme, otherwise, increment by slope value
    topsExtension up?fractalup:nz(topsExtension[1],high)+topsLastSlope
    bottomsExtension 
    down?fractaldown:nz(bottomsExtension[1],low)+bottomsLastSlope

    //if an extreme occurred offset_len_floor ago, find difference between new extreme and last ext val, ratio of last ext val
    topsPatternDiff up?(abs(tops-nz(topsPatternExtension[1]))/abs(nz(topsPatternExtension[1],1))):na
    bottomsPatternDiff 
    down?(abs(bottoms-nz(bottomsPatternExtension[1]))/abs(nz(bottomsPatternExtension[1],1))):na
    //and compare to tolerance ratio
    topsPatternDiffLarge up?(topsPatternDiff>abs(pattern_slope_tol/10000)):na
    bottomsPatternDiffLarge 
    down?(bottomsPatternDiff>abs(pattern_slope_tol/10000)):na

    //if an extreme occurred offset_len_floor ago far from last ext value, reset to new slope, otherwise, remember ext slope
    topsPatternSlope up?(topsPatternDiffLarge?topsSlope:nz(topsPatternSlope[1])):nz(topsPatternSlope[1])
    bottomsPatternSlope down?(bottomsPatternDiffLarge?bottomsSlope:nz(bottomsPatternSlope[1])):nz(bottomsPatternSlope[1])

    //increment to next ext val, if needed
    topsPatternExtNext nz(topsPatternExtension[1])+topsPatternSlope
    bottomsPatternExtNext 
    nz(bottomsPatternExtension[1])+bottomsPatternSlope

    //if an extreme occurred offset_len_floor ago far from last ext value, reset to new extreme, otherwise, increment last extension val
    topsPatternExtension up?(topsPatternDiffLarge?fractalup:topsPatternExtNext):(topsPatternExtNext)
    bottomsPatternExtension down?(bottomsPatternDiffLarge?fractaldown:bottomsPatternExtNext):(bottomsPatternExtNext)

    colorTops use_slope_extensions?(high[offset_len_floor]>topsExtension?color(#fcec08,00):topsExtension<bottomsExtension?color(#fcec08,00):color(#fcec08,00)):na
    colorBottoms use_slope_extensions?(low[offset_len_floor]<bottomsExtension?color(#08fce8,00):bottomsExtension>topsExtension?color(#08fce8,00):color(#08fce8,00)):na

    //bouncer = na(tops)?na(bottoms)?na:bottoms:tops
    //pbounce = plot(bouncer, "FTrend", color=blue,transp=100, linewidth=1, style=line, offset=-offset_len)
    //ptop = plot(tops, "FTop", color=lime,transp=100, linewidth=1, style=line, offset=-offset_len)
    //pbot = plot(bottoms, "FBot", color=red,transp=100, linewidth=1, style=line, offset=-offset_len)

    colorpxt use_shading?(high[offset_len_floor]>topsPatternExtension?color(#fcec08,00):topsPatternExtension<bottomsPatternExtension?color(#fcec08,00):color(#fcec08,00)):color(#000000,100)
    colorpxb use_shading?(low[offset_len_floor]<bottomsPatternExtension?color(#08fce8,00):bottomsPatternExtension>topsPatternExtension?color(#08fce8,00):color(#08fce8,00)):color(#000000,100)

    colorppt use_pattern_helpers?(high[offset_len_floor]>topsPatternExtension?color(#fcec08,00):topsPatternExtension<bottomsPatternExtension?color(#fcec08,00):color(#fcec08,00)):color(#000000,100)
    colorppb use_pattern_helpers?(low[offset_len_floor]<bottomsPatternExtension?color(#08fce8,00):topsPatternExtension<bottomsPatternExtension?color(#08fce8,00):color(#08fce8,00)):color(#000000,100)

    pxtPatt plot(topsPatternExtension,color=colorppt,style=linebr,linewidth=1,offset=-offset_len)
    pxbPatt plot(bottomsPatternExtension,color=colorppb,style=linebr,linewidth=1,offset=-offset_len)
    // 
    16.07.2024 - 10.12.2024

  5. PHP Code:
     // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © carefulCode53358
    //@version=5
    indicator("."overlay true)
    ehad input(truetitle='Renklendirme')
    /////verisi hesaplanacak sar değerleridir........
    xc1=ta.sar(0.001,0.010.1)
    xc2=ta.sar(0.001,0.020.2)
    xc3=ta.sar(0.001,0.030.3)
    //hesaplanan veriyi zaman döngüsüne aktarma.....
    fatiha xc1
    kadir 
    xc2
    velasr 
    xc3
    /////tüm zaman döngülerinin tanımı.....1-5-15-60 periyotları için....
    bakara input.timeframe('1'title='Periyot')
    aliimran input.timeframe('5'title='Periyot')
    nisa input.timeframe('15'title='Periyot')
    maide input.timeframe('60'title='Periyot')
    //  1 veriyi zaman döngüsünde hesaplatma...
    isra request.security(syminfo.tickeridbakarafatiha)
    kehf request.security(syminfo.tickeridaliimranfatiha)
    meryem request.security(syminfo.tickeridnisafatiha)
    taha request.security(syminfo.tickeridmaidefatiha)
    //1. veriyi hesaplayan sistem.....
    tegabun = (isra 
    //plot(tegabun, title='1', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    talak = (isra kehf    ) / 2
    //plot(talak, title='5', style=plot.style_stepline, color=ehad ? kehf > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    tahrim = (isra kehf meryem   ) / 3
    //plot(tahrim, title='15', style=plot.style_stepline, color=ehad ? meryem > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    mulk = (isra kehf meryem taha  ) / 4
    //plot(mulk, title='60', style=plot.style_stepline, color=ehad ? taha > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)

    // 2.veriyi zamanda döndürme
    secde request.security(syminfo.tickeridbakarakadir)
    ahzab request.security(syminfo.tickeridaliimrankadir)
    sebe request.security(syminfo.tickeridnisakadir)
    fatir request.security(syminfo.tickeridmaidekadir)
    ///2veriyi hesaplayan sistem....
    muzzemmil = (secde 
    //plot(muzzemmil, title='2-1', style=plot.style_stepline, color=ehad ? secde > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    muddesir = (secde+ahzab ) / 2
    //plot(muddesir, title='2-5', style=plot.style_stepline, color=ehad ? ahzab > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    kiyamet = (secde+ahzab+sebe ) / 3
    //plot(kiyamet, title='2-15', style=plot.style_stepline, color=ehad ? sebe > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    insan = (secde+ahzab+sebe+fatir) / 4
    //plot(insan, title='2-60', style=plot.style_stepline, color=ehad ? fatir > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)

    // Security3.veriyi zamanda döndürme...
    fetih request.security(syminfo.tickeridbakaravelasr)
    hucurat request.security(syminfo.tickeridaliimranvelasr)
    kaf request.security(syminfo.tickeridnisavelasr)
    zariyat request.security(syminfo.tickeridmaidevelasr)
    /////3.veriyi döngüsel hesaplayan sistem....
    infitar = (fetih 
    //plot(infitar, title='3-1', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    mutaffifin = (fetih+hucurat) /2
    //plot(mutaffifin, title='3-5', style=plot.style_stepline, color=ehad ? hucurat > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    insikak = (fetih+hucurat+kaf ) /3
    //plot(insikak, title='3-15', style=plot.style_stepline, color=ehad ? kaf > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    buruc = (fetih+hucurat+kaf+zariyat ) /4
    //plot(buruc, title='3-60', style=plot.style_stepline, color=ehad ? zariyat > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)

    //3 verinin 1-5-15-ve 60 dakikalık olarak ortalamasını hesaplayan sistem...
    sems = (tegabun+muzzemmil+infitar ) /3
    //plot(sems, title='1', style=plot.style_stepline, color=ehad ? sems > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    leyl = (talak+muddesir+mutaffifin ) /3
    //plot(leyl, title='5', style=plot.style_stepline, color=ehad ? leyl > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    duha = (tahrim+kiyamet+insikak ) /3
    //plot(duha, title='15', style=plot.style_stepline, color=ehad ? duha > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    insirah = (mulk+insan+buruc ) /3
    //plot(insirah, title='60', style=plot.style_stepline, color=ehad ? insirah > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    //3 verinin hesaplamasını....kendi içinde.... döngüleyen sistem.....
    kevser = (sems+leyl ) /2
    //plot(kevser, title='5Döngü', style=plot.style_stepline, color=ehad ? kevser > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    kafirun = (sems+leyl+duha ) /3
    //plot(kafirun, title='15Döngü', style=plot.style_stepline, color=ehad ? kafirun > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
    nasr = (sems+leyl+duha+insirah ) /4
    plot
    (nasrtitle='SaatDöngü'style=plot.style_steplinecolor=ehad nasr close color.rgb(2558282100) : color.rgb(0230119100) : color.silverlinewidth=2)
    // 3 dakikalık sar hesaplaması ile bar renklendirmedir.....
    fatiha1 input.timeframe('5'title='yörük')
    bakara1 ta.sar(0.0010.030.3)
    kuran1 request.security(syminfo.tickeridfatiha1bakara1)
    vallahualem=(kuran1)
    //plot(vallahualem, title='yörük', style=plot.style_stepline, color=ehad ? vallahualem > close ? color.rgb(250, 2, 2) : color.rgb(62, 253, 3) : color.rgb(178, 181, 190, 100), linewidth=2)
    //bcolor = ta.crossunder(close,vallahualem) ? color.rgb(248, 4, 4) :  ta.crossover(vallahualem,close) ? color.rgb(4, 248, 12): close>vallahualem ? color.rgb(5, 245, 13) : close<vallahualem ? color.rgb(250, 2, 2): color.rgb(236, 253, 4) // : color.black 
    //barcolor(bcolor)
    //vurkaç hareketler için.....hesaplatılan sar sistemisidir....1 dakikalıkta kullanılacaktır....
    x1 input.timeframe('1'title='vurkaç')
    ta.sar(00.11)
    y1 request.security(syminfo.tickeridx1z)
    q3 ta.sar(0.0010.010.1)
    q2 ta.sar(0.0010.020.2)
    q1 ta.sar(0.0010.030.3)
    //plot(q3, title='UV-Sar', style=plot.style_circles, color=ehad ? q3 > close ? color.rgb(229, 2, 250) : color.rgb(250, 225, 3) : color.silver, linewidth=1)
    //plot(q2, title='OV-Sar', style=plot.style_circles, color=ehad ? q2 > close ? color.rgb(229, 2, 250) : color.rgb(250, 225, 3) : color.silver, linewidth=1)
    //plot(q1, title='KV-Sar', style=plot.style_circles, color=ehad ? q1 > close ? color.rgb(229, 2, 250) : color.rgb(250, 225, 3) : color.silver, linewidth=1)
    //End
    //Trend Sar
    psar(start1inc1maximum1) =>
        
    out1 float(na)
        
    isUpTrend1 bool(na)
        
    maxMin1 float(na)
        
    acc1 float(na)
        
    prev1 float(na)

        if 
    bar_index >= 1
            prev1 
    := out1[1]
            if 
    bar_index == 1
                
    if close close[1]
                    
    isUpTrend1 := true
                    maxMin1 
    := math.max(highhigh[1])
                    
    prev1 := math.min(lowlow[1])
                    
    prev1
                
    else
                    
    isUpTrend1 := false
                    maxMin1 
    := math.min(lowlow[1])
                    
    prev1 := math.max(highhigh[1])
                    
    prev1

                acc1 
    := start1
                acc1
            
    else
                
    isUpTrend1 := isUpTrend1[1]
                
    acc1 := acc1[1]
                
    maxMin1 := maxMin1[1]
                
    maxMin1

            
    if isUpTrend1
                
    if high maxMin1
                    maxMin1 
    := high
                    acc1 
    := math.min(acc1 inc1maximum1)
                    
    acc1
            
    else
                if 
    low maxMin1
                    maxMin1 
    := low
                    acc1 
    := math.min(acc1 inc1maximum1)
                    
    acc1

            
    if na(out1)
                
    out1 := prev1 acc1 * (maxMin1 prev1)
                
    out1

            
    if isUpTrend1
                
    if low <= out1
                    isUpTrend1 
    := false
                    out1 
    := maxMin1
                    maxMin1 
    := low
                    acc1 
    := start1
                    acc1
            
    else
                if 
    high >= out1
                    isUpTrend1 
    := true
                    out1 
    := maxMin1
                    maxMin1 
    := high
                    acc1 
    := start1
                    acc1

            
    if na(out1)
                if 
    isUpTrend1
                    out1 
    := math.min(out1bar_index == low[1] : math.min(low[1], low[2]))
                    
    out1
                
    else
                    
    out1 := math.max(out1bar_index == high[1] : math.max(high[1], high[2]))
                    
    out1

        
    [out1acc1maxMin1isUpTrend1]


    start1 input(0)
    increment1 input(0.01)
    maximum1 input(0.1)
    [
    p1AF1EP1isUpTrend1] = psar(start1increment1maximum1)

    newEP1 EP1 != EP1[1]
    epNew1 newEP1 EP1 na


    //plot(p1, 'Trend', style=plot.style_stepline, color=isUpTrend1 ? color.rgb(25, 248, 5, 100) : color.rgb(243, 5, 5, 100), linewidth=1)
    //plot(EP1, 'Trend-Devam', style=plot.style_circles, color=isUpTrend1 ? color.rgb(25, 248, 5, 100) : color.rgb(243, 5, 5, 100), linewidth=2)
    //plot(epNew1, 'Trend-Continue', style=plot.style_line, color=isUpTrend1 ? color.rgb(76, 175, 79, 00) : color.rgb(255, 82, 82, 00), linewidth=1) 
    16.07.2024 - 10.12.2024

  6. PHP Code:
     // This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
    // © LuxAlgo

    //@version=5
    indicator('Parallel Pivot Lines [LuxAlgo]'overlay=truemax_bars_back=1000)
    //Basic
    length input.int(2group='Basic Settings'tooltip='Pivot length. Use higher values for having lines connected to more significant pivots')
    lookback input.int(2minval=1group='Basic Settings'tooltip='Number of lines connecting a pivot high/low to display')
    Slope input.float(0.5minval=-1maxval=1step=0.1group='Basic Settings'tooltip='Allows to multiply the linear regression slope by a number within -1 and 1')

    //Style
    ph_col input.color(#2157f3, 'Pivot High Lines Color', group='Line Colors')
    pl_col input.color(#ff1100, 'Pivot Low Lines Color', group='Line Colors')

    //──────────────────────────────────────────────────────────────────────────────
    Sma(srcp) =>
        
    ta.cum(src)
        (
    a[math.max(p0)]) / math.max(p0)
    Variance(srcp) =>
        
    == Sma(src srcp) - math.pow(Sma(srcp), 2)
    Covariance(xyp) =>
        
    Sma(yp) - Sma(xp) * Sma(yp)
    //──────────────────────────────────────────────────────────────────────────────
    bar_index
    ph 
    ta.pivothigh(lengthlength)
    pl ta.pivotlow(lengthlength)
    //──────────────────────────────────────────────────────────────────────────────
    varip ph_array = array.new_float(0)
    varip pl_array = array.new_float(0)
    varip ph_n_array = array.new_int(0)
    varip pl_n_array = array.new_int(0)
    if 
    ph
        
    array.insert(ph_array0ph)
        array.
    insert(ph_n_array0n)
    if 
    pl
        
    array.insert(pl_array0pl)
        array.
    insert(pl_n_array0n)
    //──────────────────────────────────────────────────────────────────────────────
    val_ph ta.valuewhen(phlengthlookback 1)
    val_pl ta.valuewhen(pllengthlookback 1)
    val math.min(val_phval_pl)
    val val 2
    slope 
    Covariance(closenk) / Variance(nk) * Slope
    var line ph_l na
    var line pl_l na
    if barstate.islast
        
    for 0 to lookback 1 by 1
            ph_y2 
    = array.get(ph_arrayi)
            
    ph_x1 = array.get(ph_n_arrayi) - length
            pl_y2 
    = array.get(pl_arrayi)
            
    pl_x1 = array.get(pl_n_arrayi) - length
            ph_l 
    := line.new(ph_x1ph_y2ph_x1 1ph_y2 slopeextend=extend.rightcolor=ph_col)
            
    pl_l := line.new(pl_x1pl_y2pl_x1 1pl_y2 slopeextend=extend.rightcolor=pl_col)
            
    pl_l 
    16.07.2024 - 10.12.2024

  7. PHP Code:
     // This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
    // © LuxAlgo

    //@version=5
    indicator("Pivot Based Trailing Maxima & Minima [LuxAlgo]""c"overlay truemax_bars_back 500max_lines_count 500)
    //------------------------------------------------------------------------------
    //Settings
    //-----------------------------------------------------------------------------{
    length input.int(2minval 1maxval 50)
    backpaint input(falsetooltip 'Backpainting offset displayed elements in the past. Disable backpainting to see real time information returned by the indicator.')

    //Style
    maxCss input.color(color.rgb(222222100), 'Trailing Maximum Color'group 'Style')
    minCss input.color(color.rgb(222222100) , 'Trailing Minimum Color'group 'Style')
    avgCss input.color(color.new(color.fuchsia,100)   , 'Trailing Maximum Color'group 'Style')

    bullFill input.color(color.new(color.teal,80), 'Uptrend Area'  group 'Style')
    bearFill input.color(color.new(color.red,80) , 'Downtrend Area'group 'Style')

    //-----------------------------------------------------------------------------}
    //Calculation
    //-----------------------------------------------------------------------------{
    var float max na
    var float min na
    var offset backpaint length 0

    ph 
    ta.pivothigh(lengthlength)
    pl ta.pivotlow(lengthlength)

    if 
    ph or pl
        max 
    := high[length]
        
    min := low[length]

    max := math.max(high[offset], max)
    min := math.min(low[offset], min)

    avg math.avg(max,min)

    //-----------------------------------------------------------------------------}
    //Non offset trailing max/min
    //-----------------------------------------------------------------------------{
    bar_index

    max_prev 
    max
    min_prev 
    min
    avg_prev 
    avg
    max2 
    max
    min2 
    min

    fill_css 
    fixnan(ph bearFill pl bullFill na)

    if 
    barstate.islast and backpaint
        
    //Delete previously set lines
        
    for line_object in line.all
            line
    .delete(line_object)

        
    //Loop trough calculation window
        
    for 0 to length-1
            max2 
    := math.max(high[length-1-i], max_prev)
            
    min2 := math.min(low[length-1-i], min_prev)
            
    avg2 math.avg(max2min2)
            
            
    //Set lines
            
    line1 line.new(n-(length-i), max_prevn-(length-1-i), max2colormaxCss)
            
    line2 line.new(n-(length-i), min_prevn-(length-1-i), min2colorminCss)
            
    linefill.new(line1,line2,color.new(fill_css80))

            
    line.new(n-(length-i), avg_prevn-(length-1-i), avg2coloravgCss)
            
            
    max_prev := max2
            min_prev 
    := min2
            avg_prev 
    := avg2

    //-----------------------------------------------------------------------------}
    //Plots
    //-----------------------------------------------------------------------------{
    plot1 plot(max'max'
      
    ph or pl na maxCss
      
    1
      
    plot.style_linebr
      
    offset = -offset)

    plot2 plot(min'min'
      
    ph or pl na minCss
      
    1
      
    plot.style_linebr
      
    offset = -offset)

    plot(avg'ort'
      
    ph or pl na avgCss
      
    1
      
    plot.style_linebr
      
    offset = -offset)

    fill(plot1plot2ph or pl na fill_css
    16.07.2024 - 10.12.2024

  8. PHP Code:
     // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © aksharmty

    //@version=5
    indicator('Pivot Crossover'shorttitle='Pivot Crossover'overlay=true)
    pivet2 = (close[2] + low[2] + high[2]) / 3
    plot
    (pivet2color=color.new(color.yellow0), title='2nd last bar pivet'linewidth=4)
    pivet1 = (close[1] + low[1] + high[1]) / 3

    orc 
    pivet2 pivet1 color.green color.red
    plot
    (pivet1color=orctitle='last bar pivet'linewidth=4)
    pivet = (close[0] + low[0] + high[0]) / 3
    plot
    (pivetcolor=color.new(color.white0), title='current bar pivet'linewidth=4
    16.07.2024 - 10.12.2024

Sayfa 260/352 İlkİlk ... 160210250258259260261262270310 ... 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
  •