Sayfa 229/276 İlkİlk ... 129179219227228229230231239 ... SonSon
Arama sonucu : 2208 madde; 1,825 - 1,832 arası.

Konu: Tradingview

  1.  Alıntı Originally Posted by @yörük@ Yazıyı Oku
    kodları....
    isteyene göndereyim demiştim...

    lakin...
    tasarımı kendime göre yapınca...

    agresif oldu....

    yani....kısa 1...orta 5.....uzun 15 dakkalık periyot....
    full (ortalama 1000k) giriş...vurkaç mantığıyla....

    yani yatırım amaçlı değil.....

    bu yüzden...
    yukardaki mesajlara kodun bütününün parçalarını koydum....

    herkes kendi anlayışına göre düzenlemeli.....
    kodun tasarım hali görüntüsü......https://www.tradingview.com/x/z70FCfiO/

    plotlar iptal edilmiş şekilde....
    79 kod parçacığının birleşmiş hali......

    ham halini kullanmak isteyenler için....
    kendilerine göre plot düzenlemeleri ve ortalama ayarlamak isteyenler için....

    birleştirilmiş hali....

    PHP Code:
     //@version=5
    indicator('*'max_bars_back=500overlay=true)
    ////////////////////Ana Kalıp/////////////////////////
    inp input(title='Source'defval=close)
    res input.timeframe(title='Resolution'defval='')
    rep input(title='Allow Repainting?'defval=false)
    ///////////////////////Fiyat üzerinde macd hesaplamasıdır///////////////////////////////
    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(761757900) : sig1 color.rgb(761757900) : sig1 < -color.rgb(255828200) : sig1 color.rgb(255828200) : color.rgb(255255255100)

    /////////////////////////////////////////////////////////////////////////////////
    src2 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length2 input.int(title='Length'defval=20minval=1)
    gainLimit2 input.int(title='GainLimit'defval=50minval=1)

    alpha2 / (length2 1)
    ema2 0.0
    ema2 
    := alpha2 src2 + (alpha2) * nz(ema2[1])

    leastError2 1000000.0
    ecEma2 
    0.0
    error2 
    0.0
    bestGain2 
    0.0
    for int i = -gainLimit2 to gainLimit2 by 1
        gain2 
    10
        ecEma2 
    := alpha2 * (ema2 gain2 * (src2 nz(ecEma2[1]))) + (alpha2) * nz(ecEma2[1])
        
    error2 := src2 ecEma2

        
    if math.abs(error2) < leastError2
            leastError2 
    := math.abs(error2)
            
    bestGain2 := gain2
            bestGain2
    ecEma2 
    := alpha2 * (ema2bestGain2 * (src2 nz(ecEma2[1]))) + (alpha2) * nz(ecEma2[1])

    slo2 src2 ecEma2
    sig2 
    slo2 slo2 nz(slo2[1]) ? slo2 slo2 nz(slo2[1]) ? -: -0
    /////////////////////////////////////////////////////////
    src3 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length3 input.int(title='Length'defval=12minval=1)
    rmsLength3 input.int(title='RMSLength'defval=50minval=1)

    mom3 src3 nz(src3[length3])
    hannLength3 math.ceil(length3 1.4)
    filt3 0.0
    coef3 
    0.0
    for 1 to hannLength3 by 1
        cos3 
    math.cos(math.pi / (hannLength3 1))
        
    filt3 += cos3 nz(mom3[1])
        
    coef3 += cos3
        coef3
    hFilt3 
    coef3 != filt3 coef3 0

    filtMa3 
    math.sum(math.pow(hFilt32), rmsLength3) / rmsLength3
    rms3 
    filtMa3 math.sqrt(filtMa3) : 0
    scaledFilt3 
    rms3 != hFilt3 rms3 0

    a13 
    math.exp(-1.414 math.pi math.abs(scaledFilt3) / length3)
    b13 a13 math.cos(1.414 math.pi math.abs(scaledFilt3) / length3)
    c23 b13
    c33 
    = -a13 a13
    c13 
    c23 c33

    dsss3 
    0.0
    dsss3 
    := c13 * ((src3 nz(src3[1])) / 2) + c23 nz(dsss3[1]) + c33 nz(dsss3[2])

    slo3 src3 dsss3
    sig3 
    slo3 slo3 nz(slo3[1]) ? slo3 slo3 nz(slo3[1]) ? -: -0
    ///////////////////////////////////////////////////////////
    src4 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length4 input.int(title='Length'defval=27minval=1)

    a14 math.exp(-1.414 math.pi length4)
    b14 a14 math.cos(1.414 math.pi length4)
    c24 b14
    c34 
    = -a14 a14
    c14 
    c24 c34

    ssf4 
    0.0
    ssf4 
    := bar_index src4 0.5 c14 * (src4 nz(src4[1])) + c24 nz(ssf4[1]) + c34 nz(ssf4[2])

    e14 0.0
    e14 
    := bar_index c14 * (src4 ssf4) + c24 nz(e14[1]) + c34 nz(e14[2])
    aef4 ssf4 e14

    slo4 
    src4 nz(aef4[1])
    sig4 slo4 slo4 nz(slo4[1]) ? slo4 slo4 nz(slo4[1]) ? -: -0

    //////////////////////////////////////////////////////////////////////////////////
    src5 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    acc5 input.float(title='Accelerator'defval=1.0minval=1.0step=0.01)
    minLength5 input.int(title='MinLength'defval=5minval=1)
    maxLength5 input.int(title='MaxLength'defval=50minval=1)
    smoothLength5 input.int(title='SmoothLength'defval=4minval=1)
    mult5 input.float(title='Multiple'defval=2.0minval=.01)

    mean5 ta.sma(src5maxLength5)
    stdDev5 ta.stdev(src5maxLength5)
    a5 mean5 1.75 stdDev5
    b5 
    mean5 0.25 stdDev5
    c5 
    mean5 0.25 stdDev5
    d5 
    mean5 1.75 stdDev5

    length5 
    0.0
    length5 
    := src5 >= b5 and src5 <= c5 nz(length5[1], maxLength5) + src5 a5 or src5 d5 nz(length5[1], maxLength5) - nz(length5[1], maxLength5)
    length5 := math.max(math.min(length5maxLength5), minLength5)
    len5 math.round(length5)

    mf5 na(volume) or volume == 100.0 100.0 / (1.0 src5 len5) : ta.mfi(src5len5)
    mfScaled5 mf5 100
    p5 
    acc5 math.abs(mfScaled5) / 25

    sum5 
    0.0
    weightSum5 
    0.0
    for 0 to len5 1 by 1
        weight5 
    math.pow(len5 ip5)
        
    sum5 += src5[i] * weight5
        weightSum5 
    += weight5
        weightSum5
    uma5 
    ta.wma(sum5 weightSum5smoothLength5)

    stdev55 ta.stdev(src5len5)
    upperBand5 uma5 stdev55 mult5
    lowerBand5 
    uma5 stdev55 mult5

    slo5 
    src5 uma5
    sig5 
    src5 upperBand5 and nz(src5[1]) <= nz(upperBand5[1]) or src5 lowerBand5 and nz(src5[1]) <= nz(lowerBand5[1]) ? src5 lowerBand5 and nz(src5[1]) >= nz(lowerBand5[1]) or src5 upperBand5 and nz(src5[1]) >= nz(upperBand5[1]) ? -slo5 slo5 nz(slo5[1]) ? slo5slo5 nz(slo5[1]) ? -: -0

    //////////////////////////////////////////////////////////////////////////////////
    src6 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    acc6 input.float(title='Accelerator'defval=1.0minval=1.0step=0.01)
    minLength6 input.int(title='MinLength'defval=5minval=1)
    maxLength6 input.int(title='MaxLength'defval=50minval=1)
    smoothLength6 input.int(title='SmoothLength'defval=4minval=1)

    mean6 ta.sma(src6maxLength6)
    stdDev6 ta.stdev(src6maxLength6)
    a6 mean6 1.75 stdDev6
    b6 
    mean6 0.25 stdDev6
    c6 
    mean6 0.25 stdDev6
    d6 
    mean6 1.75 stdDev6

    length6 
    0.0
    length6 
    := src6 >= b6 and src6 <= c6 nz(length6[1], maxLength6) + src6 a6 or src6 d6 nz(length6[1], maxLength6) - nz(length6[1], maxLength6)
    length6 := math.max(math.min(length6maxLength6), minLength6)
    len6 math.round(length6)

    mf6 na(volume) or volume == 100.0 100.0 / (1.0 src6 len6) : ta.mfi(src6len6)
    mfScaled6 mf6 100
    p6 
    acc6 math.abs(mfScaled6) / 25

    sum6 
    0.0
    weightSum6 
    0.0
    for 0 to len6 1 by 1
        weight6 
    math.pow(len6 ip6)
        
    sum6 += src6[i] * weight6
        weightSum6 
    += weight6
        weightSum6
    uma6 
    ta.wma(sum6 weightSum6smoothLength6)

    slo6 src6 uma6
    sig6 
    slo6 slo6 nz(slo6[1]) ? slo6 slo6 nz(slo6[1]) ? -: -0
    //////////////////////////////////////////////////////////
    src7 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length7 input.int(title='Length'defval=15minval=1)

    ma7 ta.sma(src7length7)
    a7 ta.linreg(src7length70)
    m7 a7 nz(a7[1]) + ma7
    ie27 
    = (m7 a7) / 2

    slo7 
    src7 ie27
    sig7 
    slo7 slo7 nz(slo7[1]) ? slo7 slo7 nz(slo7[1]) ? -: -0

    //////////////////////////////////////////////////////////////////////////////////
    src8 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length8 input(title='Length'defval=14)

    sum8 0.0
    weightSum8 
    0.0
    for 0 to length8 1 by 1
        weight8 
    math.pow(length8 i3)
        
    sum8 += src8[i] * weight8
        weightSum8 
    += weight8
        weightSum8
    cwma8 
    sum8 weightSum8

    sig8 
    src8 cwma8 src8 cwma8 ? -0
    ////////////////////////////////////////////////////////////
    src9 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length9 input.int(title='Length'defval=15minval=1)

    pi9 math.asin(1)
    a9 math.exp(-1.414 pi9 length9)
    b9 a9 math.cos(1.414 pi9 length9)
    c29 b9
    c39 
    = -a9 a9
    c19 
    = (b9 math.pow(a92)) / 4

    bf9 
    0.0
    bf9 
    := bar_index src9 c19 * (src9 nz(src9[1]) + nz(src9[2])) + c29 nz(bf9[1]) + c39 nz(bf9[2])

    sig9 src9 bf9 src9 bf9 ? -0
    ///////////////////////////////////////////////////////
    src10 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length10 input.int(title='Length'defval=10minval=1)

    pi10 math.asin(1)
    a10 math.exp(-1.414 pi10 length10)
    b10 a10 math.cos(1.414 1.25 pi10 length10)
    c210 b10
    c310 
    = -a10 a10
    c110 
    c210 c310

    bf10 
    0.0
    bf10 
    := c110 src10 c210 nz(bf10[1]) + c310 nz(bf10[2])

    sig10 src10 bf10 src10 bf10 ? -0

    ////////////////////////////////////////////////////////////////////////////////////
    src11 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length11 input.int(title='Length'defval=15minval=1)

    pi11 math.asin(1)
    a111 math.exp(-1.414 pi11 length11)
    b111 a111 math.cos(1.414 pi11 length11)
    coef211 b111
    coef311 
    = -a111 a111
    coef111 
    coef211 coef311

    ssf11 
    0.0
    ssf11 
    := bar_index src11 coef111 src11 coef211 nz(ssf11[1]) + coef311 nz(ssf11[2])

    sig11 src11 ssf11 src11 ssf11 ? -0
    /////////////////////////////////////////////////////
    src12 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length12 input.int(title='Length'defval=10minval=1)

    pi12 math.asin(1)
    a12 math.exp(-1.414 pi12 length12)
    b12 a12 math.cos(1.414 pi12 length12)
    c212 b12
    c312 
    = -a12 a12
    c112 
    c212 c312

    ssf12 
    0.0
    ssf12 
    := c112 * ((src12 nz(src12[1])) / 2) + c212 nz(ssf12[1]) + c312 nz(ssf12[2])

    sig12 src12 ssf12 src12 ssf12 ? -0
    /////////////////////////////////////////////////////
    src13 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length13 input.int(title='Length'defval=10minval=1)

    pi13 math.asin(1)
    a130 math.exp(-pi13 length13)
    b130 a130 math.cos(1.738 pi13 length13)
    c130 a130 a130
    d213 
    b130 c130
    d313 
    = -(c130 b130 c130)
    d413 c130 c130
    d113 
    d213 d313 d413

    bf13 
    0.0
    bf13 
    := d113 src13 d213 nz(bf13[1]) + d313 nz(bf13[2]) + d413 nz(bf13[3])

    sig13 src13 bf13 src13 bf13 ? -0

    ////////////////////////////////////////////////////////////////////////////////////
    src14 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length14 input.int(title='Length'defval=15minval=1)

    pi14 math.asin(1)
    a114 math.exp(-pi14 length14)
    b114 a114 math.cos(1.738 pi14 length14)
    c114 a114 a114
    coef214 
    b114 c114
    coef314 
    = -(c114 b114 c114)
    coef414 c114 c114
    coef114 
    = (b114 c114) * (c114) / 8

    bf14 
    0.0
    bf14 
    := bar_index src14 coef114 * (src14 nz(src14[1]) + nz(src14[2]) + nz(src14[3])) + coef214 nz(bf14[1]) + coef314 nz(bf14[2]) + coef414 nz(bf14[3])

    sig14 src14 bf14 src14 bf14 ? -0

    ///////////////////////////////////////
    src15 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length15 input.int(title='Length'defval=15minval=1)

    pi15 math.asin(1)
    a115 math.exp(-pi15 length15)
    b115 a115 math.cos(1.738 pi15 length15)
    c115 a115 a115
    coef215 
    b115 c115
    coef315 
    = -(c115 b115 c115)
    coef415 c115 c115
    coef115 
    coef215 coef315 coef415

    ssf15 
    0.0
    ssf15 
    := bar_index src15 coef115 src15 coef215 nz(ssf15[1]) + coef315 nz(ssf15[2]) + coef415 nz(ssf15[3])

    sig15 src15 ssf15 src15 ssf15 ? -0

    ////////////////////////////////////////////
    src16 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length16 input.int(title='Length'defval=20minval=1)

    pi16 math.asin(1)
    twoPiPrd16 pi16 length16
    alpha16 
    = (math.cos(twoPiPrd16) + math.sin(twoPiPrd16) - 1) / math.cos(twoPiPrd16)

    dec16 0.0
    dec16 
    := alpha16 * (src16 nz(src16[1])) + (alpha16) * nz(dec16[1])

    sig16 src16 dec16 src16 dec16 ? -0

    ////////////////////////////////////////////////////////////////////////////////////
    length17 input.int(title='Length'defval=15minval=1)
    src17 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]

    num17 0.0
    coefSum17 
    0.0
    for 0 to length17 1 by 1
        distance17 
    0.0
        
    for lb17 1 to length17 1 by 1
            distance17 
    += math.pow(nz(src17[i]) - nz(src17[lb17]), 2)
            
    distance17
        num17 
    += distance17 nz(src17[i])
        
    coefSum17 += distance17
        coefSum17

    filt17 
    coefSum17 != num17 coefSum17 0

    sig17 
    src17 filt17 src17 filt17 ? -0

    ///////////////////////////////
    src18 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length18 input.int(title="Length"defval=14minval=1)
    pedestal18 input.float(title="Pedestal"defval=3minval=0.01)

    filt18 0.0coef18 0.0
    for 0 to length18 1
        sine18 
    math.sin(pedestal18 + (((math.pi - (pedestal18)) * i) / (length18 1)))
        
    filt18 := filt18 + (sine18 nz(src18[i]))
        
    coef18 := coef18 sine18
    filt18 
    := coef18 != filt18 coef18 0

    slo18 
    src18 filt18
    sig18 
    slo18 slo18 nz(slo18[1]) ? slo18 slo18 nz(slo18[1]) ? -: -0

    //////////////////////////////
    src19 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length19 input.int(title="Length"defval=14minval=1)

    filt19 0.0coef19 0.0
    for 1 to length19 by 1
        cosine19 
    math.cos(math.pi / (length19 1))
        
    filt19 += cosine19 nz(src19[1])
        
    coef19 += cosine19
    filt19 
    := coef19 != filt19 coef19 0

    slo19 
    src19 filt19
    sig19 
    slo19 slo19 nz(slo19[1]) ? slo19 slo19 nz(slo19[1]) ? -: -0

    /////////////////////////////////////
    src20 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]

    pi20 math.asin(1)
    period20 0.0
    smooth20 
    = (src20 nz(src20[1]) + nz(src20[2]) + nz(src20[3])) / 10
    detrender20 
    = (0.0962 smooth20 0.5769 nz(smooth20[2]) - 0.5769 nz(smooth20[4]) - 0.0962 nz(smooth20[6])) * (0.075 nz(period20[1]) + 0.54)

    q120 = (0.0962 detrender20 0.5769 nz(detrender20[2]) - 0.5769 nz(detrender20[4]) - 0.0962 nz(detrender20[6])) * (0.075 nz(period20[1]) + 0.54)
    i120 nz(detrender20[3])

    jI20 = (0.0962 i120 0.5769 nz(i120[2]) - 0.5769 nz(i120[4]) - 0.0962 nz(i120[6])) * (0.075 nz(period20[1]) + 0.54)
    jQ20 = (0.0962 q120 0.5769 nz(q120[2]) - 0.5769 nz(q120[4]) - 0.0962 nz(q120[6])) * (0.075 nz(period20[1]) + 0.54)

    i220 i120 jQ20
    i220 
    := 0.2 i220 0.8 nz(i220[1])
    q220 q120 jI20
    q220 
    := 0.2 q220 0.8 nz(q220[1])

    re20 i220 nz(i220[1]) + q220 nz(q220[1])
    re20 := 0.2 re20 0.8 nz(re20[1])
    im20i220 nz(q220[1]) - q220 nz(i220[1])
    im20 := 0.2 im20 0.8 nz(im20[1])

    period20 := im20 != and re20 != pi20 math.atan(im20 re20) : 0
    period20 
    := math.min(math.max(period200.67 nz(period20[1])), 1.5 nz(period20[1]))
    period20 := math.min(math.max(period206), 50)
    period20 := 0.2 period20 0.8 nz(period20[1])

    smoothPeriod20 0.0
    smoothPeriod20 
    := 0.33 period20 0.67 nz(smoothPeriod20[1])

    dcPeriod20 math.ceil(smoothPeriod20 0.5)
    iTrend20 0.0
    for 0 to dcPeriod20 1 by 1
        iTrend20 
    += nz(src20[i])
        
    iTrend20
    iTrend20 
    := dcPeriod20 iTrend20 dcPeriod20 iTrend20

    trendline20 
    = (iTrend20 nz(iTrend20[1]) + nz(iTrend20[2]) + nz(iTrend20[3])) / 10

    sig20 
    smooth20 trendline20 smooth20 trendline20 ? -0

    ///////////////////////////////////
    src21 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    alpha21 input.float(title='Alpha'defval=0.07minval=0.01step=0.01)

    itrend21 0.0
    itrend21 
    := bar_index ? (src21 nz(src21[1]) + nz(src21[2])) / : (alpha21 math.pow(alpha212) / 4) * src21 0.5 math.pow(alpha212) * nz(src21[1]) - (alpha21 0.75 math.pow(alpha212)) * nz(src21[2]) + * (alpha21) * nz(itrend21[1]) - math.pow(alpha212) * nz(itrend21[2])
    trigger21 itrend21 nz(itrend21[2])

    sig21 trigger21 itrend21 trigger21 itrend21 ? -0

    //////////////////////
    src22 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length22 input.int(title='Length'defval=20minval=1)

    deltaSum22 0.0
    for int i 0 to length22 1 by 1
        deltaSum22 
    += math.abs(nz(src22[i]) - nz(src22[1]))
    ef22 deltaSum22 != math.min(math.abs(src22 nz(src22[length22 1])) / deltaSum221) : 0
    s22 
    math.pow((0.6667 ef22) + 0.06452)

    kama22 0.0
    kama22 
    := (s22 src22) + ((s22) * nz(kama22[1]))

    slo22 src22 kama22
    sig22 
    slo22 slo22 nz(slo22[1]) ? slo22 slo22 nz(slo22[1]) ? -: -0

    ////////////////////////
    src23 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    gamma23 input.float(title='Gamma'defval=0.8minval=0.01step=0.01)

    l023 0.0
    l023 
    := (gamma23) * src23 gamma23 nz(l023[1])

    l123 0.0
    l123 
    := -gamma23 l023 nz(l023[1]) + gamma23 nz(l123[1])

    l223 0.0
    l223 
    := -gamma23 l123 nz(l123[1]) + gamma23 nz(l223[1])

    l323 0.0
    l323 
    := -gamma23 l223 nz(l223[1]) + gamma23 nz(l323[1])

    filt23 = (l023 l123 l223 l323) / 6
    fir23 
    = (src23 nz(src23[1]) + nz(src23[2]) + nz(src23[3])) / 6

    sig23 
    fir23 filt23 fir23 filt23 ? -0

    /////////////////////////////////
    src24 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    threshold24 input.float(title='Threshold'defval=0.002minval=0.0001step=0.001)
    length24 input.int(title='Length'defval=39minval=1)

    smth24 = (src24 + (nz(src24[1])) + (nz(src24[2])) + nz(src24[3])) / 6
    len24 
    length24
    v324 
    0.2v224 0.0alpha24 0.0
    while (v324 threshold24 and len24 0)
        
    alpha24 := 2.0 / (len24 1)
        
    v124 ta.median(smth24len24)
        
    v224 := (alpha24 smth24) + ((alpha24) * nz(v224[1]))
        
    v324 := v124 != math.abs(v124 v224) / v124 v324
        len24 
    -= 2

    len24 
    := len24 len24
    alpha24 
    := 2.0 / (len24 1)

    filter24 0.0
    filter24 
    := (alpha24 smth24) + ((alpha24) * nz(filter24[1]))

    slo24 src24 filter24
    sig24 
    slo24 slo24 nz(slo24[1]) ? slo24 slo24 nz(slo24[1]) ? -: -0

    ///////////////////////////////
    src25 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    fastLimit25 input.float(title='FastLimit'defval=0.5minval=0.01step=0.01)
    slowLimit25 input.float(title='SlowLimit'defval=0.05minval=0.01step=0.01)

    pi25 math.asin(1)
    period25 0.0
    smooth25 
    = (src25 nz(src25[1]) + nz(src25[2]) + nz(src25[3])) / 10
    detrender25 
    = (0.0962 smooth25 0.5769 nz(smooth25[2]) - 0.5769 nz(smooth25[4]) - 0.0962 nz(smooth25[6])) * (0.075 nz(period25[1]) + 0.54)

    q125 = (0.0962 detrender25 0.5769 nz(detrender25[2]) - 0.5769 nz(detrender25[4]) - 0.0962 nz(detrender25[6])) * (0.075 nz(period25[1]) + 0.54)
    i125 nz(detrender25[3])

    jI25 = (0.0962 i125 0.5769 nz(i125[2]) - 0.5769 nz(i125[4]) - 0.0962 nz(i125[6])) * (0.075 nz(period25[1]) + 0.54)
    jQ25 = (0.0962 q125 0.5769 nz(q125[2]) - 0.5769 nz(q125[4]) - 0.0962 nz(q125[6])) * (0.075 nz(period25[1]) + 0.54)

    i225 i125 jQ25
    i225 
    := 0.2 i225 0.8 nz(i225[1])
    q225 q125 jI25
    q225 
    := 0.2 q225 0.8 nz(q225[1])

    re25 i225 nz(i225[1]) + q225 nz(q225[1])
    re25 := 0.2 re25 0.8 nz(re25[1])
    im25 i225 nz(q225[1]) - q225 nz(i225[1])
    im25 := 0.2 im25 0.8 nz(im25[1])

    period25 := im25 != and re25 != pi25 math.atan(im25 re25) : 0
    period25 
    := math.min(math.max(period250.67 nz(period25[1])), 1.5 nz(period25[1]))
    period25 := math.min(math.max(period256), 50)
    period25 := 0.2 period25 0.8 nz(period25[1])

    smoothPeriod25 0.0
    smoothPeriod25 
    := 0.33 period25 0.67 nz(smoothPeriod25[1])

    phase25 i125 != math.atan(q125 i125) * 180 pi25 0
    deltaPhase25 
    nz(phase25[1]) - phase25
    deltaPhase25 
    := deltaPhase25 deltaPhase25

    alpha25 
    fastLimit25 deltaPhase25
    alpha25 
    := alpha25 slowLimit25 slowLimit25 alpha25

    mama25 
    0.0
    mama25 
    := alpha25 src25 + (alpha25) * nz(mama25[1])

    fama25 0.0
    fama25 
    := 0.5 alpha25 mama25 + (0.5 alpha25) * nz(fama25[1])

    sig25 mama25 fama25 mama25 fama25 ? -0

    //////////////////////////////////////
    length26 input.int(title='Length'defval=15minval=1)
    momLength26 input.int(title='MomentumLength'defval=5minval=1)
    src26 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]

    num26 0.0
    coefSum26 
    0.0
    for 0 to length26 1 by 1
        coef26 
    math.abs(nz(src26[i]) - nz(src26[momLength26]))
        
    num26 += coef26 nz(src26[i])
        
    coefSum26 += coef26
        coefSum26

    filt26 
    coefSum26 != num26 coefSum26 0

    sig26 
    src26 filt26 src26 filt26 ? -0

    //////////////////////////////////
    src27 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]

    wma127 = (src27 nz(src27[1]) + nz(src27[2]) + nz(src27[3]) + nz(src27[4]) + nz(src27[5]) + nz(src27[6])) / 28
    wma227 
    = (wma127 nz(wma127[1]) + nz(wma127[2]) + nz(wma127[3]) + nz(wma127[4]) + nz(wma127[5]) + nz(wma127[6])) / 28

    predict27 
    wma127 wma227
    trigger27 
    = (predict27 nz(predict27[1]) + nz(predict27[2]) + nz(predict27[3])) / 10

    sig27 
    predict27 trigger27 predict27 trigger27 ? -0

    /////////////////////////////////////
    src28 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length28 input.int(title="Length"defval=14minval=1)

    filt28 0.0coef28 0.0l228 length28 2.0
    for 1 to length28
        c28 
    l228 l228 length28 l228
        filt28 
    := filt28 + (c28 nz(src28[1]))
        
    coef28 := coef28 c28
    filt28 
    := coef28 != filt28 coef28 0

    slo28 
    src28 filt28
    sig28 
    slo28 slo28 nz(slo28[1]) ? slo28 slo28 nz(slo28[1]) ? -: -0

    //////////////////////////////////
    src29 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    shortLength29 input.int(title='ShortLength'defval=9minval=1)
    longLength29 input.int(title='LongLength'defval=30minval=1)

    shortAvg29 ta.wma(src29shortLength29)
    shortMa29 math.sum(math.pow(src29 shortAvg292), shortLength29) / shortLength29
    shortRms29 
    shortMa29 math.sqrt(shortMa29) : 0

    longAvg29 
    ta.wma(src29longLength29)
    longMa29 math.sum(math.pow(src29 longAvg292), longLength29) / longLength29
    longRms29 
    longMa29 math.sqrt(longMa29) : 0

    kk29 
    longRms29 != 0.2 shortRms29 longRms29 0
    vidya29 
    0.0
    vidya29 
    := kk29 src29 + (kk29) * nz(vidya29[1])

    slo29 src29 vidya29
    sig29 
    slo29 slo29 nz(slo29[1]) ? slo29 slo29 nz(slo29[1]) ? -: -0

    ////////////////////////////////////////
    src31 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length31 input(title='Length'defval=11)
    offset31 input(title='Offset'defval=4)

    sum31 0.0
    weightSum31 
    0.0
    for 0 to length31 1 by 1
        weight31 
    length31 offset31
        sum31 
    += src31[i] * weight31
        weightSum31 
    += weight31
        weightSum31
    epma31 
    weightSum31 sum31

    sig31 
    src31 epma31 src31 epma31 ? -0

    //////////////////////////////////////////
    src32 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length32 input.int(title='Length'defval=14minval=1)

    jsa32 = (src32 src32[length32]) / 2

    sig32 
    src32 jsa32 src32 jsa32 ? -0

    /////////////////////////////
    src33 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    fastLength33 input.int(title "FastLength"defval 14minval 1)
    slowLength33 input.int(title "SlowLength"defval 30minval 1)

    leavittProjection(src33length33) =>
        
    result33 ta.linreg(src33length33, -1)
        
    fastLp33 leavittProjection(src33fastLength33)
    slowLp33 leavittProjection(src33slowLength33)

    slo33 fastLp33 slowLp33
    sig33 
    slo33 slo33 nz(slo33[1]) ? slo33 slo33 nz(slo33[1]) ? -: -0

    //////////////////////////////////
    src34 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length34 input(title='Length'defval=5)
    k34 input.float(title='K Constant'step=0.1defval=0.6)

    mdi34 0.0
    mdi34 
    := na(mdi34[1]) ? src34 nz(mdi34[1]) + (src34 nz(mdi34[1])) / math.max(k34 length34 math.pow(src34 nz(mdi34[1]), 4), 1)

    sig34 src34 mdi34 src34 mdi34 ? -0

    ////////////////////////////////////////////
    src35 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length35 input.int(title='Length'defval=10minval=1)
    fastLength35 input.int(title='FastLength'defval=2minval=1)
    slowLength35 input.int(title='SlowLength'defval=30minval=1)

    // first half uses the same formula as the kaufman adaptive moving average
    diff35 math.abs(src35 nz(src35[1]))
    signal35 math.abs(src35 nz(src35[length35]))
    noise35 math.sum(diff35length35)
    ratio35 noise35 != signal35 noise35 0

    // this is where it differs from the kaufman adaptive moving average
    fastSc35 / (fastLength35 1)
    slowSc35 / (slowLength35 1)
    temp35 ratio35 fastSc35 slowSc35
    maaq35 
    0.0
    prevMaaq35 
    nz(maaq35[1], src35)
    maaq35 := prevMaaq35 math.pow(temp352) * (src35 prevMaaq35)

    sig35 src35 maaq35 src35 maaq35 ? -0

    ///////////////////////////////
    src36 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    fac36 input.float(title='Factor'defval=0.2minval=0.01)

    val236 fac36 1
    factor36 
    / (val236 1)
    mwdx36 0.0
    mwdx36 
    := factor36 src36 + (factor36) * nz(mwdx36[1], src36)

    sig36 src36 mwdx36 src36 mwdx36 ? -0

    ////////////////////////
    src37 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    fastLength37 input.int(title='FastLength'defval=10minval=1)
    slowLength37 input.int(title='SlowLength'defval=50minval=1)
    mult37 input.int(title='Multiple'defval=1minval=1)

    fastEma37 ta.ema(src37fastLength37)
    slowEma37 ta.ema(src37slowLength37)
    sqAvg37 math.sum(math.pow(slowEma37 fastEma372), fastLength37) / fastLength37
    dev37 
    math.sqrt(sqAvg37) * mult37

    upperBand37 
    slowEma37 dev37
    lowerBand37 
    slowEma37 dev37
    middleBand37 
    fastEma37

    sig37 
    src37 upperBand37 and nz(src37[1]) <= nz(upperBand37[1]) or src37 lowerBand37 and nz(src37[1]) <= nz(lowerBand37[1]) ? src37 lowerBand37 and nz(src37[1]) >= nz(lowerBand37[1]) or src37 upperBand37 and nz(src37[1]) >= nz(upperBand37[1]) ? -src37 middleBand37 src37 middleBand37 ? -0

    //////////////////////////////////
    src38 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length38 input(title='Length'defval=14)

    sum38 0.0
    weightSum38 
    0.0
    owma38 
    0.0
    for 0 to length38 1 by 1
        corr38 
    ta.correlation(src38owma38length38)
        
    weight38 math.pow(length38 icorr38)
        
    sum38 += src38[i] * weight38
        weightSum38 
    += weight38
        weightSum38
    owma38 
    := sum38weightSum38

    sig38 
    src38 owma38 src38 owma38 ? -0

    /////////////////////////////////
    src39 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    minLength39 input.int(title='MinLength'defval=5minval=1)
    maxLength39 input.int(title='MaxLength'defval=50minval=1)

    mean39 ta.sma(src39maxLength39)
    stdDev39 ta.stdev(src39maxLength39)
    a39 mean39 1.75 stdDev39
    b39 
    mean39 0.25 stdDev39
    c390 
    mean39 0.25 stdDev39
    d39 
    mean39 1.75 stdDev39

    length39 
    0.0
    length39 
    := src39 >= b39 and src39 <= c390 nz(length39[1], maxLength39) + src39 a39 or src39 d39 nz(length39[1], maxLength39) - nz(length39[1], maxLength39)
    length39 := math.max(math.min(length39maxLength39), minLength39)
    sc39 / (length39 1)
    vlma39 0.0
    vlma39 
    := src39 sc39 + (sc39) * nz(vlma39[1], src39)

    sig39 src39 vlma39 src39 vlma39 ? -0

    //////////////////////////////
    src41 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length41 input(title='Length'defval=14)
    p41 input.float(title='Power'minval=0defval=1.0)

    sum41 0.0
    weightSum41 
    0.0
    for 0 to length41 1 by 1
        weight41 
    math.pow(length41 ip41)
        
    sum41 += src41[i] * weight41
        weightSum41 
    += weight41
        weightSum41
    vpwma41 
    sum41 weightSum41

    sig41 
    src41 vpwma41 src41 vpwma41 ? -0

    /////////////////////////////
    src42 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length42 input(title='Length'defval=14)

    sum42 0.0
    weightSum42 
    0.0
    for 0 to length42 1 by 1
        weight42 
    math.pow(length42 i2)
        
    sum42 += src42[i] * weight42
        weightSum42 
    += weight42
        weightSum42
    swma42 
    sum42 weightSum42

    sig42 
    src42 swma42 src42 swma42 ? -0

    //////////////////////////
    src43 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length43 input(title='Length'defval=14)

    sum43 0.0
    weightSum43 
    0.0
    for 0 to length43 1 by 1
        weight43 
    math.pow(length43 i0.5)
        
    sum43 += src43[i] * weight43
        weightSum43 
    += weight43
        weightSum43
    srwma43 
    sum43 weightSum43

    sig43 
    src43 srwma43 src43 srwma43 ? -0

    ////////////////////////
    src44 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length44 input.int(title='Length'defval=20minval=1)
    middleBandLength44 input.int(title='MiddleBandLength'defval=21minval=1)
    bandsDeviation44 input.float(title='BandsDeviation'defval=2.4minval=0.1)
    lowBandAdjust44 input.float(title='LowBandAdjust'defval=0.9minval=0.1)

    atrPeriod44 length44 1
    atrBuf44 
    ta.atr(atrPeriod44) * bandsDeviation44
    ma44 
    ta.ema(src44length44)

    upperBand44 ma44 ma44 atrBuf44 src44
    middleBand44 
    ta.ema(src44middleBandLength44)
    lowerBand44 ma44ma44 atrBuf44 lowBandAdjust44 src44

    sig44 
    src44 upperBand44 and nz(src44[1]) <= nz(upperBand44[1]) or src44 lowerBand44 and nz(src44[1]) <= nz(lowerBand44[1]) or src44 middleBand44 src44 lowerBand44 and nz(src44[1]) >= nz(lowerBand44[1]) or src44 upperBand44 and nz(src44[1]) >= nz(upperBand44[1]) or src44 middleBand44 ? -0

    //////////////////////
    src45 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length45 input.int(title='Length'defval=50minval=2)
    mult45 input.float(title='Mult'defval=10.0minval=0.01)

    alpha45 2.0 / (length45 1)
    mom45 src45 nz(src45[1])
    up45 mom45 mom45 0
    dn45 
    mom45 math.abs(mom45) : 0
    upMa45 
    ta.ema(up45length45)
    dnMa45 ta.ema(dn45length45)
    rs45 upMa45 dnMa45 != math.abs(upMa45 dnMa45) / (upMa45 dnMa45) : 0

    rsEma45 
    0.0
    rsEma45 
    := nz(rsEma45[1]) + (alpha45 * (+ (rs45 mult45)) * (src45 nz(rsEma45[1])))

    slo45 src45 rsEma45
    sig45 
    slo45 slo45 nz(slo45[1]) ? slo45 slo45 nz(slo45[1]) ? -: -0

    //////////////////////
    volSym46 input.symbol(title='Volatility Symbol'defval='VIX')
    src46 request.security(syminfo.tickeridresinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    volSrc46 request.security(volSym46resinp[rep barstate.isrealtime 0])[rep barstate.isrealtime 1]
    length46 input.int(title='Length'defval=10minval=1)
    maLength46 input.int(title='MaLength'defval=10minval=1)
    mult46 input.float(title='Mult'defval=10.0minval=.01)

    alpha46 2.0 / (length46 1)
    mom46 src46 nz(src46[1])
    pv46 mom46volSrc46 0
    nv46 
    mom46 volSrc46 0
    pvMa46 
    ta.ema(pv46maLength46)
    nvMa46 ta.ema(nv46maLength46)
    rs46 pvMa46 nvMa46 != math.abs(pvMa46 nvMa46) / (pvMa46 nvMa46) : 0

    rsvaEma46 
    0.0
    rsvaEma46 
    := nz(rsvaEma46[1]) + (alpha46 * (+ (rs46 mult46)) * (src46 nz(rsvaEma46[1])))

    slo46 src46 rsvaEma46
    sig46 
    slo46 slo46 nz(slo46[1]) ? slo46 slo46 nz(slo46[1]) ? -: -0

    /////////////////////////////////
    float inp55 input(title 'Source'defval close)
    string res55 input.timeframe(title 'Resolution'defval '')
    bool rep55 input(title 'Allow Repainting?'defval false)

    float src47 request.security(syminfo.tickeridres55inp55[rep55 barstate.isrealtime 0])[rep55 barstate.isrealtime 1]
    int length47 input.int(title 'Length'defval 40minval 2)
    float mult47 input.float(title 'Mult'defval 10.0minval 0.01)

    float alpha47 2.0 / (length47 1)
    float trL47 ta.lowest(ta.trlength47)
    float trH47 ta.highest(ta.trlength47)
    float trAdj47 trH47 trL47 != ? (ta.tr trL47) / (trH47 trL47) : 0

    float trAdjEma47 
    0.0
    trAdjEma47 
    := nz(trAdjEma47[1]) + (alpha47 * (+ (trAdj47 mult47)) * (src47 nz(trAdjEma47[1])))

    float slo47 src47 trAdjEma47
    int sig47 
    slo47 slo47 nz(slo47[1]) ? slo47 slo47 nz(slo47[1]) ? -: -0

    /////////////////////////////////
    float src49 request.security(syminfo.tickeridres55inp55[rep55 barstate.isrealtime 0])[rep55 barstate.isrealtime 1]
    float tr49 request.security(syminfo.tickeridres55ta.tr[rep55 barstate.isrealtime 0])[rep55 barstate.isrealtime 1]
    int length49 input.int(title 'Length'defval 30minval 2)

    float hhC49 ta.highest(src49length49)
    float llC49 ta.lowest(src49length49)
    float result49 hhC49 llC49
    float effort49 
    math.sum(tr49length49)
    float alpha49 effort49 != result49 effort49 0

    float nama49 
    0.0
    nama49 
    := (alpha49 src49) + ((alpha49) * nz(nama49[1]))

    float slo49 src49 nama49
    int sig49 
    slo49 slo49 nz(slo49[1]) ? slo49 slo49 nz(slo49[1]) ? -: -0

    //////////////////////////////////////
    float src50 request.security(syminfo.tickeridres55inp55[rep55 barstate.isrealtime 0])[rep55 barstate.isrealtime 1]
    float tr50 request.security(syminfo.tickeridres55ta.tr[rep55 barstate.isrealtime 0])[rep55 barstate.isrealtime 1]
    int length50 input.int(title 'Length'defval 30minval 2)

    float result50 math.abs(src50 nz(src50[length50]))
    float effort50 math.sum(tr50length50)
    float alpha50 effort50 != result50 effort50 0

    float anama50 
    0.0
    anama50 
    := (alpha50 src50) + ((alpha50) * nz(anama50[1]))

    float slo50 src50 anama50
    int sig50 
    slo50 slo50 nz(slo50[1]) ? slo50 slo50 nz(slo50[1]) ? -: -0

    /////////////////////////////////////////////////////////
    float src51 request.security(syminfo.tickerres55inp55[rep55 barstate.isrealtime 0])[rep55 barstate.isrealtime 1]
    int fastLength51 input.int(title 'FastLength'defval 6minval 1)
    int slowLength51 input.int(title 'SlowLength'defval 12minval 1)
    int sampleLength51 input.int(title 'SampleLength'defval 5minval 1)

    hannFilter51(float sampleSrc51int length51) =>
        
    filt51 0.0coef51 0.0
        
    for 1 to length51
            cosine51 
    math.cos(math.pi / (length51 1))
            
    filt51 := filt51 + (cosine51 nz(sampleSrc51[1]))
            
    coef51 := coef51 cosine51
        filt51 
    := coef51 != filt51 coef51 0

    float sample51 
    0.0
    sample51 
    := bar_index sampleLength51 == src51 nz(sample51[1])
    float fastAvg51 hannFilter51(sample51fastLength51)
    float slowAvg51 hannFilter51(sample51slowLength51)

    float slo51 fastAvg51 slowAvg51
    int sig51 
    slo51 slo51 nz(slo51[1]) ? slo51 slo51 nz(slo51[1]) ? -: -0

    //////////////////////////////////
    float src52 request.security(syminfo.tickeridres55inp55[rep55 barstate.isrealtime 0])[rep55 barstate.isrealtime 1]
    fastLength52 input.int(title "FastLength"defval 14minval 1)
    slowLength52 input.int(title "SlowLength"defval 30minval 1)

    leavittProjection52(float src52int length52) =>
        
    float result52 ta.linreg(src52length52, -1)
        
    leavittConvolution52(float src52int length52) =>
        
    int sqrtLength52 math.floor(nz(math.sqrt(length52)))
        
    float result52 ta.linreg(leavittProjection52(src52length52), sqrtLength52, -1)
        
    float fastConv52 leavittConvolution52(src52fastLength52)
    float slowConv52 leavittConvolution52(src52slowLength52)

    float slo52 fastConv52 slowConv52
    int sig52 
    slo52 slo52 nz(slo52[1]) ? slo52 slo52 nz(slo52[1]) ? -: -0
    /////////////////////////////////////////////////////////////////////////

    f_security(_symbol66_res66_src66_repaint66) =>
        
    request.security(_symbol66_res66_src66[_repaint66 barstate.isrealtime 0])[_repaint66 barstate.isrealtime 1]

    res66 input.timeframe(title='Resolution'defval='')
    rep66 input(title='Allow Repainting?'defval=false)

    length53 input.int(title='Length'defval=14minval=1)
    factor53 input.int(title='Factor'defval=2minval=1)
    p53 f_security(syminfo.tickeridres66hl2rep66)
    h53 f_security(syminfo.tickeridres66highrep66)
    l53 f_security(syminfo.tickeridres66lowrep66)
    t53 f_security(syminfo.tickeridres66ta.trrep66)

    mpEma53 ta.ema(p53length53)
    trEma53 ta.ema(t53length53)
    stdDev53 ta.stdev(trEma53length53)

    ad53 p53 nz(p53[1]) ? mpEma53 trEma53 p53 nz(p53[1]) ? mpEma53 trEma53 mpEma53
    adm53 
    ta.ema(ad53length53)

    trndDn53 0.0
    trndDn53 
    := ta.crossunder(adm53mpEma53) ? h53[2] : p53 nz(p53[1]) ? p53 stdDev53 factor53 nz(trndDn53[1], h53[2])
    trndUp53 0.0
    trndUp53 
    := ta.crossover(adm53mpEma53) ? l53[2] : p53 nz(p53[1]) ? p53 stdDev53 factor53 nz(trndUp53[1], l53[2])
    trndr53 0.0
    trndr53 
    := adm53 mpEma53 trndDn53 adm53 mpEma53 trndUp53 nz(trndr53[1], 0)

    sig53 p53 trndr53 p53 trndr53 ? -0
    /////////////////////////////////////////
    c54 f_security(syminfo.tickeridres66closerep66)
    v54 f_security(syminfo.tickeridres66volumerep66)
    length54 input.int(title='Length'defval=50minval=2)
    mult54 input.float(title='Mult'defval=10.0minval=0.01)

    alpha54 2.0 / (length54 1)
    mom54 c54 nz(c54[1])
    pv54 mom54 v54 0
    nv54 
    mom54 v54 0
    pvMa54 
    ta.ema(pv54length54)
    nvMa54 ta.ema(nv54length54)
    vs54 pvMa54 nvMa54 != math.abs(pvMa54 nvMa54) / (pvMa54 nvMa54) : 0

    rsvaEma54 
    0.0
    rsvaEma54 
    := nz(rsvaEma54[1]) + (alpha54 * (+ (vs54 mult54)) * (c54 nz(rsvaEma54[1])))

    slo54 c54 rsvaEma54
    sig54 
    slo54 slo54 nz(slo54[1]) ? slo54 slo54 nz(slo54[1]) ? -: -0
    ////////////////////////////////////
    length56 input.int(title='Length'defval=25minval=1)

    h56 f_security(syminfo.tickeridres66highrep66)
    l56 f_security(syminfo.tickeridres66lowrep66)
    c56 f_security(syminfo.tickeridres66closerep66)

    hh56 ta.highest(h56length56)
    ll56 ta.lowest(l56length56)
    atr56 ta.atr(length56)
    mult56 math.sqrt(length56)

    dSup56 hh56 atr56 mult56
    dRes56 
    ll56 atr56 mult56
    dMid56 
    = (dSup56 dRes56) / 2

    sig56 
    c56 dMid56 c56 dMid56 ? -0
    ///////////////////////////////
    length57 input.int(title='Length'defval=3minval=1)

    h57 f_security(syminfo.tickeridres66highrep66)
    l57 f_security(syminfo.tickeridres66lowrep66)
    c57 f_security(syminfo.tickeridres66closerep66)

    highMa57 ta.sma(h57length57)
    lowMa57 ta.sma(l57length57)

    ghla57 0.0
    ghla57 
    := c57 nz(highMa57[1]) ? lowMa57 c57 nz(lowMa57[1]) ? highMa57 nz(ghla57[1])

    sig57 c57 ghla57 c57 ghla57 ? -0
    //////////////////////////////////
    lbLength58 input.int(title='LookBackLength'defval=21minval=1)
    p58 f_security(syminfo.tickeridres66closerep66)
    h58 f_security(syminfo.tickeridres66highrep66)
    l58 f_security(syminfo.tickeridres66lowrep66)

    ll58 ta.lowest(lbLength58)
    hh58 ta.highest(lbLength58)

    hCount58 0
    lCount58 
    0
    cbl58 
    p58
    for 0 to lbLength58 by 1
        
    if l58[i] == ll58
            
    for j58 1 to i lbLength58 by 1
                lCount58 
    += (h58[j58] > h58[i] ? 0)
                if 
    lCount58 == 2
                    cbl58 
    := h58[j58]
                    break
        if 
    h58[i] == hh58
            
    for j58 1 to i lbLength58 by 1
                hCount58 
    += (l58[j58] < l58[i] ? 0)
                if 
    hCount58 == 2
                    cbl58 
    := l58[j58]
                    break

    sig58 p58 cbl58 p58 cbl58 ? -0
    //////////////////////////////
    inp59 input(title='Source'defval=close)
    h59 f_security(syminfo.tickeridres66highrep66)
    l59 f_security(syminfo.tickeridres66lowrep66)
    c59 f_security(syminfo.tickeridres66inp59rep66)
    length59 input.int(title='Length'defval=14minval=1)

    mHigh59 ta.linreg(h59length590) - ta.linreg(h59length591)
    mLow59 ta.linreg(l59length590) - ta.linreg(l59length591)

    upperBand59 h59lowerBand59 l59
    for 0 to length59 1
        currH59 
    nz(h59[i])
        
    prevH59 nz(h59[1])
        
    currL59 nz(l59[i])
        
    prevL59 nz(l59[1])
        
        
    vHigh59 currH59 + (nz(mHigh59[i]) * i)
        
    vLow59 currL59 + (nz(mLow59[i]) * i)
        
        
    upperBand59 := math.max(vHigh59upperBand59)
        
    lowerBand59 := math.min(vLow59lowerBand59)
    middleBand59 = (upperBand59 59) / 2

    slo59 
    c59 middleBand59
    sig59 
    = (c59 upperBand59 and nz(c59[1]) <= nz(upperBand59[1])) or (c59 lowerBand59 and nz(c59[1]) <= nz(lowerBand59[1]))
          ? 
    : (c59 lowerBand59 and nz(c59[1]) >= nz(lowerBand59[1])) or (c59 upperBand59 and nz(c59[1]) >= nz(upperBand59[1]))
          ? -
    slo59 slo59 nz(slo59[1]) ? slo59 slo59 nz(slo59[1]) ? -: -0

    ///////////////////////////////////
    length61 input.int(title='Length'defval=25minval=1)
    h61 f_security(syminfo.tickeridres66highrep66)
    l61 f_security(syminfo.tickeridres66lowrep66)
    c61 f_security(syminfo.tickeridres66closerep66)

    hh61 ta.highest(h61length61)
    ll61 ta.lowest(l61length61)
    range_161 hh61 ll61

    sup161 
    ll61 0.25 range_161
    sup261 
    ll61 0.5 range_161
    res161 
    hh61 0.25 range_161
    res261 
    hh61 0.5 range_161
    mid61 
    = (sup161 sup261 res161 res261) / 4
    sig61 
    c61 mid61 c61 mid61 ? -
    çalışmıyor demeyin....
    her turuncu slashların arası.....kod hesaplamaları içerir....
    istediğinizi plotlar.....ortalama alırsınız....

    ham yayınlama sebebi şu an test aşamassında....

    https://www.tradingview.com/x/elg0IBRp/
    https://www.tradingview.com/x/dtCqxguO/
    https://www.tradingview.com/x/nvba5IUR/
    https://www.tradingview.com/x/7FLSOPWx/

    testler bitince...tradingwiev de... paylaşılacak.....
    16.07.2024 - 10.12.2024



  2. zaman analizi trendi....
    1-3-5-15-30-45-60 lık periyotları okur....

    saatlik periyodun kapanışını esas alarak...
    zamanlara iki ortalama alır....

    biri 1-3-5-15 hesaplar zaman 0 olan
    diğeri 1-3-5-15-30-45-60 hesaplar... zaman1 olan

    sonuç görüntü...
    https://www.tradingview.com/x/q7RWQxIa/
    https://www.tradingview.com/x/HBOWp3KI/
    https://www.tradingview.com/x/oHB7GKFF/
    https://www.tradingview.com/x/JXBqMtK6/
    16.07.2024 - 10.12.2024

  3.  Alıntı Originally Posted by @yörük@ Yazıyı Oku
    zaman analizi trendi....
    1-3-5-15-30-45-60 lık periyotları okur....

    saatlik periyodun kapanışını esas alarak...
    zamanlara iki ortalama alır....

    biri 1-3-5-15 hesaplar zaman 0 olan
    diğeri 1-3-5-15-30-45-60 hesaplar... zaman1 olan

    sonuç görüntü...
    https://www.tradingview.com/x/q7RWQxIa/
    https://www.tradingview.com/x/HBOWp3KI/
    https://www.tradingview.com/x/oHB7GKFF/
    https://www.tradingview.com/x/JXBqMtK6/
    vurkaç için tasarlanacaksa...
    tek çizgi...
    1-3 dak periyodu oku....15 lik kapanışa kıyasla....
    çizgiyi çekinçe.....
    https://www.tradingview.com/x/yvxp7UTq/
    https://www.tradingview.com/x/Apddmsoa/
    https://www.tradingview.com/x/HwEMCcZd/

    15lik kıyaslanan periyot....https://www.tradingview.com/x/x43m9V00/

    yandaki rakamlar ise periyotlar oluyor....
    böylece hangi periyodun....destek ve direncini görmüş oluyoruz.....
    16.07.2024 - 10.12.2024

  4. gann 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/
    // © ThiagoSchmitz

    //@version=5
    indicator("Gann Square of 144"overlay=truemax_lines_count=50max_labels_count=50)
    // *****************************************************************************
    // ********************************* Constants *********************************
    // *****************************************************************************
    string groupInlineXYLabels      "X-Axis and Y-Axis Labels"
    string groupInlineExtraLines    "Extra Lines"
    string groupInlineColors        "colors"
    string groupInlineSquare        "squarecolors"
    int squares                     144
    int barIndex                    
    bar_index
    float barHigh                   
    high
    float barLow                    
    low
    string lineDashed               
    line.style_dashed
    string lineDotted               
    line.style_dotted
    string lineSolid                
    line.style_solid
    string lineNone                 
    label.style_none
    bool barstateIsNew              
    barstate.isnew
    bool barstateIsLast             
    barstate.islast
    color colorRed                  
    color.red
    color colorWhite                
    color.white

    // *****************************************************************************
    // ********************************* Inputs ************************************
    // *****************************************************************************
    var int startDate          input.time(timestamp("2022-11-01"), "Starting Date")
    var 
    float maxPrice         input.float(69198.0"Manual Max Price")
    var 
    float minPrice         input.float(17595.0"Manual Min Price")
    var 
    bool autoPricesAndBar  input.bool(true,     "Set Upper/Lower Prices and Start Bar Automatically")
    var 
    bool updateNewBar      input.bool(true,     "Update at new bar")
    var 
    int candlesPerDivision input.int(1,         "Candles per division"minval=1)
    var 
    bool showTopXAxis      input.bool(false,    "Top X-Axis"inline=groupInlineXYLabelsgroup=groupInlineXYLabels)
    var 
    bool showBottomXAxis   input.bool(false,     "Bottom X-Axis"inline=groupInlineXYLabelsgroup=groupInlineXYLabels)
    var 
    bool showLeftYAxis     input.bool(false,    "Left Y-Axis"inline=groupInlineXYLabelsgroup=groupInlineXYLabels)
    var 
    bool showRightYAxis    input.bool(false,     "Right Y-Axis"inline=groupInlineXYLabelsgroup=groupInlineXYLabels)
    var 
    bool showPrices        input.bool(false,     "Show Prices on the Right Y-Axis"inline=groupInlineXYLabelsgroup=groupInlineXYLabels)
    var 
    bool showDivisions     input.bool(false,     "Show Vertical Divisions"inline=groupInlineExtraLinesgroup=groupInlineExtraLines)
    var 
    bool showExtraLines    input.bool(false,     "Show Extra Lines"inline=groupInlineExtraLinesgroup=groupInlineExtraLines)
    var 
    bool showGrid          input.bool(false,     "Show Grid"inline=groupInlineExtraLinesgroup=groupInlineExtraLines)
    var 
    bool showBackground    input.bool(true,     "Show Background"inline=groupInlineExtraLinesgroup=groupInlineExtraLines)
    var 
    string patterns        input.string("Arrow""Line Patterns"options=["None""Arrow""Star""36, 72, and 108""Arrow Cross""Corners and Cross""Master"], group="patterns")
    var 
    color labelColor       input.color(color.green,                "Numbers Color",              inline=groupInlineColorsgroup=groupInlineColors)
    var 
    color divisionsColor   input.color(color.blue,                 "Vertical Lines Color",       inline=groupInlineColorsgroup=groupInlineColors)
    var 
    color gridColor        input.color(color.gray,                 "Grid Color",                 inline=groupInlineColorsgroup=groupInlineColors)
    var 
    color TLSColor         input.color(color.new(color.green80), "Top Left Square Color",      inline=groupInlineSquaregroup=groupInlineSquare)
    var 
    color TMSColor         input.color(color.new(color.red80), "Top Middle Square Color",    inline=groupInlineSquaregroup=groupInlineSquare)
    var 
    color TRSColor         input.color(color.new(color.green80), "Top Right Square Color",     inline=groupInlineSquaregroup=groupInlineSquare)
    var 
    color CLSColor         input.color(color.new(color.green80),   "Center Left Square Color",   inline=groupInlineSquaregroup=groupInlineSquare)
    var 
    color CMSColor         input.color(color.new(color.red80),   "Center Middle Square Color"inline=groupInlineSquaregroup=groupInlineSquare)
    var 
    color CRSColor         input.color(color.new(color.green80),   "Center Right Square Color",  inline=groupInlineSquaregroup=groupInlineSquare)
    var 
    color BLSColor         input.color(color.new(color.green80), "Bottom Left Square Color",   inline=groupInlineSquaregroup=groupInlineSquare)
    var 
    color BMSColor         input.color(color.new(color.red80), "Bottom Middle Square Color"inline=groupInlineSquaregroup=groupInlineSquare)
    var 
    color BRSColor         input.color(color.new(color.green80), "Bottom Right Square Color",  inline=groupInlineSquaregroup=groupInlineSquare)
    var 
    int dateBarIndex       0

    if time == startDate
        dateBarIndex 
    := barIndex
    // *****************************************************************************
    // ******************************** Variables **********************************
    // *****************************************************************************
    int startBarIndex    autoPricesAndBar barIndex math.floor(squares candlesPerDivision 2) : dateBarIndex
    int endBarIndex      
    startBarIndex squares candlesPerDivision
    int middleBarIndex   
    startBarIndex squares candlesPerDivision 2
    int onethirdPriceBar 
    = (endBarIndex startBarIndex) / 3
    int barDiff          
    squares math.abs(endBarIndex barIndex)
    int barIndexDiff     barDiff <= barDiff
    float atr            
    ta.atr(5)
    float highest        ta.highest(math.floor(squares candlesPerDivision 2) + 1)
    float lowest         ta.lowest(math.floor(squares candlesPerDivision2) + 1)
    float lowerPrice     autoPricesAndBar lowest minPrice
    float upperPrice     
    autoPricesAndBar highest maxPrice
    float middlePrice    
    lowerPrice + (upperPrice lowerPrice) / 2
    float onethirdPrice  
    = (upperPrice lowerPrice) / 3

    // *****************************************************************************
    // *************************** One-Time Variables ******************************
    // *****************************************************************************
    var box squareLines          box.new(barIndexbarHighbarIndexbarLowcolor.new(colorWhite50), 2bgcolor=na)
    var 
    bool buildSquareDone     false
    var bool buildInputsDone     false
    var bool[] dashedLineStyles  = array.new_bool()
    var 
    bool[] extendLines       = array.new_bool()
    var 
    bool[] showGroup         = array.new_bool()
    var 
    color[] lineColors       = array.new_color()
    var 
    label[] bottomXAxisArray = array.new_label()
    var 
    label[] leftYAxisArray   = array.new_label()
    var 
    label[] rightYAxisArray  = array.new_label()
    var 
    label[] topXAxisArray    = array.new_label()
    var 
    line[] BLRArray          = array.new_line()
    var 
    line[] BLTArray          = array.new_line()
    var 
    line[] BRLArray          = array.new_line()
    var 
    line[] BRTArray          = array.new_line()
    var 
    line[] TLBArray          = array.new_line()
    var 
    line[] TLRArray          = array.new_line()
    var 
    line[] TRBArray          = array.new_line()
    var 
    line[] TRLArray          = array.new_line()
    var 
    line[] divisionsArray    = array.new_line()
    var 
    line[] extraArray        = array.new_line()
    var 
    line[] gridArray         = array.new_line()
    var 
    box back1Square          box.new(barIndexbarHighbarIndexbarLowna0bgcolor=TLSColor)
    var 
    box back2Square          box.new(barIndexbarHighbarIndexbarLowna0bgcolor=TMSColor)
    var 
    box back3Square          box.new(barIndexbarHighbarIndexbarLowna0bgcolor=TRSColor)
    var 
    box back4Square          box.new(barIndexbarHighbarIndexbarLowna0bgcolor=CLSColor)
    var 
    box back5Square          box.new(barIndexbarHighbarIndexbarLowna0bgcolor=CMSColor)
    var 
    box back6Square          box.new(barIndexbarHighbarIndexbarLowna0bgcolor=CRSColor)
    var 
    box back7Square          box.new(barIndexbarHighbarIndexbarLowna0bgcolor=BLSColor)
    var 
    box back8Square          box.new(barIndexbarHighbarIndexbarLowna0bgcolor=BMSColor)
    var 
    box back9Square          box.new(barIndexbarHighbarIndexbarLowna0bgcolor=BRSColor)

    // *****************************************************************************
    // ******************************** Fucntions **********************************
    // *****************************************************************************

    // =============================================================================
    // * This function will update the box that goes on the edge of the Gann's
    // * square
    // =============================================================================
    updateBox() =>
        
    box.set_left(squareLinesstartBarIndex)
        
    box.set_top(squareLinesupperPrice)
        
    box.set_right(squareLinesendBarIndex)
        
    box.set_bottom(squareLineslowerPrice)

    // =============================================================================
    // * This function will update the background of the Gann's square
    // =============================================================================
    updateBackgrounds() =>
        
    s1 startBarIndex
        s2 
    startBarIndex + ((squares 3) * candlesPerDivision)
        
    s3 startBarIndex + ((squares 3) * candlesPerDivision)
        
    s4 endBarIndex
        t1 
    upperPrice
        t2 
    upperPrice - ((upperPrice lowerPrice) / 3)
        
    t3 upperPrice - ((upperPrice lowerPrice) / 3) * 2
        t4 
    lowerPrice

        box
    .set_left(back1Squares1)
        
    box.set_right(back1Squares2)
        
    box.set_top(back1Squaret1)
        
    box.set_bottom(back1Squaret2)
        
        
    box.set_left(back2Squares2)
        
    box.set_right(back2Squares3)
        
    box.set_top(back2Squaret1)
        
    box.set_bottom(back2Squaret2)

        
    box.set_left(back3Squares3)
        
    box.set_right(back3Squares4)
        
    box.set_top(back3Squaret1)
        
    box.set_bottom(back3Squaret2)

        
    box.set_left(back4Squares1)
        
    box.set_right(back4Squares2)
        
    box.set_top(back4Squaret2)
        
    box.set_bottom(back4Squaret3)

        
    box.set_left(back5Squares2)
        
    box.set_right(back5Squares3)
        
    box.set_top(back5Squaret2)
        
    box.set_bottom(back5Squaret3)

        
    box.set_left(back6Squares3)
        
    box.set_right(back6Squares4)
        
    box.set_top(back6Squaret2)
        
    box.set_bottom(back6Squaret3)

        
    box.set_left(back7Squares1)
        
    box.set_right(back7Squares2)
        
    box.set_top(back7Squaret3)
        
    box.set_bottom(back7Squaret4)

        
    box.set_left(back8Squares2)
        
    box.set_right(back8Squares3)
        
    box.set_top(back8Squaret3)
        
    box.set_bottom(back8Squaret4)

        
    box.set_left(back9Squares3)
        
    box.set_right(back9Squares4)
        
    box.set_top(back9Squaret3)
        
    box.set_bottom(back9Squaret4)

    // =============================================================================
    // * Build both X-Axis and y-Axis labels
    // * It will use the topXAxisArray, bottomXAxisArray, rightYAxisArray, and
    // * leftYAxisArray arrays to store each label, if they are enabled to be shown
    // =============================================================================
    buildAxis() =>
        for 
    int j 0 to squares by 6
            
    if showTopXAxis
                
    array.push(topXAxisArraylabel.new(startBarIndex candlesPerDivisionupperPrice atr 4str.tostring(j), style=lineNonetextcolor=labelColor))
            if 
    showBottomXAxis
                
    array.push(bottomXAxisArraylabel.new(startBarIndex candlesPerDivisionlowerPrice atr 2str.tostring(j), style=lineNonetextcolor=labelColor))
            if 
    showRightYAxis
                price 
    upperPrice - (upperPrice lowerPrice) / squares j
                t 
    str.tostring(j) + (showPrices " (" str.tostring(math.round_to_mintick(price)) + ")" "")
                array.
    push(rightYAxisArraylabel.new(endBarIndex candlesPerDivisionpricetstyle=lineNonetextcolor=labelColor))
            if 
    showLeftYAxis
                
    array.push(leftYAxisArraylabel.new(startBarIndex 3upperPrice - (upperPrice lowerPrice) / squares jstr.tostring(j), style=lineNonetextcolor=labelColor))

    // =============================================================================
    // * Update both X-Axis and y-Axis labels
    // =============================================================================
    updateAxis() =>
        for 
    int j 0 to squares 1 by 6
            
    if showTopXAxis
                label
    .set_x(array.get(topXAxisArray,    6), startBarIndex candlesPerDivision)
                
    label.set_y(array.get(topXAxisArray,    6), upperPrice atr 4)
            if 
    showBottomXAxis
                label
    .set_x(array.get(bottomXAxisArray6), startBarIndex candlesPerDivision)
                
    label.set_y(array.get(bottomXAxisArray6), lowerPrice atr 2)
            if 
    showRightYAxis
                label
    .set_x(array.get(rightYAxisArray,  6), endBarIndex candlesPerDivision)
                
    label.set_y(array.get(rightYAxisArray,  6), upperPrice - (upperPrice lowerPrice) / squares j)
            if 
    showLeftYAxis
                label
    .set_x(array.get(rightYAxisArray,  6), startBarIndex 3)
                
    label.set_y(array.get(rightYAxisArray,  6), upperPrice - (upperPrice lowerPrice) / squares j)

    // =============================================================================
    // * Build the vertical divisions to divide the square in 9 smaller squares
    // =============================================================================
    buildDivisions() =>
        array.
    push(divisionsArrayline.new(startBarIndexlowerPrice onethirdPriceendBarIndexlowerPrice onethirdPricecolor=divisionsColorstyle=lineDashed))
        array.
    push(divisionsArrayline.new(startBarIndexlowerPrice onethirdPrice 2endBarIndexlowerPrice onethirdPrice 2color=divisionsColorstyle=lineDashed))
        array.
    push(divisionsArrayline.new(startBarIndex onethirdPriceBarupperPricestartBarIndex onethirdPriceBarlowerPricecolor=divisionsColorstyle=lineDashed))
        array.
    push(divisionsArrayline.new(startBarIndex onethirdPriceBar 2upperPricestartBarIndex onethirdPriceBar 2lowerPricecolor=divisionsColorstyle=lineDashed))

    // =============================================================================
    // * Update the vertical divisions
    // =============================================================================
    updateDivisions() =>
        
    line.set_xy1(array.get(divisionsArray0), startBarIndexlowerPrice onethirdPrice)
        
    line.set_xy2(array.get(divisionsArray0), endBarIndexlowerPrice onethirdPrice)
        
    line.set_xy1(array.get(divisionsArray1), startBarIndexlowerPrice onethirdPrice 2)
        
    line.set_xy2(array.get(divisionsArray1), endBarIndexlowerPrice onethirdPrice 2)
        
    line.set_xy1(array.get(divisionsArray2), startBarIndex onethirdPriceBarupperPrice)
        
    line.set_xy2(array.get(divisionsArray2), startBarIndex onethirdPriceBarlowerPrice)
        
    line.set_xy1(array.get(divisionsArray3), startBarIndex onethirdPriceBar 2upperPrice)
        
    line.set_xy2(array.get(divisionsArray3), startBarIndex onethirdPriceBar 2lowerPrice)

    // =============================================================================
    // * Build the Gann's square. It will create lines based on the inputs and store
    // * them in some arrays. It will use the showGroup array to check if the line
    // * needs to be created or not. If showExtraLines is enabled, it will create 
    // * specific lines to provide the original Gann's Square format
    // =============================================================================    
    buildSquare() =>
        for 
    int i 0 to (squares 6) - 1
            int endIndex 
    startBarIndex * (1) * candlesPerDivision
            float endPrice 
    upperPrice - ((upperPrice lowerPrice) / squares) * * (1)
            
    string style = array.get(dashedLineStylesi) ? lineDashed lineSolid
            string extend 
    = array.get(extendLinesi) ? extend.both extend.none
            
    if array.get(showGroup8)
                
    // Top Left Bottom
                
    array.push(TLBArrayline.new(startBarIndexupperPriceendIndexlowerPricecolor=array.get(lineColorsi), style=styleextend=extend))
            if array.
    get(showGroup1)
                
    // Top Left Right
                
    array.push(TLRArrayline.new(startBarIndexupperPriceendBarIndexendPricecolor=array.get(lineColorsi), style=styleextend=extend))
            if array.
    get(showGroup2)
                
    // Bottom Left Top
                
    array.push(BLTArrayline.new(startBarIndexlowerPriceendIndexupperPricecolor=array.get(lineColorsi), style=styleextend=extend))
            if array.
    get(showGroup3)
                
    // Bottom Left Right
                
    array.push(BLRArrayline.new(startBarIndexlowerPriceendBarIndexendPricecolor=array.get(lineColorsi), style=styleextend=extend))
            if array.
    get(showGroup4)
                
    // Top Right Bottom
                
    array.push(TRBArrayline.new(endBarIndexupperPriceendIndexlowerPricecolor=array.get(lineColorsi), style=styleextend=extend))
            if array.
    get(showGroup5)
                
    // Top Right Left
                
    array.push(TRLArrayline.new(endBarIndexupperPricestartBarIndexendPricecolor=array.get(lineColorsi), style=styleextend=extend))
            if array.
    get(showGroup6)
                
    // Bottom Right Top
                
    array.push(BRTArrayline.new(endBarIndexlowerPriceendIndexupperPricecolor=array.get(lineColorsi), style=styleextend=extend))
            if array.
    get(showGroup7)
                
    // Bottom Right Left
                
    array.push(BRLArrayline.new(endBarIndexlowerPricestartBarIndexendPricecolor=array.get(lineColorsi), style=styleextend=extend))
        if 
    showExtraLines
            
    array.push(extraArrayline.new(middleBarIndexupperPricestartBarIndex,  upperPrice - ((upperPrice lowerPrice) / squares) * 36,    color=colorRedstyle=lineDashed))
            array.
    push(extraArrayline.new(middleBarIndexupperPriceendBarIndex,    upperPrice - ((upperPrice lowerPrice) / squares) * 36,    color=colorRedstyle=lineDashed))
            array.
    push(extraArrayline.new(middleBarIndexlowerPricestartBarIndex,  upperPrice - ((upperPrice lowerPrice) / squares) * 108,   color=colorRedstyle=lineDashed))
            array.
    push(extraArrayline.new(middleBarIndexlowerPriceendBarIndex,    upperPrice - ((upperPrice lowerPrice) / squares) * 108,   color=colorRedstyle=lineDashed))
     
    // =============================================================================
    // * Update each line created for the Gann's square
    // =============================================================================    
    updateSquare() =>
        if  array.
    size(TLBArray) == (squares 6) - and
               array.
    size(TLRArray) == (squares 6) - and
               array.
    size(BLTArray) == (squares 6) - 1
            
            
    for int i 0 to (squares 6) - 1
                int endIndex 
    startBarIndex candlesPerDivision
                float endPrice 
    upperPrice - ((upperPrice lowerPrice) / squares) * i
                
    if array.get(showGroup8)
                    
    // Top Left Bottom
                    
    line.set_xy1(array.get(TLBArrayi), startBarIndexupperPrice)
                    
    line.set_xy2(array.get(TLBArrayi), endIndex,      lowerPrice)
                if array.
    get(showGroup1)
                    
    // Top Left Right
                    
    line.set_xy1(array.get(TLRArrayi), startBarIndexupperPrice)
                    
    line.set_xy2(array.get(TLRArrayi), endBarIndex,   endPrice)
                if array.
    get(showGroup2)
                    
    // Bottom Left Top
                    
    line.set_xy1(array.get(BLTArrayi), startBarIndexlowerPrice)
                    
    line.set_xy2(array.get(BLTArrayi), endIndex,      upperPrice)
                if array.
    get(showGroup3)
                    
    // Bottom Left Right
                    
    line.set_xy1(array.get(BLRArrayi), startBarIndexlowerPrice)
                    
    line.set_xy2(array.get(BLRArrayi), endBarIndex,   endPrice)
                if array.
    get(showGroup4)
                    
    // Top Right Bottom
                    
    line.set_xy1(array.get(TRBArrayi), endBarIndex,   upperPrice)
                    
    line.set_xy2(array.get(TRBArrayi), endIndex,      lowerPrice)
                if array.
    get(showGroup5)
                    
    // Top Right Left
                    
    line.set_xy1(array.get(TRLArrayi), endBarIndex,   upperPrice)
                    
    line.set_xy2(array.get(TRLArrayi), startBarIndexendPrice)
                if array.
    get(showGroup6)
                    
    // Bottom Right Top
                    
    line.set_xy1(array.get(BRTArrayi), endBarIndex,   lowerPrice)
                    
    line.set_xy2(array.get(BRTArrayi), endIndex,      upperPrice)
                if array.
    get(showGroup7)
                    
    // Bottom Right Left
                    
    line.set_xy1(array.get(BRLArrayi), endBarIndex,   lowerPrice)
                    
    line.set_xy2(array.get(BRLArrayi), startBarIndexendPrice)

    // =============================================================================
    // * Create the grid lines for reference
    // =============================================================================
    buildGrid() =>
        for 
    int i 0 to 23
            index 
    startBarIndex * (1) * candlesPerDivision
            price 
    upperPrice - ((upperPrice lowerPrice) / squares) *  * (1)
            array.
    push(gridArrayline.new(indexupperPriceindexlowerPricecolor=gridColorstyle=lineDotted))
            array.
    push(gridArrayline.new(startBarIndexpriceendBarIndexpricecolor=gridColorstyle=lineDotted))

    // =============================================================================
    // * Update the grid lines
    // =============================================================================
    updateGrid() =>
        for 
    int i 0 to 23
            index 
    startBarIndex * (1) * candlesPerDivision
            price 
    upperPrice - ((upperPrice lowerPrice) / squares) *  * (1)
            
    line.set_xy1(array.get(gridArray2), indexupperPrice)
            
    line.set_xy2(array.get(gridArray2), indexlowerPrice)
            
    line.set_xy1(array.get(gridArray1), startBarIndexprice)
            
    line.set_xy2(array.get(gridArray1), endBarIndexprice)

    // =============================================================================
    // * Set lines pattern to override the parameters input of each division. When an
    // * option besides None is selected, it will ignore the selections of each line
    // =============================================================================
    setPattern() =>
        if 
    patterns != "None"
            
    for int i 0 to array.size(showGroup) - 1
                
    array.set(showGroupifalse)
        if 
    patterns == "Arrow"
            
    array.set(showGroup88true// Top Left to Bottom 72
            
    array.set(showGroup89true// Top Left to Right 72
            
    array.set(showGroup90true// Bottom Left to Top 72
            
    array.set(showGroup91true// Bottom Left to Right 72
        
    else if patterns == "Star"
            
    array.set(showGroup88true// Top Left to Bottom 72 
            
    array.set(showGroup89true// Top Left to Right 72
            
    array.set(showGroup90true// Bottom Left to Top 72
            
    array.set(showGroup91true// Bottom Left to Right 72
            
    array.set(showGroup92true// Top Right to Bottom 72
            
    array.set(showGroup93true// Top Right to Left 72
            
    array.set(showGroup94true// Bottom Right to Top 72
            
    array.set(showGroup95true// Bottom Right to Left 72
        
    else if patterns == "36, 72, and 108"
            
    array.set(showGroup40true// Top Left to Bottom 36
            
    array.set(showGroup41true// Top Left to Right 36
            
    array.set(showGroup42true// Bottom Left to Top 36
            
    array.set(showGroup45true// Top Right to Left 36
            
    array.set(showGroup88true// Top Left to Bottom 72
            
    array.set(showGroup89true// Top Left to Right 72
            
    array.set(showGroup90true// Bottom Left to Top 72
            
    array.set(showGroup91true// Bottom Left to Right 72
            
    array.set(showGroup92true// Top Right to Bottom 72
            
    array.set(showGroup93true// Top Right to Left 72
            
    array.set(showGroup94true// Bottom Right to Top 72
            
    array.set(showGroup95true// Bottom Right to Left 72
            
    array.set(showGroup139true// Bottom Left to Right 108
            
    array.set(showGroup140true// Top Right to Bottom 108
            
    array.set(showGroup142true// Bottom Right to Top 108
            
    array.set(showGroup143true// Bottom Right to Left 108
            
    array.set(showGroup184true// Top Left to Corner 144
            
    array.set(showGroup186true// Top Right to Corner 144
        
    else if patterns == "Arrow Cross"
            
    array.set(showGroup88true// Top Left to Bottom 72
            
    array.set(showGroup89true// Top Left to Right 72
            
    array.set(showGroup90true// Bottom Left to Top 72
            
    array.set(showGroup91true// Bottom Left to Right 72
            
    array.set(showGroup184true// Top Left to Corner 144
            
    array.set(showGroup186true// Top Right to Corner 144
        
    else if patterns == "Corners and Cross"
            
    array.set(showGroup88true// Top Left to Bottom 72
            
    array.set(showGroup89true// Top Left to Right 72
            
    array.set(showGroup90true// Bottom Left to Top 72
            
    array.set(showGroup91true// Bottom Left to Right 72
            
    array.set(showGroup92true// Top Right to Bottom 72
            
    array.set(showGroup93true// Top Right to Left 72
            
    array.set(showGroup94true// Bottom Right to Top 72
            
    array.set(showGroup95true// Bottom Right to Left 72
            
    array.set(showGroup184true// Top Left to Corner 144
            
    array.set(showGroup186true// Top Right to Corner 144
        
    else if patterns == "Master"
            
    array.set(showGroup42true// Bottom Left to Top 36
            
    array.set(showGroup43true// Bottom Left to Right 36
            
    array.set(showGroup88true// Top Left to Bottom 72
            
    array.set(showGroup89true// Top Left to Right 72
            
    array.set(showGroup90true// Bottom Left to Top 72
            
    array.set(showGroup91true// Bottom Left to Right 72
            
    array.set(showGroup138true// Bottom Left to Top 108
            
    array.set(showGroup139true// Bottom Left to Right 108
            
    array.set(showGroup184true// Top Left to Corner 144
            
    array.set(showGroup186true// Top Right to Corner 144
            
    // *****************************************************************************
    // ************************** Run On Every Tick ********************************
    // *****************************************************************************
    if updateNewBar and buildSquareDone and barstateIsNew and autoPricesAndBar
        updateSquare
    ()
        
    updateAxis()
        
    updateBox()
        if 
    showDivisions
            updateDivisions
    ()
        if 
    showGrid
            updateGrid
    ()
        
    // if showBackground
        //     updateBackgrounds()

    // *****************************************************************************
    // ****************************** Run Once *************************************
    // *****************************************************************************
    if buildInputsDone
        
    if time == startDate
            startBarIndex 
    := barIndex
        
    if barstateIsLast and not buildSquareDone
            setPattern
    ()
            
    updateBox()
            
    buildSquare()
            
    buildAxis() 
            if 
    showDivisions
                buildDivisions
    ()
            if 
    showGrid
                buildGrid
    ()
            if 
    showBackground
                updateBackgrounds
    ()
            
    buildSquareDone := true

    // =============================================================================
    // * Create all the lines inputs, together with the color of each one, line style and 
    // * extend type. The default values are those originally found in W.D. Gann's book.
    // * The order of each line matters for the comparison inside the functions
    // =============================================================================
    if not buildInputsDone
        buildInputsDone 
    := true
        lineColors 
    := array.concat(lineColors, array.from(
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 6"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 12"),
               
    input.color(color.red"Line Color",   inline="line"group="Connections from corners to 18"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 24"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 30"),
               
    input.color(color.red"Line Color",   inline="line"group="Connections from corners to 36"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 42"),
               
    input.color(color.red"Line Color",   inline="line"group="Connections from corners to 48"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 54"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 60"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 66"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 72"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 78"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 84"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 90"),
               
    input.color(color.red"Line Color",   inline="line"group="Connections from corners to 96"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 102"),
               
    input.color(color.red"Line Color",   inline="line"group="Connections from corners to 108"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 114"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 120"),
               
    input.color(color.red"Line Color",   inline="line"group="Connections from corners to 126"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 132"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 138"),
               
    input.color(color.green"Line Color"inline="line"group="Connections from corners to 144")))
               
        
    extendLines := array.concat(extendLines, array.from(
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 6"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 12"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 18"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 24"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 30"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 36"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 42"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 48"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 54"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 60"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 66"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 72"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 78"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 84"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 90"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 96"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 102"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 108"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 114"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 120"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 126"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 132"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 138"),
               
    input.bool(false"Extend Line"inline="line"group="Connections from corners to 144")))
        
        
    dashedLineStyles := array.concat(dashedLineStyles, array.from(
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 6"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 12"),
               
    input.bool(true"Dashed Line",  inline="line"group="Connections from corners to 18"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 24"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 30"),
               
    input.bool(true"Dashed Line",  inline="line"group="Connections from corners to 36"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 42"),
               
    input.bool(true"Dashed Line",  inline="line"group="Connections from corners to 48"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 54"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 60"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 66"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 72"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 78"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 84"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 90"),
               
    input.bool(true"Dashed Line",  inline="line"group="Connections from corners to 96"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 102"),
               
    input.bool(true"Dashed Line",  inline="line"group="Connections from corners to 108"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 114"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 120"),
               
    input.bool(true"Dashed Line",  inline="line"group="Connections from corners to 126"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 132"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 138"),
               
    input.bool(false"Dashed Line"inline="line"group="Connections from corners to 144")))
        
        
    showGroup := array.concat(showGroup, array.from(
               
    input.bool(false"┏ ↓"inline="6",  group="Connections from corners to 6"),
               
    input.bool(false"┏ →"inline="6",  group="Connections from corners to 6"),
               
    input.bool(false"┗ ↑"inline="6",  group="Connections from corners to 6"),
               
    input.bool(false"┗ →"inline="6",  group="Connections from corners to 6"),
               
    input.bool(false"┓ ←"inline="6",  group="Connections from corners to 6"),
               
    input.bool(false"┓ ↓"inline="6",  group="Connections from corners to 6"),
               
    input.bool(false"┛ ←"inline="6",  group="Connections from corners to 6"),
               
    input.bool(false"┛ ↑"inline="6",  group="Connections from corners to 6"),
               
    input.bool(false"┏ ↓"inline="12"group="Connections from corners to 12"),
               
    input.bool(false"┏ →"inline="12"group="Connections from corners to 12"),
               
    input.bool(false"┗ ↑"inline="12"group="Connections from corners to 12"),
               
    input.bool(false"┗ →"inline="12"group="Connections from corners to 12"),
               
    input.bool(false"┓ ←"inline="12"group="Connections from corners to 12"),
               
    input.bool(false"┓ ↓"inline="12"group="Connections from corners to 12"),
               
    input.bool(false"┛ ←"inline="12"group="Connections from corners to 12"),
               
    input.bool(false"┛ ↑"inline="12"group="Connections from corners to 12"),
               
    input.bool(true"┏ ↓",  inline="18"group="Connections from corners to 18"),
               
    input.bool(true"┏ →",  inline="18"group="Connections from corners to 18"),
               
    input.bool(true"┗ ↑",  inline="18"group="Connections from corners to 18"),
               
    input.bool(false"┗ →"inline="18"group="Connections from corners to 18"),
               
    input.bool(false"┓ ←"inline="18"group="Connections from corners to 18"),
               
    input.bool(false"┓ ↓"inline="18"group="Connections from corners to 18"),
               
    input.bool(false"┛ ←"inline="18"group="Connections from corners to 18"),
               
    input.bool(false"┛ ↑"inline="18"group="Connections from corners to 18"),
               
    input.bool(false"┏ ↓"inline="24"group="Connections from corners to 24"),
               
    input.bool(false"┏ →"inline="24"group="Connections from corners to 24"),
               
    input.bool(false"┗ ↑"inline="24"group="Connections from corners to 24"),
               
    input.bool(false"┗ →"inline="24"group="Connections from corners to 24"),
               
    input.bool(false"┓ ←"inline="24"group="Connections from corners to 24"),
               
    input.bool(false"┓ ↓"inline="24"group="Connections from corners to 24"),
               
    input.bool(false"┛ ←"inline="24"group="Connections from corners to 24"),
               
    input.bool(false"┛ ↑"inline="24"group="Connections from corners to 24"),
               
    input.bool(false"┏ ↓"inline="30"group="Connections from corners to 30"),
               
    input.bool(false"┏ →"inline="30"group="Connections from corners to 30"),
               
    input.bool(false"┗ ↑"inline="30"group="Connections from corners to 30"),
               
    input.bool(false"┗ →"inline="30"group="Connections from corners to 30"),
               
    input.bool(false"┓ ←"inline="30"group="Connections from corners to 30"),
               
    input.bool(false"┓ ↓"inline="30"group="Connections from corners to 30"),
               
    input.bool(false"┛ ←"inline="30"group="Connections from corners to 30"),
               
    input.bool(false"┛ ↑"inline="30"group="Connections from corners to 30"),
               
    input.bool(true"┏ ↓",  inline="36"group="Connections from corners to 36"),
               
    input.bool(true"┏ →",  inline="36"group="Connections from corners to 36"),
               
    input.bool(true"┗ ↑",  inline="36"group="Connections from corners to 36"),
               
    input.bool(false"┗ →"inline="36"group="Connections from corners to 36"),
               
    input.bool(false"┓ ←"inline="36"group="Connections from corners to 36"),
               
    input.bool(false"┓ ↓"inline="36"group="Connections from corners to 36"),
               
    input.bool(false"┛ ←"inline="36"group="Connections from corners to 36"),
               
    input.bool(false"┛ ↑"inline="36"group="Connections from corners to 36"),
               
    input.bool(false"┏ ↓"inline="42"group="Connections from corners to 42"),
               
    input.bool(false"┏ →"inline="42"group="Connections from corners to 42"),
               
    input.bool(false"┗ ↑"inline="42"group="Connections from corners to 42"),
               
    input.bool(false"┗ →"inline="42"group="Connections from corners to 42"),
               
    input.bool(false"┓ ←"inline="42"group="Connections from corners to 42"),
               
    input.bool(false"┓ ↓"inline="42"group="Connections from corners to 42"),
               
    input.bool(false"┛ ←"inline="42"group="Connections from corners to 42"),
               
    input.bool(false"┛ ↑"inline="42"group="Connections from corners to 42"),
               
    input.bool(true"┏ ↓",  inline="48"group="Connections from corners to 48"),
               
    input.bool(true"┏ →",  inline="48"group="Connections from corners to 48"),
               
    input.bool(true"┗ ↑",  inline="48"group="Connections from corners to 48"),
               
    input.bool(false"┗ →"inline="48"group="Connections from corners to 48"),
               
    input.bool(false"┓ ←"inline="48"group="Connections from corners to 48"),
               
    input.bool(false"┓ ↓"inline="48"group="Connections from corners to 48"),
               
    input.bool(false"┛ ←"inline="48"group="Connections from corners to 48"),
               
    input.bool(false"┛ ↑"inline="48"group="Connections from corners to 48"),
               
    input.bool(false"┏ ↓"inline="54"group="Connections from corners to 54"),
               
    input.bool(false"┏ →"inline="54"group="Connections from corners to 54"),
               
    input.bool(false"┗ ↑"inline="54"group="Connections from corners to 54"),
               
    input.bool(false"┗ →"inline="54"group="Connections from corners to 54"),
               
    input.bool(false"┓ ←"inline="54"group="Connections from corners to 54"),
               
    input.bool(false"┓ ↓"inline="54"group="Connections from corners to 54"),
               
    input.bool(false"┛ ←"inline="54"group="Connections from corners to 54"),
               
    input.bool(false"┛ ↑"inline="54"group="Connections from corners to 54"),
               
    input.bool(false"┏ ↓"inline="60"group="Connections from corners to 60"),
               
    input.bool(false"┏ →"inline="60"group="Connections from corners to 60"),
               
    input.bool(false"┗ ↑"inline="60"group="Connections from corners to 60"),
               
    input.bool(false"┗ →"inline="60"group="Connections from corners to 60"),
               
    input.bool(false"┓ ←"inline="60"group="Connections from corners to 60"),
               
    input.bool(false"┓ ↓"inline="60"group="Connections from corners to 60"),
               
    input.bool(false"┛ ←"inline="60"group="Connections from corners to 60"),
               
    input.bool(false"┛ ↑"inline="60"group="Connections from corners to 60"),
               
    input.bool(false"┏ ↓"inline="66"group="Connections from corners to 66"),
               
    input.bool(false"┏ →"inline="66"group="Connections from corners to 66"),
               
    input.bool(false"┗ ↑"inline="66"group="Connections from corners to 66"),
               
    input.bool(false"┗ →"inline="66"group="Connections from corners to 66"),
               
    input.bool(false"┓ ←"inline="66"group="Connections from corners to 66"),
               
    input.bool(false"┓ ↓"inline="66"group="Connections from corners to 66"),
               
    input.bool(false"┛ ←"inline="66"group="Connections from corners to 66"),
               
    input.bool(false"┛ ↑"inline="66"group="Connections from corners to 66"),
               
    input.bool(true"┏ ↓",  inline="72"group="Connections from corners to 72"),
               
    input.bool(true"┏ →",  inline="72"group="Connections from corners to 72"),
               
    input.bool(true"┗ ↑",  inline="72"group="Connections from corners to 72"),
               
    input.bool(true"┗ →",  inline="72"group="Connections from corners to 72"),
               
    input.bool(true"┓ ←",  inline="72"group="Connections from corners to 72"),
               
    input.bool(true"┓ ↓",  inline="72"group="Connections from corners to 72"),
               
    input.bool(true"┛ ←",  inline="72"group="Connections from corners to 72"),
               
    input.bool(true"┛ ↑",  inline="72"group="Connections from corners to 72"),
               
    input.bool(false"┏ ↓"inline="78"group="Connections from corners to 78"),
               
    input.bool(false"┏ →"inline="78"group="Connections from corners to 78"),
               
    input.bool(false"┗ ↑"inline="78"group="Connections from corners to 78"),
               
    input.bool(false"┗ →"inline="78"group="Connections from corners to 78"),
               
    input.bool(false"┓ ←"inline="78"group="Connections from corners to 78"),
               
    input.bool(false"┓ ↓"inline="78"group="Connections from corners to 78"),
               
    input.bool(false"┛ ←"inline="78"group="Connections from corners to 78"),
               
    input.bool(false"┛ ↑"inline="78"group="Connections from corners to 78"),
               
    input.bool(false"┏ ↓"inline="84"group="Connections from corners to 84"),
               
    input.bool(false"┏ →"inline="84"group="Connections from corners to 84"),
               
    input.bool(false"┗ ↑"inline="84"group="Connections from corners to 84"),
               
    input.bool(false"┗ →"inline="84"group="Connections from corners to 84"),
               
    input.bool(false"┓ ←"inline="84"group="Connections from corners to 84"),
               
    input.bool(false"┓ ↓"inline="84"group="Connections from corners to 84"),
               
    input.bool(false"┛ ←"inline="84"group="Connections from corners to 84"),
               
    input.bool(false"┛ ↑"inline="84"group="Connections from corners to 84"),
               
    input.bool(false"┏ ↓"inline="90"group="Connections from corners to 90"),
               
    input.bool(false"┏ →"inline="90"group="Connections from corners to 90"),
               
    input.bool(false"┗ ↑"inline="90"group="Connections from corners to 90"),
               
    input.bool(false"┗ →"inline="90"group="Connections from corners to 90"),
               
    input.bool(false"┓ ←"inline="90"group="Connections from corners to 90"),
               
    input.bool(false"┓ ↓"inline="90"group="Connections from corners to 90"),
               
    input.bool(false"┛ ←"inline="90"group="Connections from corners to 90"),
               
    input.bool(false"┛ ↑"inline="90"group="Connections from corners to 90"),
               
    input.bool(false"┏ ↓"inline="96"group="Connections from corners to 96"),
               
    input.bool(false"┏ →"inline="96"group="Connections from corners to 96"),
               
    input.bool(false"┗ ↑"inline="96"group="Connections from corners to 96"),
               
    input.bool(true"┗ →",  inline="96"group="Connections from corners to 96"),
               
    input.bool(false"┓ ←"inline="96"group="Connections from corners to 96"),
               
    input.bool(false"┓ ↓"inline="96"group="Connections from corners to 96"),
               
    input.bool(false"┛ ←"inline="96"group="Connections from corners to 96"),
               
    input.bool(false"┛ ↑"inline="96"group="Connections from corners to 96"),
               
    input.bool(false"┏ ↓"inline="102"group="Connections from corners to 102"),
               
    input.bool(false"┏ →"inline="102"group="Connections from corners to 102"),
               
    input.bool(false"┗ ↑"inline="102"group="Connections from corners to 102"),
               
    input.bool(false"┗ →"inline="102"group="Connections from corners to 102"),
               
    input.bool(false"┓ ←"inline="102"group="Connections from corners to 102"),
               
    input.bool(false"┓ ↓"inline="102"group="Connections from corners to 102"),
               
    input.bool(false"┛ ←"inline="102"group="Connections from corners to 102"),
               
    input.bool(false"┛ ↑"inline="102"group="Connections from corners to 102"),
               
    input.bool(false"┏ ↓"inline="108"group="Connections from corners to 108"),
               
    input.bool(false"┏ →"inline="108"group="Connections from corners to 108"),
               
    input.bool(false"┗ ↑"inline="108"group="Connections from corners to 108"),
               
    input.bool(true"┗ →",  inline="108"group="Connections from corners to 108"),
               
    input.bool(false"┓ ←"inline="108"group="Connections from corners to 108"),
               
    input.bool(false"┓ ↓"inline="108"group="Connections from corners to 108"),
               
    input.bool(false"┛ ←"inline="108"group="Connections from corners to 108"),
               
    input.bool(false"┛ ↑"inline="108"group="Connections from corners to 108"),
               
    input.bool(false"┏ ↓"inline="114"group="Connections from corners to 114"),
               
    input.bool(false"┏ →"inline="114"group="Connections from corners to 114"),
               
    input.bool(false"┗ ↑"inline="114"group="Connections from corners to 114"),
               
    input.bool(false"┗ →"inline="114"group="Connections from corners to 114"),
               
    input.bool(false"┓ ←"inline="114"group="Connections from corners to 114"),
               
    input.bool(false"┓ ↓"inline="114"group="Connections from corners to 114"),
               
    input.bool(false"┛ ←"inline="114"group="Connections from corners to 114"),
               
    input.bool(false"┛ ↑"inline="114"group="Connections from corners to 114"),
               
    input.bool(false"┏ ↓"inline="120"group="Connections from corners to 120"),
               
    input.bool(false"┏ →"inline="120"group="Connections from corners to 120"),
               
    input.bool(false"┗ ↑"inline="120"group="Connections from corners to 120"),
               
    input.bool(false"┗ →"inline="120"group="Connections from corners to 120"),
               
    input.bool(false"┓ ←"inline="120"group="Connections from corners to 120"),
               
    input.bool(false"┓ ↓"inline="120"group="Connections from corners to 120"),
               
    input.bool(false"┛ ←"inline="120"group="Connections from corners to 120"),
               
    input.bool(false"┛ ↑"inline="120"group="Connections from corners to 120"),
               
    input.bool(false"┏ ↓"inline="126"group="Connections from corners to 126"),
               
    input.bool(false"┏ →"inline="126"group="Connections from corners to 126"),
               
    input.bool(false"┗ ↑"inline="126"group="Connections from corners to 126"),
               
    input.bool(true"┗ →",  inline="126"group="Connections from corners to 126"),
               
    input.bool(false"┓ ←"inline="126"group="Connections from corners to 126"),
               
    input.bool(false"┓ ↓"inline="126"group="Connections from corners to 126"),
               
    input.bool(false"┛ ←"inline="126"group="Connections from corners to 126"),
               
    input.bool(false"┛ ↑"inline="126"group="Connections from corners to 126"),
               
    input.bool(false"┏ ↓"inline="132"group="Connections from corners to 132"),
               
    input.bool(false"┏ →"inline="132"group="Connections from corners to 132"),
               
    input.bool(false"┗ ↑"inline="132"group="Connections from corners to 132"),
               
    input.bool(false"┗ →"inline="132"group="Connections from corners to 132"),
               
    input.bool(false"┓ ←"inline="132"group="Connections from corners to 132"),
               
    input.bool(false"┓ ↓"inline="132"group="Connections from corners to 132"),
               
    input.bool(false"┛ ←"inline="132"group="Connections from corners to 132"),
               
    input.bool(false"┛ ↑"inline="132"group="Connections from corners to 132"),
               
    input.bool(false"┏ ↓"inline="138"group="Connections from corners to 138"),
               
    input.bool(false"┏ →"inline="138"group="Connections from corners to 138"),
               
    input.bool(false"┗ ↑"inline="138"group="Connections from corners to 138"),
               
    input.bool(false"┗ →"inline="138"group="Connections from corners to 138"),
               
    input.bool(false"┓ ←"inline="138"group="Connections from corners to 138"),
               
    input.bool(false"┓ ↓"inline="138"group="Connections from corners to 138"),
               
    input.bool(false"┛ ←"inline="138"group="Connections from corners to 138"),
               
    input.bool(false"┛ ↑"inline="138"group="Connections from corners to 138"),
               
    input.bool(true"┏ ↓",  inline="144"group="Connections from corners to 144"),
               
    input.bool(true"┏ →",  inline="144"group="Connections from corners to 144"),
               
    input.bool(true"┗ ↑",  inline="144"group="Connections from corners to 144"),
               
    input.bool(true"┗ →",  inline="144"group="Connections from corners to 144"),
               
    input.bool(false"┓ ←"inline="144"group="Connections from corners to 144"),
               
    input.bool(false"┓ ↓"inline="144"group="Connections from corners to 144"),
               
    input.bool(false"┛ ←"inline="144"group="Connections from corners to 144"),
               
    input.bool(false"┛ ↑"inline="144"group="Connections from corners to 144"))) 
    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/
    // © wielkieef


    //@version=5

    src close

    strategy
    ('Get your trend'overlay=truepyramiding=1initial_capital=10000default_qty_type=strategy.percent_of_equitydefault_qty_value=100calc_on_order_fills=falseslippage=0commission_type=strategy.commission.percentcommission_value=0.04)

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

    Length1 input.int(5title='  1-SMA Lenght'minval=1)
    Length2 input.int(15title='  2-SMA Lenght'minval=1)
    Length3 input.int(25title='  3-SMA Lenght'minval=1)
    prd input.int(15title='  PP period'group='Average True Range')
    Factor input.int(1title='  ATR Factor'group='Average True Range')
    Pd input.int(1title='  ATR Period'group='Average True Range')
    ADX_options input.string('CLASSIC'title='  Adx Type'options=['CLASSIC''MASANAKAMURA'], group='ADX')
    ADX_len input.int(20title='  Adx lenght'minval=1group='ADX')
    th input.float(15title='  Adx Treshold'minval=0step=0.5group='ADX')
    len input.int(30title='  Cloud Length'group='Cloud')
    volume_f input.float(1.8title='  Volume mult.'minval=0step=0.1group='Volume')
    sma_length input.int(30title='  Volume lenght'minval=1group='Volume')

    //Indicators -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    calcADX(_len) =>
        
    up ta.change(high)
        
    down = -ta.change(low)
        
    plusDM na(up) ? na up down and up up 0
        minusDM 
    na(down) ? na down up and down down 0
        truerange 
    ta.rma(ta.tr_len)
        
    _plus fixnan(100 ta.rma(plusDM_len) / truerange)
        
    _minus fixnan(100 ta.rma(minusDM_len) / truerange)
        
    sum _plus _minus
        _adx 
    100 ta.rma(math.abs(_plus _minus) / (sum == sum), _len)
        [
    _plus_minus_adx]
    calcADX_Masanakamura(_len) =>
        
    SmoothedTrueRange 0.0
        SmoothedDirectionalMovementPlus 
    0.0
        SmoothedDirectionalMovementMinus 
    0.0
        TrueRange 
    math.max(math.max(high lowmath.abs(high nz(close[1]))), math.abs(low nz(close[1])))
        
    DirectionalMovementPlus high nz(high[1]) > nz(low[1]) - low math.max(high nz(high[1]), 0) : 0
        DirectionalMovementMinus 
    nz(low[1]) - low high nz(high[1]) ? math.max(nz(low[1]) - low0) : 0
        SmoothedTrueRange 
    := nz(SmoothedTrueRange[1]) - nz(SmoothedTrueRange[1]) / _len TrueRange
        SmoothedDirectionalMovementPlus 
    := nz(SmoothedDirectionalMovementPlus[1]) - nz(SmoothedDirectionalMovementPlus[1]) / _len DirectionalMovementPlus
        SmoothedDirectionalMovementMinus 
    := nz(SmoothedDirectionalMovementMinus[1]) - nz(SmoothedDirectionalMovementMinus[1]) / _len DirectionalMovementMinus
        DIP 
    SmoothedDirectionalMovementPlus SmoothedTrueRange 100
        DIM 
    SmoothedDirectionalMovementMinus SmoothedTrueRange 100
        DX 
    math.abs(DIP DIM) / (DIP DIM) * 100
        adx 
    ta.sma(DX_len)
        [
    DIPDIMadx]
    [
    DIPlusCDIMinusCADXC] = calcADX(ADX_len)
    [
    DIPlusMDIMinusMADXM] = calcADX_Masanakamura(ADX_len)
    DIPlus ADX_options == 'CLASSIC' DIPlusC DIPlusM
    DIMinus 
    ADX_options == 'CLASSIC' DIMinusC DIMinusM
    ADX 
    ADX_options == 'CLASSIC' ADXC ADXM
    L_adx 
    DIPlus DIMinus and ADX th
    S_adx 
    DIPlus DIMinus and ADX th
    float ph 
    ta.pivothigh(prdprd)
    float pl ta.pivotlow(prdprd)
    var 
    float center na
    float lastpp 
    ph ph pl pl na
    if lastpp
        
    if na(center)
            
    center := lastpp
            center
        
    else

            
    center := (center lastpp) / 3
            center
    Up 
    center Factor ta.atr(Pd)
    Dn center Factor ta.atr(Pd)
    float TUp na
    float TDown 
    na
    Trend 
    0
    TUp 
    := close[1] > TUp[1] ? math.max(UpTUp[1]) : Up
    TDown 
    := close[1] < TDown[1] ? math.min(DnTDown[1]) : Dn
    Trend 
    := close TDown[1] ? close TUp[1] ? -nz(Trend[1], 1)
    Trailingsl Trend == TUp TDown
    bsignal 
    Trend == and Trend[1] == -1
    ssignal 
    Trend == -and Trend[1] == 1
    L_ATR 
    Trend == 1
    S_ATR 
    Trend == -1
    SMA1 
    ta.sma(srcLength1)
    SMA2 ta.sma(srcLength2)
    SMA3 ta.sma(srcLength3)
    Volume_condt volume ta.sma(volumesma_length) * volume_f
    Long_MA 
    SMA1 close and SMA2 close and SMA3 close
    Short_MA 
    SMA1 close and SMA2 close and SMA3 close
    PI 
    math.asin(1)
    hilbertTransform(src) =>
        
    0.0962 src 0.5769 nz(src[2]) - 0.5769 nz(src[4]) - 0.0962 nz(src[6])
    computeComponent(srcmesaPeriodMult) =>
        
    hilbertTransform(src) * mesaPeriodMult
    computeAlpha
    (srcfastLimitslowLimit) =>
        
    mesaPeriod 0.0
        mesaPeriodMult 
    0.075 nz(mesaPeriod[1]) + 0.54
        smooth 
    0.0
        smooth 
    := (src nz(src[1]) + nz(src[2]) + nz(src[3])) / 10
        detrender 
    0.0
        detrender 
    := computeComponent(smoothmesaPeriodMult)
        
    I1 nz(detrender[3])
        
    Q1 computeComponent(detrendermesaPeriodMult)
        
    jI computeComponent(I1mesaPeriodMult)
        
    jQ computeComponent(Q1mesaPeriodMult)
        
    I2 0.0
        Q2 
    0.0
        I2 
    := I1 jQ
        Q2 
    := Q1 jI
        I2 
    := 0.2 I2 0.8 nz(I2[1])
        
    Q2 := 0.2 Q2 0.8 nz(Q2[1])
        
    Re I2 nz(I2[1]) + Q2 nz(Q2[1])
        
    Im I2 nz(Q2[1]) - Q2 nz(I2[1])
        
    Re := 0.2 Re 0.8 nz(Re[1])
        
    Im := 0.2 Im 0.8 nz(Im[1])
        if 
    Re != and Im != 0
            mesaPeriod 
    := PI math.atan(Im Re)
            
    mesaPeriod
        
    if mesaPeriod 1.5 nz(mesaPeriod[1])
            
    mesaPeriod := 1.5 nz(mesaPeriod[1])
            
    mesaPeriod
        
    if mesaPeriod 0.67 nz(mesaPeriod[1])
            
    mesaPeriod := 0.67 nz(mesaPeriod[1])
            
    mesaPeriod
        
    if mesaPeriod 6
            mesaPeriod 
    := 6
            mesaPeriod
        
    if mesaPeriod 50
            mesaPeriod 
    := 50
            mesaPeriod
        mesaPeriod 
    := 0.2 mesaPeriod 0.8 nz(mesaPeriod[1])
        
    phase 0.0
        
    if I1 != 0
            phase 
    := 180 PI math.atan(Q1 I1)
            
    phase
        deltaPhase 
    nz(phase[1]) - phase
        
    if deltaPhase 1
            deltaPhase 
    := 1
            deltaPhase
        alpha 
    fastLimit deltaPhase
        
    if alpha slowLimit
            alpha 
    := slowLimit
            alpha
        
    [alphaalpha 2.0]
    er math.abs(ta.change(srclen)) / math.sum(math.abs(ta.change(src)), len)
    [
    ab] = computeAlpha(srcerer 0.1)
    mama 0.0
    mama 
    := src + (a) * nz(mama[1])
    fama 0.0
    fama 
    := mama + (b) * nz(fama[1])
    alpha math.pow(er * (a) + a2)
    kama 0.0
    kama 
    := alpha src + (alpha) * nz(kama[1])
    L_cloud kama kama[1]
    S_cloud kama kama[1]

    // STRATEGY LOGIC -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    var bool longCond na
    var bool shortCond na
    longCond 
    := nz(longCond[1])
    shortCond := nz(shortCond[1])
    var 
    int CondIni_long 0
    var int CondIni_short 0
    CondIni_long 
    := nz(CondIni_long[1])
    CondIni_short := nz(CondIni_short[1])
    var 
    bool Final_longCondition na
    var bool Final_shortCondition na
    Final_longCondition 
    := nz(Final_longCondition[1])
    Final_shortCondition := nz(Final_shortCondition[1])
    var 
    bool BT_Final_longCondition na
    var bool BT_Final_shortCondition na
    BT_Final_longCondition 
    := nz(BT_Final_longCondition[1])
    BT_Final_shortCondition := nz(BT_Final_shortCondition[1])
    var 
    float last_open_longCondition na
    var float last_open_shortCondition na
    var int last_longCondition na
    var int last_shortCondition na
    var int nLongs na
    var int nShorts na
    nLongs 
    := nz(nLongs[1])
    nShorts := nz(nShorts[1])
    Bulls_on_the_control Long_MA and Volume_condt and L_adx and not S_cloud
    close_condt 
    S_cloud and S_ATR
    longCond 
    := Bulls_on_the_control
    shortCond 
    := close_condt
    CondIni_long 
    := longCond[1] ? shortCond[1] ? -nz(CondIni_long[1])
    CondIni_short := longCond[1] ? shortCond[1] ? -nz(CondIni_short[1])
    longCondition longCond[1] and nz(CondIni_long[1]) == -1
    shortCondition 
    shortCond[1] and nz(CondIni_short[1]) == 1
    var int last_long_sl na
    var int last_short_sl na
    last_open_longCondition 
    := longCondition close[1] : nz(last_open_longCondition[1])
    last_open_shortCondition := shortCondition close[1] : nz(last_open_shortCondition[1])
    last_longCondition := longCondition time nz(last_longCondition[1])
    last_shortCondition := shortCondition time nz(last_shortCondition[1])
    in_longCondition last_longCondition last_shortCondition
    in_shortCondition 
    last_shortCondition last_longCondition
    if longCondition
        nLongs 
    += 1
        nShorts 
    := na
        nShorts
    if shortCondition
        nLongs 
    := na
        nShorts 
    += 1
        nShorts
    var int sectionLongs 0
    sectionLongs 
    := nz(sectionLongs[1])
    var 
    int sectionShorts 0
    sectionShorts 
    := nz(sectionShorts[1])
    if 
    longCondition
        sectionLongs 
    += 1
        sectionShorts 
    := 0
        sectionShorts
    if shortCondition
        sectionLongs 
    := 0
        sectionShorts 
    += 1
        sectionShorts
    var float PositionPrice 0.0
    PositionPrice 
    := nz(PositionPrice[1])
    var 
    float sum_long 0.0
    var float sum_short 0.0
    if longCondition
        sum_long 
    := nz(last_open_longCondition) + nz(sum_long[1])
        
    sum_short := 0.0
        sum_short
    if shortCondition
        sum_short 
    := nz(last_open_shortCondition) + nz(sum_short[1])
        
    sum_long := 0.0
        sum_long
    PositionPrice 
    := longCondition sum_long sectionLongs shortCondition sum_short sectionShorts na

    // Colors ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    ADX_COLOR L_adx color.lime S_adx color.red color.orange
    barcolor
    (color=ADX_COLOR)

    //PLOTSPAHES =======================================================================================================================================================================================================================================================================================================

    //mama_p = plot(mama, title='Cloud A', color=ADX_COLOR)
    //fama_p = plot(fama, title='Cloud B', color=ADX_COLOR)
    //fill(mama_p, fama_p, color=ADX_COLOR, transp=90)
    //plot(SMA1, color=color.new(color.yellow, 0), style=plot.style_line, title='5', linewidth=1)
    //plot(SMA2, color=color.new(color.gray, 0), style=plot.style_stepline, title='15', linewidth=2)
    //plot(SMA3, color=color.new(color.black, 0), style=plot.style_stepline, title='55', linewidth=3)
    //plotshape(longCondition, title='Long', style=shape.triangleup, location=location.belowbar, text='Long', textcolor=color.new(color.blue, 0), color=color.new(color.blue, 0), size=size.small)
    //plotshape(shortCondition, title='Close', style=shape.xcross, location=location.abovebar, text='Close', textcolor=color.new(color.fuchsia, 0), color=color.new(color.fuchsia, 0), size=size.small)
    //plot(PositionPrice, title='Average Price', color=color.new(color.white, 0), linewidth=7, style=plot.style_circles, editable=true)


    if Long_MA and Volume_condt and L_adx and not S_cloud
        strategy
    .entry('L'strategy.long)


    strategy.close_all(when=close_condt)



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

    //@version=5

    src33 input(defval=closetitle='لا تلعب بيها')
    len33 input.int(defval=20title='الشمعات'minval=10)
    devlen input.float(defval=2.title='الانحراف'minval=0.1step=0.1)
    extendit input(defval=falsetitle='خط انفنتي')
    showfibo input(defval=falsetitle='مستويات فيبو')
    showbroken input.bool(defval=truetitle='القنوات المكسورة'inline='brk')
    brokencol input.color(defval=color.rgb(2074248), title=''inline='brk')
    upcol input.color(defval=color.limetitle='لون الترندات الصاعده والنازله'inline='trcols')
    dncol input.color(defval=color.redtitle=''inline='trcols')
    widt input(defval=1title='عرض الخط')

    var 
    fibo_ratios = array.new_float(0)
    var 
    colors = array.new_color(2)
    if 
    barstate.isfirst
        
    array.unshift(colorsupcol)
        array.
    unshift(colorsdncol)
        array.
    push(fibo_ratios0.236)
        array.
    push(fibo_ratios0.382)
        array.
    push(fibo_ratios0.618)
        array.
    push(fibo_ratios0.786)


    get_channel(src33len33) =>
        
    mid math.sum(src33len33) / len33
        slope 
    ta.linreg(src33len330) - ta.linreg(src33len331)
        
    intercept mid slope math.floor(len33 2) + (len33 2) / slope
        endy 
    intercept slope * (len33 1)
        
    dev 0.0
        
    for 0 to len33 1 by 1
            dev 
    += math.pow(src33[x] - (slope * (len33 x) + intercept), 2)
            
    dev
        dev 
    := math.sqrt(dev len33)
        [
    interceptendydevslope]

    [
    y1_y2_devslope] = get_channel(src33len33)

    outofchannel slope and close y2_ dev devlen slope and close y2_ dev devlen : -1

    var reglines = array.new_line(3)
    var 
    fibolines = array.new_line(4)
    for 
    0 to 2 by 1
        
    if not showbroken or outofchannel != or nz(outofchannel[1], -1) != -1
            line
    .delete(array.get(reglinesx))
        else
            
    line.set_color(array.get(reglinesx), color=brokencol)
            
    line.set_width(array.get(reglinesx), width=2)
            
    line.set_style(array.get(reglinesx), style=line.style_dotted)
            
    line.set_extend(array.get(reglinesx), extend=extend.none)

        array.
    set(reglinesxline.new(x1=bar_index - (len33 1), y1=y1_ dev devlen * (1), x2=bar_indexy2=y2_ dev devlen * (1), color=array.get(colorsmath.round(math.max(math.sign(slope), 0))), style=== line.style_solid line.style_dashedwidth=widtextend=extendit extend.right extend.none))
    if 
    showfibo
        
    for 0 to 3 by 1
            line
    .delete(array.get(fibolinesx))
            array.
    set(fibolinesxline.new(x1=bar_index - (len33 1), y1=y1_ dev devlen dev devlen * array.get(fibo_ratiosx), x2=bar_indexy2=y2_ dev devlen dev devlen * array.get(fibo_ratiosx), color=array.get(colorsmath.round(math.max(math.sign(slope), 0))), style=line.style_dottedwidth=widtextend=extendit extend.right extend.none))

    var 
    label sidelab label.new(x=bar_index - (len33 1), y=y1_text='S'size=size.normal)
    txt slope slope slope[1] ? '⇑' '⇗' slope slope slope[1] ? '⇓' '⇘' '⇒'
    stl slope slope slope[1] ? label.style_label_up label.style_label_upper_right slope slope slope[1] ? label.style_label_down label.style_label_lower_right label.style_label_right
    label
    .set_style(sidelabstl)
    label.set_text(sidelabtxt)
    label.set_x(sidelabbar_index - (len33 1))
    label.set_y(sidelabslope y1_ dev devlen slope y1_ dev devlen y1_)
    label.set_color(sidelabslope upcol slope dncol color.blue)


    // direction
    trendisup math.sign(slope) != math.sign(slope[1]) and slope 0
    trendisdown 
    math.sign(slope) != math.sign(slope[1]) and slope 
    trend bar renkli...
    16.07.2024 - 10.12.2024

  6. pi döngüsünün ...yarısı kullanılarak....
    görüntüler......
    https://www.tradingview.com/x/H3fxiZKL/
    https://www.tradingview.com/x/7HwEdOwU/
    https://www.tradingview.com/x/qX24pk0a/
    https://www.tradingview.com/x/bZF7yn6J/

    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/
    // © Furo010
    // [2023-08]
    //@version=5
    indicator(title="Pi Cycle Top Indicator"shorttitle="Pi Cycle"overlay=true)

    // Input to control whether the Pi Cycle Top Indicator should be displayed
    Show_PiCicleTopIndicator input.bool(title='Pi Cycle Top Indicator'defval=truetooltip='Use only with daily candles')

    // Calculate the 111-period and 350-period simple moving averages (SMAs) of the closing prices
    sma111 ta.sma(close55)
    sma350 ta.sma(close175)

    // Plot the SMAs on the chart based on the input condition and daily timeframe
    plot(Show_PiCicleTopIndicator and timeframe.isminutes sma111 natitle="MA 111"linewidth=2color=color.new(color.orange0))
    plot(Show_PiCicleTopIndicator and timeframe.isminutes sma350 natitle="MA 350 * 2"linewidth=2color=color.new(color.green0)) 
    16.07.2024 - 10.12.2024

Sayfa 229/276 İlkİlk ... 129179219227228229230231239 ... 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
  •