Sayfa 4/12 İlkİlk ... 23456 ... SonSon
Arama sonucu : 89 madde; 25 - 32 arası.

Konu: Bitcoin & Ethereum

  1. https://www.tradingview.com/x/Tqfaqr7o/ 69.500 yoklayacak gibi....
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  2.  Alıntı Originally Posted by @yörük@ Yazıyı Oku
    https://www.tradingview.com/x/Tqfaqr7o/ 69.500 yoklayacak gibi....
    yoklamamış.....ıskaladık...
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  3. PHP Code:
     // This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © east-west_trading

    //@version=5
    indicator("Pivots and Swings",overlay=truemax_labels_count 500max_lines_count 500max_bars_back 500)
    //User inputs
    pivotbars input.int(title 'number of bars for pivot'defval 2inline='1')
    swingD input.string(title 'Show swing details?'options=['None','On plot','In table','Both'],defval ='None'inline='1')
    labelcolor input.color(title 'Label background color'defval =color.whiteinline='2')
    PHtextcolor input.color(title 'Pivot High text'defval=color.greeninline ='2')
    PLtextcolor input.color(title 'Pivot low text'defval=color.redinline='2')
    colorbars input.bool(title='color bars basis trend?'defval falseinline='3')
    uptrendup input.color(defval color.rgb(6523571),title 'uptrend / up day',inline='3')
    uptrenddown input.color(defval color.rgb(31136),title 'Up trend / down day'inline='3')
    downtrendup input.color(defval color.rgb(237162188),title='Down trend / up day'inline ='5')
    downtrenddown input.color(defval color.rgb(1594848),title='Down trend / down day',inline='5')


    showfirstpivots input.bool(title 'Show first order pivots'defval truegroup '---- First Order Pivots ----'inline='1')
    show1sttrends input.bool(title='Show first order swing trends'defval false,group '---- First Order Pivots ----'inline='1' )
    FOPH_color input.color(defval color.limetitle 'Pivot high'group '---- First Order Pivots ----'inline='1')
    FOPL_color input.color(defval color.rgb(237162188), title 'Pivot low'group '---- First Order Pivots ----'inline='1')
    FOPH_connect_color input.color(defval color.rgb(188218244), title 'Up swing'group '---- First Order Pivots ----'inline='2')
    FOPL_connect_color input.color(defval color.rgb(188218244), title 'Down swing'group '---- First Order Pivots ----',inline='2' )
    FOPH_style input.string(defval 'Circle'title 'High style'group '---- First Order Pivots ----'options = ['Circle','X Cross','Cross''Triangle Up''Triangle Down''Flag','Arrow Up','Arrow Down','Square',
     
    'Diamond','None'], inline '3')
    FOPL_style input.string(defval 'Circle'title 'Low style'group '---- First Order Pivots ----'options = ['Circle','X Cross','Cross''Triangle Up''Triangle Down''Flag','Arrow Up','Arrow Down','Square',
     
    'Diamond','None'], inline '3')
    FOP_size input.string(size.auto'Size'options=[size.autosize.tiny,size.small,size.normal,size.large,size.huge],group '---- First Order Pivots ----'inline='3' )


    showsecondpivots input.bool(title='Show second order pivots'defval truegroup '---- Second Order Pivots ----'inline='1')
    show2ndtrends input.bool(title='Show second order swing trends',defval=falsegroup '---- Second Order Pivots ----'inline='1' )
    SOPH_color input.color(defval color.tealtitle 'Pivot high'group '---- Second Order Pivots ----'inline='2')
    SOPL_color input.color(defval color.redtitle 'Pivot low'group '---- Second Order Pivots ----',inline='2')
    SOPH_connect_color input.color(defval color.silvertitle 'Up swing'group '---- Second Order Pivots ----'inline='2')
    SOPL_connect_color input.color(defval color.silvertitle 'Down swing'group '---- Second Order Pivots ----',inline='2' )
    SOPH_style input.string(defval 'Triangle Down'title ' High style'group '---- Second Order Pivots ----'options = ['Circle','X Cross','Cross''Triangle Up''Triangle Down''Flag','Arrow Up',
     
    'Arrow Down','Square''Diamond','None'], inline='3')
    SOPL_style input.string(defval 'Triangle Up'title 'Low style'group '---- Second Order Pivots ----'options = ['Circle','X Cross','Cross''Triangle Up''Triangle Down''Flag','Arrow Up',
     
    'Arrow Down','Square''Diamond','None'], inline='3')
    SOP_size input.string(size.auto'Size'options=[size.autosize.tiny,size.small,size.normal,size.large,size.huge],group '---- Second Order Pivots ----'inline='3' )


    showthirdpivots input.bool(title='Show third order pivots'defval truegroup '---- Third Order Pivots ----'inline ='1')
    show3rdtrends input.bool(title='show third order swings'defval falsegroup '---- Third Order Pivots ----'inline'1')
    TOPH_color input.color(defval color.blacktitle 'Pivot high'group '---- Third Order Pivots ----'inline='2')
    TOPL_color input.color(defval color.blacktitle 'Pivot low'group '---- Third Order Pivots ----',inline='2')
    TOPH_connect_color input.color(defval color.rgb(255153066), title 'Up swing'group '---- Third Order Pivots ----'inline='2')
    TOPL_connect_color input.color(defval color.rgb(255153066), title 'Down swing'group '---- Third Order Pivots ----',inline='2' )
    TOPH_style input.string(defval 'Triangle Down'title 'High style'group '---- Third Order Pivots ----'options = ['Circle','X Cross','Cross''Triangle Up''Triangle Down''Flag','Arrow Up',
     
    'Arrow Down','Square''Diamond','None'], inline='3')
    TOPL_style input.string(defval 'Triangle Up'title 'Low style'group '---- Third Order Pivots ----'options = ['Circle','X Cross','Cross''Triangle Up''Triangle Down''Flag','Arrow Up',
     
    'Arrow Down','Square''Diamond','None'], inline='3')
    TOP_size input.string(size.auto'Size'options=[size.autosize.tiny,size.small,size.normal,size.large,size.huge],group '---- Third Order Pivots ----'inline='3' )



    FOPH_style_option = switch FOPH_style
        
    'Circle' => label.style_circle
        
    'X Cross' => label.style_xcross
        
    'Cross' => label.style_cross
        
    'Triangle Up' => label.style_triangleup
        
    'Triangle Down' => label.style_triangledown
        
    'Flag' => label.style_flag
        
    'Arrow Up'=>label.style_arrowup
        
    'Arrow Down'=>label.style_arrowdown
        
    'Square'=>label.style_square
        
    'Diamond'=>label.style_diamond 
        
    'None'=>label.style_none
    FOPL_style_option 
    = switch FOPL_style
        
    'Circle' => label.style_circle
        
    'X Cross' => label.style_xcross
        
    'Cross' => label.style_cross
        
    'Triangle Up' => label.style_triangleup
        
    'Triangle Down' => label.style_triangledown
        
    'Flag' => label.style_flag
        
    'Arrow Up'=>label.style_arrowup
        
    'Arrow Down'=>label.style_arrowdown
        
    'Square'=>label.style_square
        
    'Diamond'=>label.style_diamond 
        
    'None'=>label.style_none
    SOPH_style_option 
    = switch SOPH_style
        
    'Circle' => label.style_circle
        
    'X Cross' => label.style_xcross
        
    'Cross' => label.style_cross
        
    'Triangle Up' => label.style_triangleup
        
    'Triangle Down' => label.style_triangledown
        
    'Flag' => label.style_flag
        
    'Arrow Up'=>label.style_arrowup
        
    'Arrow Down'=>label.style_arrowdown
        
    'Square'=>label.style_square
        
    'Diamond'=>label.style_diamond 
        
    'None'=>label.style_none
    SOPL_style_option 
    = switch SOPL_style
        
    'Circle' => label.style_circle
        
    'X Cross' => label.style_xcross
        
    'Cross' => label.style_cross
        
    'Triangle Up' => label.style_triangleup
        
    'Triangle Down' => label.style_triangledown
        
    'Flag' => label.style_flag
        
    'Arrow Up'=>label.style_arrowup
        
    'Arrow Down'=>label.style_arrowdown
        
    'Square'=>label.style_square
        
    'Diamond'=>label.style_diamond 
        
    'None'=>label.style_none
    TOPH_style_option 
    = switch TOPH_style
        
    'Circle' => label.style_circle
        
    'X Cross' => label.style_xcross
        
    'Cross' => label.style_cross
        
    'Triangle Up' => label.style_triangleup
        
    'Triangle Down' => label.style_triangledown
        
    'Flag' => label.style_flag
        
    'Arrow Up'=>label.style_arrowup
        
    'Arrow Down'=>label.style_arrowdown
        
    'Square'=>label.style_square
        
    'Diamond'=>label.style_diamond 
        
    'None'=>label.style_none
    TOPL_style_option 
    = switch TOPL_style
        
    'Circle' => label.style_circle
        
    'X Cross' => label.style_xcross
        
    'Cross' => label.style_cross
        
    'Triangle Up' => label.style_triangleup
        
    'Triangle Down' => label.style_triangledown
        
    'Flag' => label.style_flag
        
    'Arrow Up'=>label.style_arrowup
        
    'Arrow Down'=>label.style_arrowdown
        
    'Square'=>label.style_square
        
    'Diamond'=>label.style_diamond 
        
    'None'=>label.style_none

    // Calculate pivot bars 
    ph ta.pivothigh(pivotbarspivotbars)
    pl ta.pivotlow(pivotbarspivotbars)

    // label positioning
    labpos ta.atr(10)

    // ---- Variables for line drawings ---- //
    //first order pivot connections
    var string lastcheck1 na,var int ph1index 0,var int pl1index 0,var int lookback1 0,var float ph1val 0,var float pl1val 0,var line connect1 na

    // second order pivot connections
    var string lastcheck2 na,var int ph2index 0,var int pl2index 0,var float ph2val 0,var float pl2val 0,var line connect2 na,var array<linelines = array.new<line>(),var float[] p2low_val = array.new_float(),
     var 
    int[] p2low_index = array.new_int(),var float[] p2high_val = array.new_float(),var int[] p2high_index = array.new_int()

    // third order pivot connections
    var string lastcheck3 na,var int ph3index 0,var int pl3index 0,var int lookback3 0,var float ph3val 0,var float pl3val 0,var line connect3 na

    // --- Variables for pivots --- //

    //variables for first order pivot lows
    var float[] lows = array.new_float(3,0),var int[] pl_loc = array.new_int(3,0),var float pl1 0,var float pl2 0,var float pl3 0

    // variables for second order pivot lows
    var float[] seclows = array.new_float(3,0),var int[] secpl_loc = array.new_int(3,0),var float secpl1 0,var float secpl2 0,var float secpl3 0,var label secondpivotlow na,var int spl_loc 0

    //variables for third order pivots
    var label thirdpivotlow na,var int tpl_loc 0

    //variables for first order pivot highs
    var float[] highs = array.new_float(3,0),var int[] ph_loc = array.new_int(3,0),var float ph1 0,var float ph2 0,var float ph3 0

    //variables for second order pivot highs
    var float[] sechighs = array.new_float(3,0),var int[] secph_loc = array.new_int(3,0),var float secph1 0,var float secph2 0,var float secph3 0,var label secondpivothigh na,var int sph_loc 0

    //variable for thrid order pivot highs
    var label thirdpivothigh na,var int tph_loc 0

    //sequence arrays
    var float[] seqhighs = array.new_float(),var float[] seqlows = array.new_float()

    // uncommon situation variables
    var float temp_index_h 0,var float temp_val_h 0,var float[] temp_h = array.new_float(),var float temp_index_l 0,var float temp_val_l 0,var float[] temp_l = array.new_float()

    // Variables for color coding
    var label swinghigh na,var label swinglow na,var float lowprice na,var float hiprice na,var string trend na,upday close open,downday close open

    // Table
    var table swings table.new(position.top_right,20,20,border_color=color.black), var float[] highstamp = array.new_float(), var float[] lowstamp = array.new_float(),
     var 
    int[] highstampindex= array.new_int(), var int[] lowstampindex = array.new_int(),var float distance 0, var float[] seqswing = array.new_float()

    // ----- PIVOT HIGHS ----- //

    if not na(ph
        if 
    showfirstpivots == true
            label
    .new(x=bar_index pivotbarsna(labpos) ? high[pivotbars] + syminfo.mintick*250 high[pivotbars] + labpos,style=FOPH_style_optionsize=FOP_size,color=FOPH_color)
        
    hiprice := high[pivotbars]
        
    // set price arrays
        
    array.push(highshigh[pivotbars]),array.set(highs0, array.get(highs1)), array.set(highs1, array.get(highs2)),array.set(highs2high[pivotbars])
        
    // set index arrays
        
    array.push(ph_loc,bar_index[pivotbars]), array.set(ph_loc0, array.get(ph_loc1)),array.set(ph_loc1, array.get(ph_loc2)),array.set(ph_loc2bar_index[pivotbars])
        
    //set comparison values
        
    ph1 := array.get(highs,0),ph2 := array.get(highs,1), ph3 := array.get(highs,2)
        
    // first order swing connections
        
    if lastcheck1 == 'PL1' or na(lastcheck1)
            if 
    pl1index !=and high[pivotbars] > pl1val
                lookback1 
    := bar_index pl1index
                connect1 
    := show1sttrends == true line.new(x1 pl1indexy1 low[lookback1], x2 bar_index pivotbarsy2 high[pivotbars], color=FOPH_connect_color) : na 
                lastcheck1 
    := 'PH1'
                
    ph1val := high[pivotbars]
            
    ph1index := bar_index pivotbars
        
    if lastcheck1 == 'PH1' and high[pivotbars] > ph1val
            line
    .delete(connect1)
            
    lookback1 := bar_index pl1index
            connect1 
    := show1sttrends == true line.new(x1 pl1indexy1 low[lookback1], x2 bar_index pivotbarsy2 high[pivotbars], color=FOPH_connect_color) : na 
            ph1val 
    := high[pivotbars]
            
    ph1index := bar_index pivotbars

        
    //second order pivot highs
        
    if (ph1 ph2 and ph2 ph3) or (ph1 == ph2 and ph2 ph3)
            
    sph_loc := array.get(ph_loc,1)
        if 
    ph1 ph2 and ph2 == ph3
            sph_loc 
    := array.get(ph_loc,2)
        if ((
    ph1 ph2 and ph2 ph3) or (ph1 == ph2 and ph2 ph3) or (ph1 ph2 and ph2 == ph3 )) 
            
    //set price arrays
            
    array.push(sechighshigh[bar_index sph_loc]),array.set(sechighs,0,array.get(sechighs,1)),array.set(sechighs,1,array.get(sechighs,2)),array.set(sechighs2high[bar_index sph_loc])
            
    //set index arrays
            
    array.push(secph_locbar_index[bar_index sph_loc]),array.set(secph_loc,0,array.get(secph_loc,1)),array.set(secph_loc,1,array.get(secph_loc,2)), array.set(secph_loc2bar_index[bar_index sph_loc])
            
    // set comparison values
            
    secph1 := array.get(sechighs,0),secph2 := array.get(sechighs,1), secph3 := array.get(sechighs,2)
            
    // label
            
    secondpivothigh := showsecondpivots == true label.new(bar_index - (bar_index sph_loc), yhigh[bar_index sph_loc] + labpos[bar_index sph_loc]*style=SOPH_style_optionsize=SOP_sizecolor=SOPH_color ) : na
            
    // second order pivot high swing connections
            
    if lastcheck2 == 'PL2'
                
    if sph_loc pl2index
                    
    if high[bar_index sph_loc] > pl2val
                        connect2 
    := show2ndtrends == true line.new(x1 pl2indexy1 low[bar_index pl2index], x2 sph_locy2 high[bar_index sph_loc], color=SOPH_connect_color) : nalines.push(connect2)
                        
    swinghigh := swingD == 'On plot' or swingD == 'Both' label.new(x=sph_loc,y=high[bar_index sph_loc] + labpos*4color=labelcolortextcolor=PHtextcolor,
                         
    text 'Time : ' str.tostring(sph_loc pl2index) + '\n' 'Distance : ' +
                         
    str.tostring(((high[bar_index sph_loc]-low[bar_index pl2index])/low[bar_index pl2index]),'#.##'+'%'), size=size.small):na
                        distance 
    := ((high[bar_index sph_loc]-low[bar_index pl2index])/low[bar_index pl2index])
                        array.
    push(highstamp,distance), array.push(highstampindex,sph_loc pl2index),array.push(seqswing,1), array.push(seqswing,distance), array.push(seqswing,sph_loc pl2index)
                        array.
    clear(seqhighs),array.push(seqhighs,sph_loc),array.push(seqhighshigh[bar_index sph_loc])
                        
    ph2index := sph_loc,ph2val := high[bar_index sph_loc]
                        array.
    push(p2high_indexph2index),array.push(p2high_valph2val)
                        
    lastcheck2 := 'PH2'
                    
    if high[bar_index sph_loc] < pl2val
                        
    array.push(seqhighssph_loc),array.push(seqhighs,high[bar_index sph_loc])
                    if 
    sph_loc spl_loc 
                        line
    .delete(array.get(lines, array.size(lines) -1)), array.remove(lines, array.size(lines) -1)
                        
    connect2 := show2ndtrends == true line.new(x1 pl2indexy1 low[bar_index pl2index], x2 sph_locy2 high[bar_index sph_loc], color=SOPH_connect_color) : na,lines.push(connect2)
                        
    connect2 := show2ndtrends == true line.new(x1 sph_locy1 high[bar_index sph_loc], x2 spl_locy2 low[bar_index spl_loc], color=SOPL_connect_color) : na,lines.push(connect2)
                        
    swinglow := swingD == 'On plot'or swingD == 'Both' label.new(x=spl_loc,y=low[bar_index spl_loc] - labpos*4color=labelcolortextcolor=PLtextcolor,
                         
    text 'Time : ' str.tostring(spl_loc ph2index) + '\n' 'Distance : ' str.tostring(((low[bar_index spl_loc]-high[bar_index ph2index])/high[bar_index ph2index]),'#.##'+'%'), size=size.small):na
                        distance 
    := low[bar_index spl_loc]-high[bar_index ph2index]/high[bar_index ph2index]
                        array.
    push(lowstamp,distance), array.push(lowstampindex,spl_loc ph2index),array.push(seqswing,0), array.push(seqswing,distance), array.push(seqswing,spl_loc pl2index)

                        
    lastcheck2 := 'PL2'
                        
    pl2index := spl_locpl2val := low[bar_index spl_loc]
                        array.
    clear(seqlows),array.push(seqlows,spl_loc),array.push(seqlowslow[bar_index spl_loc])
                    
                if 
    sph_loc pl2index
                    
    if array.size(seqlows) > and array.size(lines)!=0
                        
    if array.get(seqlows, array.size(seqlows) - 2) > sph_loc
                            
    array.pop(seqlows), array.pop(seqlows)
                        if array.
    size(seqlows) > 2
                            
    for 1 to array.size(seqlowsby 2
                                
    array.push(temp_l, array.get(seqlows,i))
                            
    temp_val_l := array.min(temp_l),temp_index_l := array.get(seqlows, (array.indexof(seqlowstemp_val_l)-1))
                        if array.
    size(seqlows) == 2
                            temp_val_l 
    := array.get(seqlows,1),temp_index_l := array.get(seqlows,0)
                        if 
    temp_val_l high[bar_index sph_loc]
                            
    line.delete(array.get(lines, array.size(lines) - 1)), array.remove(lines, array.size(lines) - 1), label.delete(swinglow),array.pop(lowstamp), array.pop(lowstampindex),
                             array.
    pop(seqswing),array.pop(seqswing),array.pop(seqswing)
                            
    connect2 := show2ndtrends == true line.new(x1 ph2indexy1 high[bar_index ph2index], x2 int(temp_index_l), y2 low[bar_index temp_index_l], color=SOPL_connect_color ) : na,lines.push(connect2)
                            
    swinglow := swingD == 'On plot'or swingD == 'Both' label.new(x=int(temp_index_l),y=low[bar_index temp_index_l] - labpos*4color=labelcolortextcolor=PLtextcolor,
                             
    text 'Time : ' str.tostring(temp_index_l ph2index) + '\n' 'Distance : ' str.tostring(((low[bar_index temp_index_l]-high[bar_index ph2index])/high[bar_index ph2index]),'#.##'+'%'), size=size.small):na
                            distance 
    := (low[bar_index spl_loc]-high[bar_index ph2index])/high[bar_index ph2index]
                            array.
    push(lowstamp,distance), array.push(lowstampindex,bar_index int(temp_index_l)),array.push(seqswing,0), array.push(seqswing,distance), array.push(seqswing,bar_index int(temp_index_l))
                            
    connect2 := show2ndtrends == true line.new(x1 int(temp_index_l), y1 low[bar_index temp_index_l], x2 sph_locy2 high[bar_index sph_loc], color=SOPH_connect_color) : na,lines.push(connect2)
                            
    swinghigh := swingD == 'On plot'or swingD == 'Both' label.new(x=sph_loc,y=high[bar_index sph_loc] + labpos*4color=labelcolortextcolor=PHtextcolor,
                             
    text 'Time : ' str.tostring(sph_loc temp_index_l) + '\n' 'Distance : ' str.tostring(((high[bar_index sph_loc]-low[bar_index temp_index_l])/low[bar_index temp_index_l]),'#.##'+'%'), size=size.small):na
                            distance 
    := ((high[bar_index sph_loc]-low[bar_index pl2index])/low[bar_index pl2index])
                            array.
    push(highstamp,distance), array.push(highstampindex,sph_loc int(temp_index_l)),array.push(seqswing,1), array.push(seqswing,distance), array.push(seqswing,sph_loc int(temp_index_l))
                            
    connect2 := show2ndtrends == true line.new(x1 sph_locy1 high[bar_index -sph_loc], x2 spl_locy2 low[bar_index spl_loc], color=SOPL_connect_color) : na,lines.push(connect2)
                            
    swinglow := swingD == 'On plot'or swingD == 'Both' label.new(x=spl_loc,y=low[bar_index spl_loc] - labpos*4color=labelcolortextcolor=PLtextcolortext 'Time : ' str.tostring(spl_loc sph_loc) + '\n' 'Distance : ' +
                             
    str.tostring(((low[bar_index spl_loc]-high[bar_index sph_loc])/high[bar_index ph2index]),'#.##'+'%'), size=size.small):na
                            distance 
    := (low[bar_index spl_loc]-high[bar_index ph2index])/high[bar_index ph2index]
                            array.
    push(lowstamp,distance), array.push(lowstampindex,spl_loc sph_loc),array.push(seqswing,0), array.push(seqswing,distance), array.push(seqswing,spl_loc sph_loc)
                            array.
    clear(seqlows), array.push(seqlows,spl_loc),array.push(seqlowslow[bar_index spl_loc])
                            
    ph2index := sph_loc,ph2val := highbar_index sph_loc]
                            array.
    push(p2high_indexph2index),array.push(p2high_valph2val),array.clear(seqhighs),array.push(seqhighssph_loc),array.push(seqhighshigh[bar_index sph_loc]),array.clear(temp_l)
                            
    lastcheck2 := 'PL2',temp_val_l := na,temp_index_l := na
                    
                    
    if array.size(seqlows) == // Could be problems here
                        
    if high[bar_index sph_loc] > ph2val
                            line
    .delete(array.get(lines, array.size(lines) -1)), array.remove(lines, array.size(lines) - 1)
                            
    line.delete(array.get(lines, array.size(lines) -1)), array.remove(lines, array.size(lines) - 1),label.delete(swinghigh),array.pop(highstamp), array.pop(highstampindex),
                             array.
    pop(seqswing),array.pop(seqswing),array.pop(seqswing),array.pop(seqswing),array.pop(seqswing),array.pop(seqswing)
                            
    connect2 := show2ndtrends == true line.new(x1 = array.get(p2low_index,array.size(p2low_index)-2),
                             
    y1 low[bar_index - array.get(p2low_index,array.size(p2low_index)-2)], x2 sph_locy2 high[bar_index sph_loc], color=SOPH_connect_color) : na,lines.push(connect2)
                            
    swinghigh := swingD == 'On plot'or swingD == 'Both' label.new(x=sph_loc,y=high[bar_index sph_loc] + labpos*4color=labelcolortextcolor=PHtextcolor,
                             
    text 'Time : ' str.tostring(sph_loc - array.get(p2low_index,array.size(p2low_index)-2)) + '\n' 'Distance : ' +
                             
    str.tostring(((high[bar_index sph_loc]-low[bar_index - array.get(p2low_index,array.size(p2low_index)-2)])/low[bar_index - array.get(p2low_index,array.size(p2low_index)-2)]),'#.##'+'%'), size=size.small):na
                            distance 
    := (high[bar_index sph_loc]-low[bar_index - array.get(p2low_index,array.size(p2low_index)-2)])/low[bar_index - array.get(p2low_index,array.size(p2low_index)-2)]
                            
    // distance := (high[bar_index - sph_loc]-low[bar_index - pl2index])/low[bar_index - pl2index]
                            
    array.push(highstamp,distance), array.push(highstampindex,sph_loc - array.get(p2low_index,array.size(p2low_index)-2)),array.push(seqswing,1), array.push(seqswing,distance),
                             array.
    push(seqswing,sph_loc - array.get(p2low_index,array.size(p2low_index)-2))
                            
    connect2 := show2ndtrends == true line.new(x1 sph_locy1 high[bar_index sph_loc], x2 spl_locy2 low[bar_index spl_loc], color=SOPL_connect_color ) : na,lines.push(connect2)
                            
    swinglow := swingD == 'On plot'or swingD == 'Both' label.new(x=spl_loc,y=low[bar_index spl_loc] - labpos*4color=labelcolortextcolor=PLtextcolor,
                             
    text 'Time : ' str.tostring(spl_loc sph_loc) + '\n' 'Distance : ' str.tostring(((low[bar_index spl_loc]-high[bar_index sph_loc])/high[bar_index ph2index]),'#.##'+'%'), size=size.small):na
                            distance 
    := (low[bar_index spl_loc]-high[bar_index ph2index])/high[bar_index ph2index]
                            array.
    push(lowstamp,distance), array.push(lowstampindex,spl_loc sph_loc),array.push(seqswing,0), array.push(seqswing,distance), array.push(seqswing,spl_loc sph_loc)
                            
    ph2index := sph_loc,ph2val := high[bar_index sph_loc]
                            array.
    remove(p2high_index,array.size(p2high_index)-1),array.remove(p2high_val,array.size(p2high_val)-1),array.push(p2high_indexph2index),array.push(p2high_valph2val)
                        
            if 
    lastcheck2 == 'PH2'
                
    if sph_loc ph2index
                    
    if high[bar_index sph_loc] < ph2val
                        
    array.push(seqhighssph_loc),array.push(seqhighs,high[bar_index sph_loc])
                    if 
    high[bar_index sph_loc] >= ph2val
                        
    if array.size(lines)!=0
                            line
    .delete(array.get(lines, array.size(lines) -1)), array.remove(lines, array.size(lines) - 1),label.delete(swinghigh),array.pop(highstamp), array.pop(highstampindex),
                             array.
    pop(seqswing),array.pop(seqswing),array.pop(seqswing)
                        
    connect2 := show2ndtrends == true line.new(x1 pl2indexy1 low[bar_index pl2index], x2 sph_locy2 high[bar_index sph_loc], color=SOPH_connect_color) : na,lines.push(connect2)
                        
    swinghigh := swingD == 'On plot'or swingD == 'Both' label.new(x=sph_loc,y=high[bar_index sph_loc] + labpos*4color=labelcolortextcolor=PHtextcolor,
                         
    text 'Time : ' str.tostring(sph_loc pl2index) + '\n' 'Distance : ' str.tostring(((high[bar_index sph_loc]-low[bar_index pl2index])/low[bar_index pl2index]),'#.##'+'%'), size=size.small):na
                        distance 
    := ((high[bar_index sph_loc]-low[bar_index pl2index])/low[bar_index pl2index])
                        array.
    push(highstamp,distance),array.push(highstampindex,sph_loc pl2index),array.push(seqswing,1), array.push(seqswing,distance), array.push(seqswing,sph_loc pl2index)
                        array.
    push(seqhighs,sph_loc), array.push(seqhighshigh[bar_index sph_loc])
                        
    ph2index := sph_loc,ph2val := high[bar_index sph_loc]
                        array.
    remove(p2high_index,array.size(p2high_index)-1),array.remove(p2high_val,array.size(p2high_val)-1), array.push(p2high_indexph2index), array.push(p2high_valph2val)

            if 
    na(lastcheck2)
                
    ph2index := sph_locph2val := high[bar_index sph_loc]
                array.
    push(seqhighssph_loc),array.push(seqhighs,high[bar_index sph_loc]), array.push(p2high_indexph2index), array.push(p2high_valph2val)
                
    lastcheck2 := 'PH2'

            
    // third order pivot highs
            
    if secph1 secph2 and secph2 secph3 or secph1 == secph2 and secph2 secph3
                tph_loc 
    := array.get(secph_loc,1)
            if 
    secph1 secph2 and secph2 == secph3
                tph_loc 
    :=array.get(secph_loc,2)
            if (
    secph1 secph2 and secph2 secph3 or secph1 == secph2 and secph2 secph3) or (secph1 secph2 and secph2 == secph3)
                
    thirdpivothigh := showthirdpivots == true label.new(bar_index - (bar_index tph_loc), yhigh[bar_index tph_loc] + labpos[bar_index tph_loc]*style=TOPH_style_option,size=TOP_size,
                 
    color=TOPH_color) : na
                
    //code for connecting third order swings
                
    if lastcheck3 == 'PL3'
                    
    if tph_loc pl3index and high[bar_index tph_loc] > pl3val
                        connect3 
    := show3rdtrends == true line.new(x1 pl3indexy1 low[bar_index pl3index], x2 tph_locy2 high[bar_index tph_loc], color=TOPH_connect_color) : na
                        ph3index 
    := tph_locph3val := high[bar_index tph_loc]
                        
    lastcheck3 := "PH3"
                
    if lastcheck3 == 'PH3' and high[bar_index tph_loc] > ph3val
                    line
    .delete(connect3),connect3 := show3rdtrends == true line.new(x1 pl3indexy1 low[bar_index pl3index], x2 tph_locy2 =high[bar_index tph_loc], color=TOPH_connect_color) : na
                    ph3index 
    := tph_locph3val := high[bar_index tph_loc]
                if 
    na(lastcheck3)
                    
    ph3index := tph_locph3val := high[bar_index tph_loc]
                    
    lastcheck3 := 'PH3'

    // ----- PIVOT LOWS ----- //
    if not na(pl)
        if 
    showfirstpivots == true 
            label
    .new(x=bar_index pivotbars,yna(labpos) ? low[pivotbars] - syminfo.mintick*250 low[pivotbars] - labposstyle=FOPH_style_optionsize=FOP_size,color=FOPL_color)
        
    lowprice := low[pivotbars]
        
    //set price arrays
        
    array.push(lowslow[pivotbars]),array.set(lows0, array.get(lows1)),array.set(lows1, array.get(lows2)),array.set(lows2low[pivotbars])
        
    // set index arrays
        
    array.push(pl_loc,bar_index[pivotbars]),array.set(pl_loc0, array.get(pl_loc1)),array.set(pl_loc1, array.get(pl_loc2)), array.set(pl_loc2bar_index[pivotbars])
        
    // set comparison values
        
    pl1 := array.get(lows,0),pl2 := array.get(lows,1),pl3 := array.get(lows,2)
        
    //first order swing connections
        
    if lastcheck1 == 'PH1' or na(lastcheck1)
            if 
    ph1index !=and low[pivotbars] < ph1val
                lookback1 
    := bar_index ph1index
                connect1 
    := show1sttrends == true line.new(x1 ph1indexy1 high[lookback1],x2bar_index-pivotbarsy2=low[pivotbars], color=FOPL_connect_color ) : na 
                lastcheck1 
    := 'PL1'
                
    pl1val := low[pivotbars]
            
    pl1index := bar_index pivotbars
        
    if lastcheck1 == 'PL1' and low[pivotbars] < pl1val
            line
    .delete(connect1)
            
    lookback1 := bar_index ph1index
            connect1 
    := show1sttrends == true line.new(x1 ph1indexy1 high[lookback1],x2bar_index-pivotbarsy2=low[pivotbars], color=FOPL_connect_color ) : na 
            pl1val 
    := low[pivotbars]
            
    pl1index := bar_index pivotbars

        
    //second order pivot lows
        
    if (pl1 pl2 and pl2 pl3) or (pl1 == pl2 and pl2 pl3)
            
    spl_loc := array.get(pl_loc,1)
        if 
    pl1 pl2 and pl2 == pl3
            spl_loc 
    := array.get(pl_loc,2)
        if ((
    pl1 pl2 and pl2 pl3) or (pl1 == pl2 and pl2 pl3) ) or (pl1 pl2 and pl2 == pl3)
            
    //set price arrays
            
    array.push(seclowslow[bar_index spl_loc]),array.set(seclows,0,array.get(seclows,1)),array.set(seclows,1,array.get(seclows,2)),array.set(seclows2low[bar_index spl_loc])
            
    //set index arrays
            
    array.push(secpl_locbar_index[bar_index spl_loc]),array.set(secpl_loc,0,array.get(secpl_loc,1)),array.set(secpl_loc,1,array.get(secpl_loc,2)),array.set(secpl_loc2bar_index[bar_index spl_loc])
            
    //set comparison values
            
    secpl1 := array.get(seclows,0),secpl2 := array.get(seclows,1),secpl3 := array.get(seclows,2)
            
    // label
            
    secondpivotlow := showsecondpivots == true label.new(bar_index - (bar_index spl_loc), ylow[bar_index spl_loc] - labpos[(bar_index spl_loc)]*style=SOPL_style_optionsize=SOP_sizecolor=SOPL_color) : na

        
    // second order pivot low swing connections
            
    if lastcheck2 == 'PH2'
                
    if spl_loc ph2index
                    
    if low[bar_index spl_loc] < ph2val
                        connect2 
    := show2ndtrends == true line.new(x1 ph2indexy1 high[bar_index ph2index], x2 spl_locy2 low[bar_index spl_loc], color=SOPL_connect_color) : na,lines.push(connect2)
                        
    swinglow := swingD == 'On plot'or swingD == 'Both' label.new(x=spl_loc,y=low[bar_index spl_loc] - labpos*4color=labelcolortextcolor=PLtextcolor,
                         
    text 'Time : ' str.tostring(spl_loc ph2index) + '\n' 'Distance : ' str.tostring(((low[bar_index spl_loc]-high[bar_index ph2index])/high[bar_index ph2index]),'#.##'+'%'), size=size.small):na
                        distance 
    := (low[bar_index spl_loc]-high[bar_index ph2index])/high[bar_index ph2index]
                        array.
    push(lowstamp,distance),array.push(lowstampindex,spl_loc ph2index), array.push(seqswing,0), array.push(seqswing,distance), array.push(seqswing,spl_loc ph2index)
                        array.
    clear(seqlows),array.push(seqlows,spl_loc),array.push(seqlowslow[bar_index spl_loc])
                        
    pl2index := spl_loc,pl2val := low[bar_index spl_loc]
                        array.
    push(p2low_indexpl2index),array.push(p2low_valpl2val)
                        
    lastcheck2 := 'PL2'
                    
    if low[bar_index spl_loc] > ph2val
                        
    array.push(seqlowsspl_loc),array.push(seqlows,low[bar_index spl_loc])
                    if 
    spl_loc sph_loc
                        connect2 
    := show2ndtrends == true line.new(x1 spl_locy1 low[bar_index spl_loc], x2 sph_locy2 high[bar_index sph_loc], color=SOPH_connect_color) : na,lines.push(connect2)
                        
    swinghigh := swingD == 'On plot'or swingD == 'Both' label.new(x=sph_loc,y=high[bar_index sph_loc] + labpos*4color=labelcolortextcolor=PHtextcolor,
                         
    text 'Time : ' str.tostring(sph_loc pl2index) + '\n' 'Distance : ' str.tostring(((high[bar_index sph_loc]-low[bar_index pl2index])/low[bar_index pl2index]),'#.##'+'%'), size=size.small):na
                        distance 
    := ((high[bar_index sph_loc]-low[bar_index pl2index])/low[bar_index pl2index])
                        array.
    push(highstamp,distance),array.push(highstampindex,sph_loc pl2index),array.push(seqswing,1), array.push(seqswing,distance), array.push(seqswing,sph_loc pl2index)
                        
    ph2index := sph_loc,ph2val := high[bar_index sph_loc]
                        
    lastcheck2 := 'PH2'
                        
    array.clear(seqhighs),array.push(seqhighs,sph_loc),array.push(seqhighshigh[bar_index sph_loc])

                if 
    spl_loc ph2index
                    
    if array.size(seqhighs) > and array.size(lines)!=0
                        
    if array.get(seqhighs, array.size(seqhighs) - 2) > spl_loc
                            
    array.pop(seqhighs), array.pop(seqhighs)
                        if array.
    size(seqhighs) > 2
                            
    for 1 to array.size(seqhighsby 2
                                
    array.push(temp_h, array.get(seqhighs,i))
                            
    temp_val_h := array.max(temp_h),temp_index_h := array.get(seqhighs, (array.indexof(seqhighstemp_val_h)-1))
                        if array.
    size(seqhighs) == 2
                            temp_val_h 
    := array.get(seqhighs,1),temp_index_h := array.get(seqhighs,0)
                        if 
    temp_val_h low[bar_index spl_loc
                            
    line.delete(array.get(lines, array.size(lines) -1)), array.remove(lines, array.size(lines) - 1), array.pop(highstamp), array.pop(highstampindex), label.delete(swinghigh),
                             array.
    pop(seqswing),array.pop(seqswing),array.pop(seqswing)
                            
    connect2 := show2ndtrends == true line.new(x1 pl2indexy1 low[bar_index pl2index], x2 int(temp_index_h), y2 high[bar_index temp_index_h], color=SOPH_connect_color ) : na,lines.push(connect2)
                            
    swinghigh := swingD == 'On plot'or swingD == 'Both' label.new(x=int(temp_index_h),y=high[bar_index temp_index_h] + labpos*4color=labelcolortextcolor=PHtextcolor,
                             
    text 'Time : ' str.tostring(temp_index_h pl2index) + '\n' 'Distance : ' str.tostring(((high[bar_index temp_index_h]-low[bar_index pl2index])/low[bar_index pl2index]),'#.##'+'%'), size=size.small):na
                            distance 
    := ((high[bar_index temp_index_h]-low[bar_index pl2index])/low[bar_index pl2index])
                            array.
    push(highstamp,distance),array.push(highstampindex,int(temp_index_h) - pl2index),array.push(seqswing,1), array.push(seqswing,distance), array.push(seqswing,int(temp_index_h) - pl2index)
                            
    connect2 := show2ndtrends == true line.new(x1 int(temp_index_h), y1 high[bar_index temp_index_h], x2 spl_locy2 low[bar_index spl_loc], color=SOPL_connect_color) : na,lines.push(connect2)
                            
    swinglow := swingD == 'On plot'or swingD == 'Both' label.new(x=spl_loc,y=low[bar_index spl_loc] - labpos*4color=labelcolortextcolor=PHtextcolor,
                             
    text 'Time : ' str.tostring(spl_loc temp_index_h) + '\n' 'Distance : ' str.tostring(((low[bar_index spl_loc]-high[bar_index temp_index_h])/high[bar_index temp_index_h]),'#.##'+'%'), size=size.small):na
                            distance 
    := (low[bar_index spl_loc]-high[bar_index ph2index])/high[bar_index ph2index]
                            array.
    push(lowstamp,distance),array.push(lowstampindex,spl_loc int(temp_index_h)),array.push(seqswing,0), array.push(seqswing,distance), array.push(seqswing,spl_loc int(temp_index_h))
                            
    connect2 := show2ndtrends == true line.new(x1 spl_locy1 low[bar_index -spl_loc], x2 sph_locy2 high[bar_index sph_loc], color=SOPH_connect_color) : na,lines.push(connect2)
                            
    swinghigh := swingD == 'On plot'or swingD == 'Both' label.new(x=sph_loc,y=high[bar_index sph_loc] + labpos*4color=labelcolortextcolor=PHtextcolor,
                             
    text 'Time : ' str.tostring(sph_loc spl_loc) + '\n' 'Distance : ' str.tostring(((high[bar_index sph_loc]-low[bar_index spl_loc])/low[bar_index pl2index]),'#.##'+'%'), size=size.small):na
                            distance 
    := ((high[bar_index sph_loc]-low[bar_index spl_loc])/low[bar_index spl_loc])
                            array.
    push(highstamp,distance), array.push(highstampindex,sph_loc spl_loc),array.push(seqswing,1), array.push(seqswing,distance), array.push(seqswing,sph_loc spl_loc)
                            array.
    clear(seqhighs),array.push(seqhighssph_loc),array.push(seqhighshigh[bar_index sph_loc])
                            
    pl2index := spl_loc,pl2val := low[bar_index spl_loc]
                            array.
    push(p2low_indexpl2index),array.push(p2low_valpl2val),array.clear(seqlows),array.push(seqlowsspl_loc),array.push(seqlowslow[bar_index spl_loc]),array.clear(temp_h)
                            
    lastcheck2 := 'PH2'
                            
    temp_val_h := na,temp_index_h := na

                    
    if array.size(seqhighs) == 2
                        
    if low[bar_index spl_loc] < pl2val
                            line
    .delete(array.get(lines, array.size(lines) -1)), array.remove(lines, array.size(lines) - 1)
                            
    line.delete(array.get(lines, array.size(lines) -1)), array.remove(lines, array.size(lines) - 1),label.delete(swinglow),array.pop(lowstamp), array.pop(lowstampindex),label.delete(swinghigh),array.pop(highstamp),
                             array.
    pop(highstampindex),array.pop(seqswing),array.pop(seqswing),array.pop(seqswing),array.pop(seqswing),array.pop(seqswing),array.pop(seqswing)
                            
    connect2 := show2ndtrends == true line.new(x1 = array.get(p2high_index,array.size(p2high_index)-2),
                             
    y1 high[bar_index - array.get(p2high_index,array.size(p2high_index)-2)], x2 spl_locy2 low[bar_index spl_loc], color=SOPL_connect_color) : na,lines.push(connect2)
                            
    swinglow := swingD == 'On plot'or swingD == 'Both' label.new(x=spl_loc,y=low[bar_index spl_loc] - labpos*4color=labelcolortextcolor=PLtextcolor,
                             
    text 'Time : ' str.tostring(spl_loc - array.get(p2high_index,array.size(p2high_index)-2)) + '\n' 'Distance : ' +
                             
    str.tostring(((low[bar_index spl_loc]-high[bar_index - array.get(p2high_index,array.size(p2high_index)-2)])/high[bar_index - array.get(p2high_index,array.size(p2high_index)-2)]),'#.##'+'%'), size=size.small):na
                            distance 
    := (low[bar_index spl_loc]-high[bar_index - array.get(p2high_index,array.size(p2high_index)-2)])/high[bar_index - array.get(p2high_index,array.size(p2high_index)-2)]
                            array.
    push(lowstamp,distance), array.push(lowstampindex,spl_loc - array.get(p2high_index,array.size(p2high_index)-2)),
                            array.
    push(seqswing,0), array.push(seqswing,distance), array.push(seqswing,spl_loc - array.get(p2high_index,array.size(p2high_index)-2))
                            
    connect2 := show2ndtrends == true line.new(x1 spl_locy1 low[bar_index spl_loc], x2 sph_locy2 high[bar_index sph_loc], color=SOPH_connect_color ) : na,lines.push(connect2)
                            
    swinghigh := swingD == 'On plot'or swingD == 'Both' label.new(x=sph_loc,y=high[bar_index sph_loc] + labpos*4color=labelcolortextcolor=PHtextcolor,
                             
    text 'Time : ' str.tostring(sph_loc spl_loc) + '\n' 'Distance : ' str.tostring(((high[bar_index sph_loc]-low[bar_index spl_loc])/low[bar_index spl_loc]),'#.##'+'%'), size=size.small):na
                            distance 
    := ((high[bar_index sph_loc]-low[bar_index spl_loc])/low[bar_index spl_loc])
                            array.
    push(highstamp,distance), array.push(highstampindex,sph_loc spl_loc),array.push(seqswing,1), array.push(seqswing,distance), array.push(seqswing,sph_loc spl_loc)
                            
    pl2index := spl_loc,pl2val := low[bar_index spl_loc]
                            array.
    remove(p2low_index,array.size(p2low_index)-1),array.remove(p2low_val,array.size(p2low_val)-1),array.push(p2low_indexpl2index),array.push(p2low_valpl2val)

            if 
    lastcheck2 == 'PL2'
                
    if spl_loc pl2index
                    
    if low[bar_index spl_loc] > pl2val
                        
    array.push(seqlowsspl_loc),array.push(seqlows,low[bar_index spl_loc])
                    if 
    low[bar_index spl_loc] <= pl2val
                        
    if array.size(lines)!=0
                            line
    .delete(array.get(lines, array.size(lines) -1)), array.remove(lines, array.size(lines) - 1),label.delete(swinglow),array.pop(lowstamp),array.pop(lowstampindex),
                             array.
    pop(seqswing),array.pop(seqswing),array.pop(seqswing)
                        
    connect2 := show2ndtrends == true line.new(x1 ph2indexy1 high[bar_index ph2index], x2 spl_locy2 low[bar_index spl_loc], color=SOPL_connect_color) : na,lines.push(connect2)
                        
    swinglow := swingD == 'On plot'or swingD == 'Both' label.new(x=spl_loc,y=low[bar_index spl_loc] - labpos*4color=labelcolortextcolor=PLtextcolor,
                         
    text 'Time : ' str.tostring(spl_loc ph2index) + '\n' 'Distance : ' str.tostring(((low[bar_index spl_loc]-high[bar_index ph2index])/high[bar_index ph2index]),'#.##'+'%'), size=size.small):na
                        distance 
    := (low[bar_index spl_loc]-high[bar_index ph2index])/high[bar_index ph2index]
                        array.
    push(lowstamp,distance),array.push(lowstampindex,spl_loc ph2index),array.push(seqswing,0), array.push(seqswing,distance), array.push(seqswing,spl_loc ph2index)
                        array.
    push(seqlows,spl_loc),array.push(seqlowslow[bar_index spl_loc])
                        
    pl2index := spl_loc,pl2val := low[bar_index spl_loc]
                        array.
    remove(p2low_index,array.size(p2low_index)-1),array.remove(p2low_val,array.size(p2low_val)-1),array.push(p2low_indexpl2index),array.push(p2low_valpl2val)
                        if 
    sph_loc pl2index // Problem here
                            
    connect2 := show2ndtrends == true line.new(x1 spl_locy1 low[bar_index spl_loc], x2 sph_locy2 high[bar_index sph_loc], color=color.blue) : na,lines.push(connect2)
                            array.
    clear(seqhighs),array.push(seqhighs,sph_loc),array.push(seqhighshigh[bar_index sph_loc])
                            
    ph2index := sph_loc,ph2val := high[bar_index sph_loc]
                            array.
    push(p2high_indexph2index),array.push(p2high_valph2val)
                            
    lastcheck2 := 'PH2'

            
    if na(lastcheck2)
                
    pl2index := spl_loc,pl2val := low[bar_index spl_loc]
                array.
    push(seqlowsspl_loc),array.push(seqlows,low[bar_index spl_loc]),array.push(p2low_indexpl2index),array.push(p2low_valpl2val)
                
    lastcheck2 := 'PL2'

            
    // third order pivot low
            
    if secpl1 secpl2 and secpl2 secpl3 or secpl1 == secpl2 and secpl2 secpl3
                tpl_loc 
    := array.get(secpl_loc,1)
            if 
    secpl1 secpl2 and secpl2 == secpl3
                tpl_loc 
    :=array.get(secpl_loc,2)
            if (
    secpl1 secpl2 and secpl2 secpl3 or secpl1 == secpl2 and secpl2 secpl3) or (secpl1 secpl2 and secpl2 == secpl3)
                
    thirdpivotlow := showthirdpivots == true ?
                 
    label.new(bar_index - (bar_index tpl_loc), ylow[(bar_index tpl_loc)] - labpos[(bar_index tpl_loc)]*3style=TOPL_style_option,size=TOP_size,color=TOPL_color) : na
                
    //code for connecting third order swings
                
    if lastcheck3 == 'PH3'
                    
    if tpl_loc ph3index and low[bar_index tpl_loc] < ph3val
                        connect3 
    := show3rdtrends == true line.new(x1 ph3indexy1 high[bar_index ph3index], x2 tpl_locy2 low[bar_index tpl_loc], color=TOPL_connect_color) : na
                        pl3index 
    := tpl_locpl3val := low[bar_index tpl_loc]
                        
    lastcheck3 := 'PL3'
                
    if lastcheck3 == 'PL3' and low[bar_index tpl_loc] < pl3val
                    line
    .delete(connect3), connect3 := show3rdtrends == true line.new(x1 ph3indexy1 high[bar_index ph3index], x2 tpl_locy2 low[bar_index tpl_loc], color=TOPL_connect_color) : na
                    pl3index 
    := tpl_locpl3val := low[bar_index tpl_loc]
                if 
    na(lastcheck3)
                    
    pl3index := tpl_locpl3val := low[bar_index tpl_loc]
                    
    lastcheck3 := 'PL3'

    // color coding

    if high hiprice
        trend 
    := 'up'
    if low lowprice 
        trend 
    :='down'
    barcolor(colorbars == true ?trend=='up'upday ?  uptrendup:uptrenddown trend == 'down'upday downtrendup:downtrenddowncolor.gray na)

    if 
    barstate.islast
        
    if array.size(highstamp) >= and array.size(lowstamp) >=and swingD == 'In table' or swingD == 'Both'
            
    table.cell(swings,1,0,bgcolor=labelcolortext_color=color.rgb(7777), text=' Pivot Highs'text_size=size.small
            
    table.cell(swings,1,1,bgcolor labelcolortext_color PHtextcolortext='Duration',text_valign text.align_centertext_size size.small)
            
    table.cell(swings,2,1,bgcolor labelcolortext_color PHtextcolortext='Distance',text_valign text.align_centertext_size size.small)
            
    // table.cell(swings,3,1,bgcolor = color.white, text_color = color.green, text='Sequence',text_valign = text.align_center, text_size = size.small)

            
    table.cell(swings,1,2bgcolor=labelcolortext_color=PHtextcolortext=str.tostring(array.get(highstampindex,array.size(highstampindex)-3)))
            
    table.cell(swings,2,2bgcolor=labelcolortext_color=PHtextcolortext=str.tostring(array.get(highstamp,array.size(highstamp)-3),'#.##''%'))
            
    // table.cell(swings,3,2, bgcolor=color.white, text_color=color.green, text = )
            
    table.cell(swings,1,3bgcolor=labelcolortext_color=PHtextcolortext=str.tostring(array.get(highstampindex,array.size(highstampindex)-2)))
            
    table.cell(swings,2,3bgcolor=labelcolortext_color=PHtextcolortext=str.tostring(array.get(highstamp,array.size(highstamp)-2),'#.##''%'))

            
    table.cell(swings,1,4bgcolor=labelcolortext_color=PHtextcolortext=str.tostring(array.get(highstampindex,array.size(highstampindex)-1)))
            
    table.cell(swings,2,4bgcolor=labelcolortext_color=PHtextcolortext=str.tostring(array.get(highstamp,array.size(highstamp)-1),'#.##''%'))

            
    table.cell(swings,1,5,bgcolor=labelcolortext_color=color.rgb(1343852), text=' Pivot Lows'text_size=size.small)
            
    table.cell(swings,1,6,bgcolor labelcolortext_color PLtextcolortext='Duration',text_valign text.align_centertext_size size.small)
            
    table.cell(swings,2,6,bgcolor labelcolortext_color PLtextcolortext='Distance',text_valign text.align_centertext_size size.small)
            
    table.cell(swings,1,7bgcolor=labelcolortext_color=PLtextcolortext=str.tostring(array.get(lowstampindex,array.size(lowstampindex)-3)))
            
    table.cell(swings,2,7bgcolor=labelcolortext_color=PLtextcolortext=str.tostring(array.get(lowstamp,array.size(lowstamp)-3),'#.##''%'))

            
    table.cell(swings,1,8bgcolor=labelcolortext_color=PLtextcolortext=str.tostring(array.get(lowstampindex,array.size(lowstampindex)-2)))
            
    table.cell(swings,2,8bgcolor=labelcolortext_color=PLtextcolortext=str.tostring(array.get(lowstamp,array.size(lowstamp)-2),'#.##''%'))

            
    table.cell(swings,1,9bgcolor=labelcolortext_color=PLtextcolortext=str.tostring(array.get(lowstampindex,array.size(lowstampindex)-1)))
            
    table.cell(swings,2,9bgcolor=labelcolortext_color=PLtextcolortext=str.tostring(array.get(lowstamp,array.size(lowstamp)-1),'#.##''%'))

            
    table.cell(swings,1,10bgcolor=labelcolortext_color color.rgb(33184243), text 'Sequence Swings'text_size size.smalltext_halign text.align_right )
            
    table.cell(swings,1,11bgcolor=labelcolortext_color=color.rgb(33184243), text 'Duration'text_size size.small)
            
    table.cell(swings,2,11bgcolor=labelcolortext_color=color.rgb(33184243), text 'Distance'text_size size.small)

            
    table.cell(swings,1,13bgcolor=labelcolor,text_color= array.get(seqswing,array.size(seqswing)-15) == PHtextcolor:PLtextcolortext=str.tostring(array.get(seqswing,array.size(seqswing)-13)))
            
    table.cell(swings,2,13bgcolor=labelcolor,text_color= array.get(seqswing,array.size(seqswing)-15) == PHtextcolor:PLtextcolortext=str.tostring(array.get(seqswing,array.size(seqswing)-14),'#.##'+'%'))
            
    table.cell(swings,1,14bgcolor=labelcolor,text_color= array.get(seqswing,array.size(seqswing)-12) == PHtextcolor:PLtextcolortext=str.tostring(array.get(seqswing,array.size(seqswing)-10)))
            
    table.cell(swings,2,14bgcolor=labelcolor,text_color= array.get(seqswing,array.size(seqswing)-12) == PHtextcolor:PLtextcolortext=str.tostring(array.get(seqswing,array.size(seqswing)-11),'#.##'+'%'))
            
    table.cell(swings,1,15bgcolor=labelcolor,text_color= array.get(seqswing,array.size(seqswing)-9) == PHtextcolor:PLtextcolortext=str.tostring(array.get(seqswing,array.size(seqswing)-7)))
            
    table.cell(swings,2,15bgcolor=labelcolor,text_color= array.get(seqswing,array.size(seqswing)-9) == PHtextcolor:PLtextcolortext=str.tostring(array.get(seqswing,array.size(seqswing)-8),'#.##'+'%'))
            
    table.cell(swings,1,16bgcolor=labelcolor,text_color= array.get(seqswing,array.size(seqswing)-6) == PHtextcolor:PLtextcolortext=str.tostring(array.get(seqswing,array.size(seqswing)-4)))
            
    table.cell(swings,2,16bgcolor=labelcolor,text_color= array.get(seqswing,array.size(seqswing)-6) == PHtextcolor:PLtextcolortext=str.tostring(array.get(seqswing,array.size(seqswing)-5),'#.##'+'%'))
            
    table.cell(swings,1,17bgcolor=labelcolor,text_color= array.get(seqswing,array.size(seqswing)-3) == PHtextcolor:PLtextcolortext=str.tostring(array.get(seqswing,array.size(seqswing)-1)))
            
    table.cell(swings,2,17bgcolor=labelcolor,text_color= array.get(seqswing,array.size(seqswing)-3) == PHtextcolor:PLtextcolortext=str.tostring(array.get(seqswing,array.size(seqswing)-2),'#.##'+'%'))
    //////////
    // This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © dg_factor

    //@version=5

    string tt  "The script does not contain any security calls.
     If there are not enough bars on the chart, the result may not be displayed. You can try higher timeframes."
    sh_monday  input.bool(false"Monday ")
    sh_daily   input.bool(false"Daily ")
    sh_weekly  input.bool(true"Weekly ",  tooltip=tt)
    sh_monthly input.bool(false"Monthly "tooltip=tt)

    sh_ln input.bool(true"Line ",  group="DISPLAY")
    sh_tx input.bool(true"Text ",  group="DISPLAY")
    sh_pr input.bool(true"Price "group="DISPLAY")
    col_1 input.color(#2962ff, "Color", inline="c", group="DISPLAY")
    col_2 input.color(#00bb00, "", inline="c", group="DISPLAY")
    col_3 input.color(#fb0000, "", inline="c", group="DISPLAY")
    col_4 input.color(#9C27B0, "", inline="c", group="DISPLAY")

    p(xyct) =>
        var 
    line ln naline.delete(ln)
        var 
    label lb nalabel.delete(lb)
        
    ln := sh_ln line.new(xytimeyxloc.bar_timecolor=c) : na
        t1 
    sh_tx nat2 sh_pr " [" str.tostring(yformat.mintick) + "]" na
        lb 
    := label.new(timeyt1 t2xloc.bar_timeyloc.price,
         
    #00000000, label.style_label_left, c, size.normal, text.align_right)
    //

    f(xt) =>
        
    and not x[1]
        
    not x and x[1]    
        
    o  ta.valuewhen(sopen0)
        var 
    h1 0.0h1 := fixnan(not x na or high math.max(highh1))
        var 
    l1 0.0l1 := fixnan(not x na or low  math.min(low,  l1))
        var 
    h2 0.0h2 := high math.max(highh2)
        var 
    l2 0.0l2 := low  math.min(low,  l2)
        
    == "Monday" h1 h2
        l 
    == "Monday" l1 l2
        m  
    math.avg(hl)
        
    ot ta.valuewhen(stime0)
        
    ht ta.valuewhen(h==hightime0)
        
    lt ta.valuewhen(l==lowtime0)
        
    mt math.max(htlt)
        
    p(otocol_1sh_tx " Açılış" na)
        
    p(hthcol_2sh_tx " Yüksek" na)
        
    p(ltlcol_3sh_tx " Düşük"  na)
        
    p(mtmcol_4sh_tx " Ortalama"  na)
    //

    if sh_monday
        f
    (dayofweek == dayofweek.monday"HaftaBaşı")    
    if 
    sh_daily
        f
    (time_tradingday != time_tradingday[1], "Günlük")
    if 
    sh_weekly
        f
    (dayofweek dayofweek[1], "Haftalık")
    if 
    sh_monthly
        f
    (dayofmonth dayofmonth[1], "Aylık")
    ///////// 
    https://www.tradingview.com/x/vSRf1nAF/
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

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

    //@version=5
    indicator("OHLC"overlay=true)

    string tt  "The script does not contain any security calls.
     If there are not enough bars on the chart, the result may not be displayed. You can try higher timeframes."
    sh_monday  input.bool(false"Monday ")
    sh_daily   input.bool(false"Daily ")
    sh_weekly  input.bool(true"Weekly ",  tooltip=tt)
    sh_monthly input.bool(false"Monthly "tooltip=tt)

    sh_ln input.bool(true"Line ",  group="DISPLAY")
    sh_tx input.bool(true"Text ",  group="DISPLAY")
    sh_pr input.bool(true"Price "group="DISPLAY")
    col_1 input.color(#2962ff, "Color", inline="c", group="DISPLAY")
    col_2 input.color(#00bb00, "", inline="c", group="DISPLAY")
    col_3 input.color(#fb0000, "", inline="c", group="DISPLAY")
    col_4 input.color(#9C27B0, "", inline="c", group="DISPLAY")

    p(xyct) =>
        var 
    line ln naline.delete(ln)
        var 
    label lb nalabel.delete(lb)
        
    ln := sh_ln line.new(xytimeyxloc.bar_timecolor=c) : na
        t1 
    sh_tx nat2 sh_pr " [" str.tostring(yformat.mintick) + "]" na
        lb 
    := label.new(timeyt1 t2xloc.bar_timeyloc.price,
         
    #00000000, label.style_label_left, c, size.normal, text.align_right)
    //

    f(xt) =>
        
    and not x[1]
        
    not x and x[1]    
        
    o  ta.valuewhen(sopen0)
        var 
    h1 0.0h1 := fixnan(not x na or high math.max(highh1))
        var 
    l1 0.0l1 := fixnan(not x na or low  math.min(low,  l1))
        var 
    h2 0.0h2 := high math.max(highh2)
        var 
    l2 0.0l2 := low  math.min(low,  l2)
        
    == "Monday" h1 h2
        l 
    == "Monday" l1 l2
        m  
    math.avg(hl)
        
    ot ta.valuewhen(stime0)
        
    ht ta.valuewhen(h==hightime0)
        
    lt ta.valuewhen(l==lowtime0)
        
    mt math.max(htlt)
        
    p(otocol_1sh_tx " Açılış" na)
        
    p(hthcol_2sh_tx " Yüksek" na)
        
    p(ltlcol_3sh_tx " Düşük"  na)
        
    p(mtmcol_4sh_tx " Ortalama"  na)
    //

    if sh_monday
        f
    (dayofweek == dayofweek.monday"HaftaBaşı")    
    if 
    sh_daily
        f
    (time_tradingday != time_tradingday[1], "Günlük")
    if 
    sh_weekly
        f
    (dayofweek dayofweek[1], "Haftalık")
    if 
    sh_monthly
        f
    (dayofmonth dayofmonth[1], "Aylık")
    //
    //@version=5

    // Input parameters
    length_high input.int(20title="High Length"minval=1)
    length_low input.int(20title="Low Length"minval=1)
    length_ema input.int(20title="EMA Length"minval=1)


    // Calculate high and low within specified lengths
    high_price ta.highest(length_high)
    low_price ta.lowest(length_low)

    median_price = (high_price low_price) / 2

    // Calculate EMAs for median price
    ema_median ta.ema(median_pricelength_ema)

    plot(median_pricecolor=color.rgb(193253), style=plot.style_steplinelinewidth=1title="Median")
    plot(ema_mediancolor=color.rgb(2472433), style=plot.style_steplinelinewidth=1title="EMAMedian"
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  5. #29
     Alıntı Originally Posted by KPL Yazıyı Oku
    ...

    önce 69 üstüne oturalım, becerirsek 82 ve 102 görünecek ama arada zor bi yer de olacak.
    uzaktan 82 göründü. 75+ civarı biraz çetrefilli.
    69 altı istemiyoruz tabi

  6. #30
    kamalandık gibi, umarım bozar yoksa 69 altına savrulabilir yine

  7. #31
     Alıntı Originally Posted by KPL Yazıyı Oku
    kamalandık gibi, umarım bozar yoksa 69 altına savrulabilir yine
    kama çalıştı diyebiliriz
    kriptoda oluşup da çalışmayan nadir oldu şimdiye dek gördüklerimden, genelde güvenilir ama kriptoda %90 filan gidiyor..
    TA ilgiliyseniz çalışınız, biliniz. bir anlamda 69-59 satışının etkisinden kurtulamadık.


  8. https://www.tradingview.com/x/H1yJ7vXz/
    44den başlayan 73kusurla bitti....
    58 hem pivot hem mom....
    65 range kanalı kırılacak daha.....sonra 58e.....
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

Sayfa 4/12 İlkİlk ... 23456 ... 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
  •