Sayfa 254/293 İlkİlk ... 154204244252253254255256264 ... SonSon
Arama sonucu : 2344 madde; 2,025 - 2,032 arası.

Konu: Tradingview

  1. teknikle ilgilenen arkadaşlar.....

    teknik tasarım...sistem ya da vb.....

    ilk olarak....yatırım yapacağınız süreyi belirleyin.... diyelim ki...3 aylık periyotlar olsun...

    ikinci olarak.....kullanacağınız grafiğin periyodunu belirleyin.... diyelim ki saatlik olsun...

    üçüncü olarak....döngü tasarlayın.... yazdığım gibi hareket edecek kişi....
    döngüsüne h-h4 ve gün hesaplatıp.... döngü kullanmalı....

    son olarak ise...
    en iyi kullandığınız...indikatör v.b neyse...
    onun verisini alarak....döngüyü başlatın ve strateji...sinyali ona göre ayarlayın....

    örneğin bu görüntü....
    başkara hocam ile benim döngünün beraber hali....
    https://www.tradingview.com/x/Yn7Xo3Un/

    eğer ben başkaranın kodunu döngüye alsaydım....
    görüntü.....https://www.tradingview.com/x/rNzSZkrR/
    https://www.tradingview.com/x/IdmqF49E/
    https://www.tradingview.com/x/VOsZemA9/
    16.07.2024 - 10.12.2024

  2. https://www.tradingview.com/x/wajUAKim/
    başkara hocanın kod değerlerinde oynanması ve volalite trend ile ilişkilendirilmesi sonucu ortaya çıkan görüntü....

    kombine edilmiş kod...denemek isteyenlere...

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

    src input(hlc3title="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(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(5title="Z1")
    Z2 input.float(5title="Z2")
    Z3 Z2/100
    Z4 
    ta.ema(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/1.025+1.50)*1.025color=color.greenlinewidth=1,title="Direnç")
    Z5pl=plot(int(Z5/1.025+1.50)*1.025color=color.redlinewidth=1,title="Destek")
    //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)

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

    // ~~ 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(20title="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 natitle="Trend "color=colorForPlot)
    plotUpper   plot(isTrendConsistent upperBand natitle="Trend+"color color.new(color.black100))
    plotLower   plot(isTrendConsistent lowerBand natitle="Trend-"color color.new(color.black100))

    fill(plotUpperplotTrendtop_color colorForLowerBandbottom_color =color.new(na,100), top_value upperBandbottom_value currentTrendtitle="Background Upper")
    fill(plotTrendplotLowertop_color color.new(na,100), bottom_color colorForUpperBandtop_value currentTrendbottom_value lowerBandtitle="Background Lower")
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~} 
    değerler oynandığı için....
    kısa periyotlar tercihi...1-5-15 dakkalık daha stabilite sonuçlar veriri....
    16.07.2024 - 10.12.2024

  3. sar trend hesaplaması ve 15 dakkalık periyoda göre bar renklendirme örneği....
    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)

    //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)



    x1 input.timeframe('15'title='Resolution')
    ta.sar(00.010.02)
    // Security
    y1 request.security(syminfo.tickeridx1z)
    //Plots
    xz input(truetitle='Adaptive Coloring')
    //Functions Sar for support and resistance
    q3 ta.sar(0.0010.010.1)
    q2 ta.sar(0.0010.030.3)
    q1 ta.sar(0.0010.050.5)
    plot(q3title='UV-Sar'style=plot.style_circlescolor=xz y1 close color.rgb(2250238) : color.rgb(2502253) : color.silverlinewidth=1)
    plot(q2title='OV-Sar'style=plot.style_circlescolor=xz y1 close color.rgb(2250238) : color.rgb(2502253) : color.silverlinewidth=1)
    plot(q1title='KV-Sar'style=plot.style_circlescolor=xz y1 close color.rgb(2250238) : color.rgb(2502253) : color.silverlinewidth=1)

    //END
    bcolor ta.crossunder(close,q3) ? color.red :  ta.crossover(close,q3) ? color.greenclose>q2 color.green close<q2 color.redcolor.rgb(2164253// : color.black 
    barcolor(bcolor
    16.07.2024 - 10.12.2024

  4. belirleyeceğiniz üç adet sar değerini.....
    dilediğiniz periyot için... hesaplar...
    örnek...1dakkalık için.... 15 dakkalıkta görüntü... https://www.tradingview.com/x/HWs1Pr0O/

    bu da kodu denemek isteyenlere....
    PHP Code:
     //@version=5
    // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © carefulCode53358

    indicator('*'overlay=true)
    //resolution
    x1 input.timeframe('1'title='Resolution')
    //output functions
    ta.sar(00.020.02)
    // Security
    y1 request.security(syminfo.tickeridx1z)
    //Plots
    xz input(truetitle='Adaptive Coloring')
    //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(q3title='SlowSar'style=plot.style_circlescolor=xz y1 close color.red color.lime color.silverlinewidth=1)
    plot(q2title='AvgSar'style=plot.style_circlescolor=xz y1 close color.red color.lime color.silverlinewidth=1)
    plot(q1title='FastSar'style=plot.style_circlescolor=xz y1 close color.red color.lime color.silverlinewidth=1)
    //Signal
    xyzq = (y1
    plot(xyzqtitle='Yörük'style=plot.style_linebrcolor=xz y1 close color.rgb(255828200) : color.rgb(023011900) : color.silverlinewidth=1
    16.07.2024 - 10.12.2024

  5. yukardaki örnek...volalite tren ile ilşkilendiğinde.....
    denemek isteyene örnek....
    PHP Code:
     //yörükten...başkaraya selamlarla......
    //@version=5
    indicator("."overlay true)

    src 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(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(5title="Z1")
    Z2 input.float(5title="Z2")
    Z3 Z2/100
    Z4 
    ta.ema(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/1.025+1.50)*1.025color=color.greenlinewidth=1,title="Direnç")
    Z5pl=plot(int(Z5/1.025+1.50)*1.025color=color.redlinewidth=1,title="Destek")
    //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)

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

    // ~~ 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(20title="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 natitle="VTrend "color=colorForPlot)
    plotUpper   plot(isTrendConsistent upperBand natitle="VDirenç"color color.new(color.black100))
    plotLower   plot(isTrendConsistent lowerBand natitle="VDestek"color color.new(color.black100))

    //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(q3title='UVSar'style=plot.style_circlescolor=xz y1 close color.red color.lime color.silverlinewidth=1)
    plot(q2title='OVSar'style=plot.style_circlescolor=xz y1 close color.red color.lime color.silverlinewidth=1)
    plot(q1title='KVSar'style=plot.style_circlescolor=xz y1 close color.red color.lime color.silverlinewidth=1)
    //Signal
    xyzq = (y1
    plot(xyzqtitle='Yörük'style=plot.style_linebrcolor=xz y1 close color.rgb(255828200) : color.rgb(023011900) : color.silverlinewidth=1)


    bcolor ta.crossunder(close,q3) ? color.red :  ta.crossover(close,q3) ? color.greenclose>q2 color.green close<q2 color.redcolor.rgb(2164253// : color.black 
    barcolor(bcolor
    https://www.tradingview.com/x/Uu09kCfD/
    16.07.2024 - 10.12.2024

  6. macd indikatörünü bir dakikalık fiyat olarak okutmaya örnek....
    https://www.tradingview.com/x/RuLFSxpm/
    denemek isteyene kodu....

    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)
    //Trend Sar

    //END
    //Function 
    inp input(title='Source'defval=close)
    res input.timeframe(title='Resolution'defval='1')
    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.lime sig1 color.lime sig1 < -color.red sig1 color.red color.white

    plot
    (pMacdEq1title='MacdTrend',style=plot.style_steplinecolor=rmacdColorlinewidth=2)
    plot(pMacdEqSig1title='MacdStop'color=color.rgb(25525525500), linewidth=1)
    /////////////////////////////////////////////////////////////////////////// 
    16.07.2024 - 10.12.2024

  7. üstte kalan volalite trend....sar trendin.... saatlik macd ile ilişkilendirilmesi örneği....
    denemek isteyene kodu....https://www.tradingview.com/x/rahMPWrF/
    PHP Code:
     //yörükten...başkaraya selamlarla......
    //@version=5
    indicator("."overlay true)

    src 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(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(5title="Z1")
    Z2 input.float(5title="Z2")
    Z3 Z2/100
    Z4 
    ta.ema(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/1.025+1.50)*1.025color=color.greenlinewidth=1,title="Direnç")
    Z5pl=plot(int(Z5/1.025+1.50)*1.025color=color.redlinewidth=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(20title="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 natitle="VTrend "color=colorForPlot)
    plotUpper   plot(isTrendConsistent upperBand natitle="VDirenç"color color.new(color.black100))
    plotLower   plot(isTrendConsistent lowerBand natitle="VDestek"color color.new(color.black100))

    //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(q3title='UVSar'style=plot.style_circlescolor=xz y1 close color.red color.lime color.silverlinewidth=1)
    plot(q2title='OVSar'style=plot.style_circlescolor=xz y1 close color.red color.lime color.silverlinewidth=1)
    plot(q1title='KVSar'style=plot.style_circlescolor=xz y1 close color.red color.lime color.silverlinewidth=1)
    //Signal
    xyzq = (y1
    plot(xyzqtitle='Yörük'style=plot.style_linebrcolor=xz y1 close color.rgb(255828200) : color.rgb(023011900) : color.silverlinewidth=1)


    bcolor ta.crossunder(close,q3) ? color.red :  ta.crossover(close,q3) ? color.greenclose>q2 color.green close<q2 color.redcolor.rgb(2164253// : 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
    (pMacdEq1title='MacdTrend',style=plot.style_steplinecolor=rmacdColorlinewidth=2)
    plot(pMacdEqSig1title='MacdStop'color=color.rgb(255255255100), linewidth=1)
    /////////////////////////////////////////////////////////////////////////// 
    16.07.2024 - 10.12.2024

  8. aynı periyotlu....farklı değerli....2 psarı....döngüleme örneği....
    denemek isteyene kod....
    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("Sar döngü"overlay true)

    //END
    //Function Sar; slow-avarage-fast

    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(255828200) : color.rgb(761757900)
    plot(s1sx20title="SAR Slow",style=plot.style_linecolor=pcsx20linewidth=1)

    startsx50 0
    incrementsx50 
    0.1
    maximumsx50 
    1
    ssx50 
    ta.sar(startsx50incrementsx50maximumsx50)
    s1sx50 z50(ssx50lenxc50)
    pcsx50 close s1sx50 color.rgb(255828200) : color.rgb(761757900)
    plot(s1sx50title="SAR Fast",style=plot.style_linecolor=pcsx50linewidth=1
    16.07.2024 - 10.12.2024

Sayfa 254/293 İlkİlk ... 154204244252253254255256264 ... 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
  •