Sayfa 372/440 İlkİlk ... 272322362370371372373374382422 ... SonSon
Arama sonucu : 3515 madde; 2,969 - 2,976 arası.

Konu: Gold Rush


  1. saatlik pivota...seanslık kanallama.....ve sağ 5...sol 3...işaretleme....
    PHP Code:
     //@version=5

    indicator(title='Pivot Points High Low Extension'shorttitle='.'overlay=true)


    pvtLenL input.int(5minval=1title='Pivot Length Left Hand Side')
    pvtLenR input.int(3minval=1title='Pivot Length Right Hand Side')
    maxLvlLen input.int(0minval=0title='Maximum Extension Length')
    ShowHHLL input(falsetitle='Show HH,LL,LH,HL Markers On Pivots Points')
    WaitForClose input(falsetitle='Wait For Candle Close Before Printing Pivot')


    // Get High and Low Pivot Points
    pvthi_ ta.pivothigh(highpvtLenLpvtLenR)
    pvtlo_ ta.pivotlow(lowpvtLenLpvtLenR)

    // Force Pivot completion before plotting.
    Shunt WaitForClose 0
    pvthi 
    pvthi_[Shunt]
    pvtlo pvtlo_[Shunt]

    //  ||-----------------------------------------------------------------------------------------------------||
    //  ||---   Higher Highs, Lower Highs, Higher Lows, Lower Lows  -------------------------------------------||
    valuewhen_1 ta.valuewhen(pvthihigh[pvtLenR Shunt], 1)
    valuewhen_2 ta.valuewhen(pvthihigh[pvtLenR Shunt], 0)
    higherhigh na(pvthi) ? na valuewhen_1 valuewhen_2 pvthi na
    valuewhen_3 
    ta.valuewhen(pvthihigh[pvtLenR Shunt], 1)
    valuewhen_4 ta.valuewhen(pvthihigh[pvtLenR Shunt], 0)
    lowerhigh na(pvthi) ? na valuewhen_3 valuewhen_4 pvthi na
    valuewhen_5 
    ta.valuewhen(pvtlolow[pvtLenR Shunt], 1)
    valuewhen_6 ta.valuewhen(pvtlolow[pvtLenR Shunt], 0)
    higherlow na(pvtlo) ? na valuewhen_5 valuewhen_6 pvtlo na
    valuewhen_7 
    ta.valuewhen(pvtlolow[pvtLenR Shunt], 1)
    valuewhen_8 ta.valuewhen(pvtlolow[pvtLenR Shunt], 0)
    lowerlow na(pvtlo) ? na valuewhen_7 valuewhen_8 pvtlo na

    plot
    (not ShowHHLL pvthi natitle='PH *'style=plot.style_cross, ****=falsecolor=color.new(color.red0), offset=-pvtLenR Shuntlinewidth=4)
    plot(not ShowHHLL pvtlo natitle='PL *'style=plot.style_cross, ****=falsecolor=color.new(color.lime0), offset=-pvtLenR Shuntlinewidth=4)


    width input.int(1minval=1)
    xHigh request.security(syminfo.tickerid'60'high[1])
    xLow request.security(syminfo.tickerid'60'low[1])
    xClose request.security(syminfo.tickerid'15'close[1])
    vPP = (xHigh xLow xClose) / 3
    vR1 
    vPP vPP xLow
    vS1 
    vPP - (xHigh vPP)
    vR2 vPP xHigh xLow
    vS2 
    vPP - (xHigh xLow)
    vR3 xHigh * (vPP xLow)
    vS3 xLow * (xHigh vPP)
    plot(vS1color=color.new(#ff0000, 100), title='S1', style=plot.style_steplinebr, linewidth=width)
    plot(vS2color=color.new(#ff002a, 100), title='S2', style=plot.style_steplinebr, linewidth=width)
    plot(vS3color=color.new(#ff014a, 100), title='S3', style=plot.style_steplinebr, linewidth=width)
    plot(vR1color=color.new(#009600, 100), title='R1', style=plot.style_steplinebr, linewidth=width)
    plot(vR2color=color.new(#006F00, 100), title='R2', style=plot.style_steplinebr, linewidth=width)
    plot(vR3color=color.new(#004900, 100), title='R3', style=plot.style_steplinebr, linewidth=width)

    //@version=5

    Base input.timeframe(title='Larger Res than Chart'defval='240')
    breakline input(title='Breaks in lines'defval=true)
    so request.security(syminfo.tickeridBaseopen)
    sh request.security(syminfo.tickeridBasehigh)
    sl request.security(syminfo.tickeridBaselow)
    sc request.security(syminfo.tickeridBaseclose)
    br so != so[1] and sc != sc[1] and sh != sh[1] and sl != sl[1] and breakline == true na
    col 
    so sc color.red color.green
    a1 
    na(br) ? so na
    a2 
    na(br) ? sh na
    a3 
    na(br) ? sl na
    a4 
    na(br) ? sc na
    p1 
    plot(a1'Open'color.new(color.white0), style=plot.style_linebr)
    p2 plot(a2'High'color.new(color.black75), style=plot.style_linebr)
    p3 plot(a3'Low'color.new(color.black75), style=plot.style_linebr)
    p4 plot(a4'Close'colstyle=plot.style_linebr)
    fill(p1p4coltransp=25)
    fill(p2p3color.new(color.silver65)) 
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  2. pivotla trend hesaplama...ama mtf olarak....
    ve altta periyotların durumunu göreme...al-sat-nötr şeklinde.....
    bu arada barları renklendşirir.....

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

    //@version=5
    indicator("Price-Action Candles"overlay truemax_bars_back 100)

    // inputs
    sdLength    input.int(3title 'Price-Action Length'minval 2maxval 100)
    labelType   input.string('Repaint'title 'Label Type'options = ['Repaint''No-Repaint'])
    candleType  input.string('Fill Only'title 'Candle Color Type'options = ['Entire Candle''Fill Only'])

    bullCSS     input.color(color.limetitle 'Bull')
    bearCSS     input.color(color.rgb(25500), title 'Bear')
    neutCSS     input.color(color.yellowtitle 'Neutral')

    useTrendTable   input.bool(truetitle 'Enabled'group 'MTF Trend')

    use_mtf1        input.bool(truetitle 'MTF 1'group 'MTF Trend'inline '1')
    mtf_1           input.timeframe("1"title ''group 'MTF Trend'inline '1')

    use_mtf2        input.bool(truetitle 'MTF 2'group 'MTF Trend'inline '2')
    mtf_2           input.timeframe("3"title ''group 'MTF Trend'inline '2')

    use_mtf3        input.bool(truetitle 'MTF 3'group 'MTF Trend'inline '3')
    mtf_3           input.timeframe("5"title ''group 'MTF Trend'inline '3')

    use_mtf4        input.bool(truetitle 'MTF 4'group 'MTF Trend'inline '4')
    mtf_4           input.timeframe("15"title ''group 'MTF Trend'inline '4')

    use_mtf5        input.bool(truetitle 'MTF 5'group 'MTF Trend'inline '5')
    mtf_5           input.timeframe("60"title ''group 'MTF Trend'inline '5')



    // functions
    f_getSwingValues(sdLengthoffset) =>
        
    sh ta.pivothigh(highsdLengthsdLength)
        
    sl ta.pivotlow(lowsdLengthsdLength)

        
    csh ta.valuewhen(not na(sh), high[sdLength], 0)
        
    csl ta.valuewhen(not na(sl), low[sdLength], 0)

        
    psh ta.valuewhen(not na(sh), high[sdLength], 1)
        
    psl ta.valuewhen(not na(sl), low[sdLength], 1)

        
    hh sh >= psh
        lh 
    sh psh
        ll 
    sl <= psl
        hl 
    sl psl

        
    var int trend na
        trend 
    := ((hh and high >= psh) or close csh) ? : ((ll and low <= psl) or close csl) ? -lh or hl trend[1]

        var 
    int last_signal na
        last_signal 
    := hh lh ? -ll ? -hl last_signal[1]

        [
    sh[offset], sl[offset], psh[offset], psl[offset], csh[offset], csl[offset], hh[offset], lh[offset], ll[offset], hl[offset], trend[offset], last_signal[offset]]



    // calculate chart tf
    [shslpshpslcshcslhhlhllhltrendlast_signal] =
     
    request.security(syminfo.tickerid""f_getSwingValues(sdLength0))


    plotshape(ll and not na(sl), text="LL"title="Lower Low"style=shape.labelupdisplay display.none,
     
    color=bearCSStextcolor=color.blacklocation=location.belowbaroffset labelType == 'Repaint' ? -sdLength 0)

    plotshape(hl and not na(sl), text="HL"title="Higher Low"style=shape.labelupdisplay display.none,
     
    color=neutCSStextcolor=color.blacklocation=location.belowbaroffset labelType == 'Repaint' ? -sdLength 0)

    plotshape(hh and not na(sh), text="HH"title="Higher High"style=shape.labeldowndisplay display.none,
     
    color=bullCSStextcolor=color.blacklocation=location.abovebaroffset labelType == 'Repaint' ? -sdLength 0)

    plotshape(lh and not na(sh), text="LH"title="Lower High"style=shape.labeldowndisplay display.none,
     
    color=neutCSStextcolor=color.blacklocation=location.abovebaroffset labelType == 'Repaint' ? -sdLength 0)


    barCSS trend == bullCSS
     
    trend == -bearCSS
     
    neutCSS


    barcolor
    (candleType != 'Fill Only' na
     
    barCSSeditable false)


    plotcandle(openhighlowclosetitle 'Price Action Candles',
     
    color barCSSwickcolor barCSSbordercolor barCSS,
     
    display candleType == 'Entire Candle' display.all display.noneeditable false)



    // calculate mtf
    f_ltf_values(tf) =>
        var 
    int returnTrend na

        adjusted_timeframe 
    timeframe.in_seconds(tf) >= timeframe.in_seconds() ? '' tf
        
    [ltf_shltf_slltf_pshltf_pslltf_cshltf_cslltf_hhltf_lhltf_llltf_hlltf_trendltf_last_signal] = 
         
    request.security_lower_tf(syminfo.tickeridadjusted_timeframef_getSwingValues(sdLength0))

        if array.
    size(ltf_trend) > 0
            returnTrend 
    := array.last(ltf_trend)
        else
            
    returnTrend := 0

        returnTrend



    f_htf_values
    (tf) =>
        [
    htf_shhtf_slhtf_pshhtf_pslhtf_cshhtf_cslhtf_hhhtf_lhhtf_llhtf_hlhtf_trendhtf_last_signal] = 
         
    request.security(syminfo.tickeridtff_getSwingValues(sdLength1), lookahead barmerge.lookahead_on)

        
    htf_trend


    f_sametf_values
    () =>
        [
    sametf_shsametf_slsametf_pshsametf_pslsametf_cshsametf_cslsametf_hhsametf_lhsametf_llsametf_hlsametf_trendsametf_last_signal] =
         
    f_getSwingValues(sdLength0)

        
    sametf_trend


    var int mtf1_trend na
    var int mtf2_trend na
    var int mtf3_trend na
    var int mtf4_trend na
    var int mtf5_trend na

    if barstate.islast
        
    if use_mtf1
            
    if timeframe.in_seconds() == timeframe.in_seconds(mtf_1)
                
    mtf1_trend := f_sametf_values()
            else if 
    timeframe.in_seconds() > timeframe.in_seconds(mtf_1)
                
    mtf1_trend := f_ltf_values(mtf_1)
            else
                
    mtf1_trend := f_htf_values(mtf_1)

        if 
    use_mtf2
            
    if timeframe.in_seconds() == timeframe.in_seconds(mtf_2)
                
    mtf2_trend := f_sametf_values()
            else if 
    timeframe.in_seconds() > timeframe.in_seconds(mtf_2)
                
    mtf2_trend := f_ltf_values(mtf_2)
            else
                
    mtf2_trend := f_htf_values(mtf_2)

        if 
    use_mtf3
            
    if timeframe.in_seconds() == timeframe.in_seconds(mtf_3)
                
    mtf3_trend := f_sametf_values()
            else if 
    timeframe.in_seconds() > timeframe.in_seconds(mtf_3)
                
    mtf3_trend := f_ltf_values(mtf_3)
            else
                
    mtf3_trend := f_htf_values(mtf_3)

        if 
    use_mtf4
            
    if timeframe.in_seconds() == timeframe.in_seconds(mtf_4)
                
    mtf4_trend := f_sametf_values()
            else if 
    timeframe.in_seconds() > timeframe.in_seconds(mtf_4)
                
    mtf4_trend := f_ltf_values(mtf_4)
            else
                
    mtf4_trend := f_htf_values(mtf_4)

        if 
    use_mtf5
            
    if timeframe.in_seconds() == timeframe.in_seconds(mtf_5)
                
    mtf5_trend := f_sametf_values()
            else if 
    timeframe.in_seconds() > timeframe.in_seconds(mtf_5)
                
    mtf5_trend := f_ltf_values(mtf_5)
            else
                
    mtf5_trend := f_htf_values(mtf_5)




    // table
    if barstate.islast and useTrendTable
        
    var trendTable table.new(position position.bottom_rightcolumns 5rows 1border_width 1border_color color.blackframe_width 2frame_color color.black)
        
        if 
    use_mtf1
            table
    .cell(trendTable00text str.tostring(mtf_1), text_color color.black,
             
    bgcolor color.new(mtf1_trend == bullCSS mtf1_trend == -bearCSS neutCSS0))
            
        if 
    use_mtf2
            table
    .cell(trendTable10text str.tostring(mtf_2), text_color color.black,
             
    bgcolor color.new(mtf2_trend == bullCSS mtf2_trend == -bearCSS neutCSS0))

        if 
    use_mtf3
            table
    .cell(trendTable20text str.tostring(mtf_3), text_color color.black,
             
    bgcolor color.new(mtf3_trend == bullCSS mtf3_trend == -bearCSS neutCSS0))

        if 
    use_mtf4
            table
    .cell(trendTable30text str.tostring(mtf_4), text_color color.black,
             
    bgcolor color.new(mtf4_trend == bullCSS mtf4_trend == -bearCSS neutCSS0))

        if 
    use_mtf5
            table
    .cell(trendTable40text str.tostring(mtf_5), text_color color.black,
             
    bgcolor color.new(mtf5_trend == bullCSS mtf5_trend == -bearCSS neutCSS0)) 
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  3. bu kurcalanmalı....bence...
    PHP Code:
     // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © tradeforopp

    //@version=5
    indicator("Protected Highs & Lows [TFO]""Protected Highs & Lows [TFO]"truemax_lines_count 500max_labels_count 500max_boxes_count 500)

    var 
    g_STR "Structure"
    ps input.int(0"Pivot Strength"group g_STR)
    color_trend input.bool(true"Trend Candles"inline "TREND"group g_STR)
    show_labels input.bool(true"Show Structure Labels"inline "MSS"group g_STR)
    label_type input.string("MSS"""options = ['MSS''BOS''All'], inline "MSS"group g_STR)

    var 
    g_PHL "Protected Highs & Lows"
    show_phl input.bool(true"Show Protected Highs & Lows"inline "PHL"group g_PHL)
    trail_phl input.bool(true"Show Protected Trail"inline "TRAIL"group g_PHL)
    trail_width input.int(1""inline "TRAIL"group g_PHL)

    var 
    g_PB "Pullbacks"
    use_valid_pbs input.bool(true"Use Valid Pullback Criteria"tooltip "When looking at the swing high that price must close above for a BOS/MSS, in order to form a valid protected low, price must first close below the low of the candle that made the swing high (and vice versa for protected highs)"group g_PB)
    extra_valid_pbs input.bool(false"Specific Pullback Candle Criteria"tooltip "When 'Use Valid Pullback Criteria' is enabled, if a given swing high is formed with a down close candle, the script will look backward to find the most recent up-close candle. Using this candle, price must close below its low to validate a pullback from a swing high (and vice versa)"group g_PB)

    ph_color input.color(#f23645, "", inline = "PHL", group = g_PHL)
    pl_color input.color(color.blue""inline "PHL"group g_PHL)

    bull_color input.color(color.teal""inline "TREND"group g_STR)
    bear_color input.color(#f23645, "", inline = "TREND", group = g_STR)

    var g_RET "Retracements"
    show_rets input.bool (true"Show Retracements"tooltip "Show retracements of the previous zone with 30, 50, and 70% retracement levels"group g_RET)
    box_transp input.int(100"Box Transparency"0100tooltip "Larger values will make the retracement box more transparent"group g_RET)
    line_w input.int(1"Line Width"010group g_RET)
    line_s input.string('Dotted'"Line Style"options = ['Solid''Dashed''Dotted'], group g_RET)

    var 
    style = switch line_s
        
    'Solid' => line.style_solid
        
    'Dashed' => line.style_dashed
        
    'Dotted' => line.style_dotted

    var bool bull na

    var float trail_price na
    var color trail_color na

    var ph = array.new_float()
    var 
    pl = array.new_float()

    var 
    pht = array.new_int()
    var 
    plt = array.new_int()

    var 
    float last_high na
    var float last_low na

    var int last_high_idx na
    var int last_low_idx na

    var float track_high na
    var float track_low na

    var int track_high_idx na
    var int track_low_idx na

    type pb
        float price
        int idx
        bool valid 
    false
        bool bull

    type snd
        box _box
        line _30
        line _50
        line _70

    type dwg
        label
    [] _label
        label
    [] _phl
        line
    [] _line
        bool
    [] _bull

    method snd_add
    (snd sfloat _highfloat _lowbool bull) =>
        
    _30 = (_high _low) * 0.1 _low
        _50 
    = (_high _low) * 0.3 _low
        _70 
    = (_high _low) * 0.5 _low
        s
    ._box := box.new(time_hightime_lowxloc xloc.bar_timeborder_color nabgcolor na)
        
    s._30 := line.new(time_30time_30xloc xloc.bar_timecolor nastyle stylewidth line_w)
        
    s._50 := line.new(time_50time_50xloc xloc.bar_timecolor nastyle stylewidth line_w)
        
    s._70 := line.new(time_70time_70xloc xloc.bar_timecolor nastyle stylewidth line_w)

    method dwg_add(dwg dlabel LBlabel PHLline LNbool BL) =>
        
    d._label.unshift(LB)
        
    d._phl.unshift(PHL)
        
    d._line.unshift(LN)
        
    d._bull.unshift(BL)

    method pb_set(pb pfloat Pint I) =>
        
    p.price := P
        p
    .idx := I
        p
    .valid := false

    clear_all
    () =>
        
    pl.clear()
        
    plt.clear()    
        
    ph.clear()
        
    pht.clear()

    var 
    pb_from_high pb.new(bull true)
    var 
    pb_from_low  pb.new(bull false)

    if 
    ta.pivotlow(lowpsps) and pl.size() == 0
        pl
    .unshift(low[ps])
        
    plt.unshift(time[ps])

        if 
    extra_valid_pbs
            
    for 0 to 3
                
    if close[ps i] < open[ps i]
                    
    pb_set(pb_from_lowhigh[ps i], bar_index)
                    break
        else
            
    pb_set(pb_from_lowhigh[ps], bar_index)

        if 
    na(last_low)
            
    last_low := low[ps]
            
    last_low_idx := bar_index ps
        
    else
            if 
    low[ps] < last_low
                last_low 
    := low[ps]
                
    last_low_idx := bar_index ps
    if ta.pivothigh(highpsps) and ph.size() == 0
        ph
    .unshift(high[ps])
        
    pht.unshift(time[ps])
        
        if 
    extra_valid_pbs
            
    for 0 to 3
                
    if close[ps i] > open[ps i]
                    
    pb_set(pb_from_highlow[ps i], bar_index)
                    break
        else
            
    pb_set(pb_from_highlow[ps], bar_index)
        
        if 
    na(last_high)
            
    last_high := high[ps]
            
    last_high_idx := bar_index ps
        
    else
            if 
    high[ps] > last_high
                last_high 
    := high[ps]
                
    last_high_idx := bar_index ps

    check_pb
    (pb p) =>
        if 
    p.bull
            
    if close p.price and p.valid == false
                p
    .valid := true
        
    else
            if 
    close p.price and p.valid == false
                p
    .valid := true

    check_pb
    (pb_from_high)
    check_pb(pb_from_low)

    if (
    high[ps] > track_high or na(track_high) or last_low_idx >= track_high_idx) and not na(ta.pivothigh(highpsps)) and (use_valid_pbs pb_from_low.valid == true true)
        
    track_high := high[ps]
        
    track_high_idx := bar_index ps
    if (low[ps] < track_low or na(track_low) or last_high_idx >= track_low_idx) and not na(ta.pivotlow(lowpsps)) and (use_valid_pbs pb_from_high.valid == true true)
        
    track_low := low[ps]
        
    track_low_idx := bar_index ps

    bos_bear 
    false
    bos_bull 
    false
    mss_bear 
    false
    mss_bull 
    false
    change 
    false

    var dwgs dwg.new(array.new_label(), array.new_label(), array.new_line(), array.new_bool())
    var 
    snd snd.new()

    maintain(snd s) =>
        if 
    not na(s._box)
            
    s._box.set_right(time)
            
    s._30.set_x2(time)
            
    s._50.set_x2(time)
            
    s._70.set_x2(time)

    maintain(snd)

    if 
    ph.size() > 
        
    if close ph.get(0)
            
    label _label na
            label _phl 
    na

            
    if show_labels
                save 
    false
                
    if label_type == 'MSS' and not bull
                    save 
    := true
                
    else if label_type == 'BOS' and bull
                    save 
    := true
                
    else if label_type == 'All'
                    
    save := true
                
    if save    
                    _label 
    := label.new(math.floor(math.avg(timepht.get(0))), ph.get(0), bull "BOS" "MSS"xloc xloc.bar_timestyle label.style_label_downcolor #ffffff00, textcolor = na)

            
    if bull
                bos_bull 
    := true
            
    else
                
    mss_bull := true

            
    if show_rets and (use_valid_pbs pb_from_high.valid == true true)
                
    snd.snd_add(ph.get(0), track_lowtrue)

            
    _line line.new(pht.get(0), ph.get(0), timeph.get(0), color naxloc xloc.bar_timestyle line.style_dashed)
            
    bull := true
            change 
    := true

            clear_all
    ()

            if 
    not na(track_low)
                if 
    show_phl
                    _phl 
    := label.new(time[bar_index track_low_idx], track_low"▲"xloc xloc.bar_timestyle label.style_label_uptextcolor nacolor #ffffff00)

                
    pl.unshift(track_low)
                
    plt.unshift(time[bar_index track_low_idx])
                
    last_high := na

            dwgs
    .dwg_add(_label_phl_linebull)

    if 
    pl.size() > 0
        
    if close pl.get(0)
            
    label _label na
            label _phl 
    na

            
    if show_labels
                save 
    false
                
    if label_type == 'MSS' and bull
                    save 
    := true
                
    else if label_type == 'BOS' and not bull
                    save 
    := true
                
    else if label_type == 'All'
                    
    save := true
                
    if save    
                    _label 
    := label.new(math.floor(math.avg(timeplt.get(0))), pl.get(0), not bull "BOS" "MSS"xloc xloc.bar_timestyle label.style_label_upcolor #ffffff00, textcolor = na)

            
    if not bull
                bos_bear 
    := true
            
    else
                
    mss_bear := true

            
    if show_rets and (use_valid_pbs pb_from_low.valid == true true)
                
    snd.snd_add(pl.get(0), track_highfalse)

            
    _line line.new(plt.get(0), pl.get(0), timepl.get(0), color naxloc xloc.bar_timestyle line.style_dashed)
            
    bull := false
            change 
    := true
                    
            clear_all
    ()

            if 
    not na(track_high)
                if 
    show_phl
                    _phl 
    := label.new(time[bar_index track_high_idx], track_high"▼"xloc xloc.bar_timestyle label.style_label_downtextcolor nacolor #ffffff00)

                
    ph.unshift(track_high)
                
    pht.unshift(time[bar_index track_high_idx])                
                
    last_low := na
                
            dwgs
    .dwg_add(_label_phl_linebull)

    if 
    change[1]
        if 
    bos_bear[1] or mss_bear[1]
            
    trail_price := track_high
            trail_color 
    := ph_color
        
    else if bos_bull[1] or mss_bull[1]
            
    trail_price := track_low
            trail_color 
    := pl_color
            
        _bull 
    dwgs._bull.get(0)
        
    dwgs._label.get(0).set_textcolor(_bull bull_color bear_color)
        
    dwgs._phl.get(0).set_textcolor(_bull pl_color ph_color)
        
    dwgs._line.get(0).set_color(_bull bull_color bear_color)

        
    snd._box.set_bgcolor(color.new(bull bull_color bear_colorbox_transp))
        
    snd._30.set_color(_bull bull_color bear_color)
        
    snd._50.set_color(_bull bull_color bear_color)
        
    snd._70.set_color(_bull bull_color bear_color)

    //barcolor(color_trend ? (bull ? bull_color : bear_color) : na)

    plot(trail_phl trail_price nacolor trail_colorlinewidth trail_width
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  4. 20-50 ema....ama sentinelli...
    PHP Code:
     fi(ki)=>'ra' 
    // © fikira This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/ 
    // @version=5 

    indicator (                                                                      "Sentinels"
              
    overlay=true
              
    )
    _                                                                                                                                                                                                                                                                        '
                                                                   Settings                                                
                                                                 -------------                                                                                                                                                                                                 '

    typeMA1   input.string(   "EMA"  'Type'  options=["SMA""EMA""SMMA (RMA)""HullMA""WMA""VWMA""DEMA""TEMA""NONE"], group=   'MA 1'  )
    len1      input.int   (     20    'Length'                                                                                       group=   'MA 1'  )

    typeMA2   input.string(   "EMA"  'Type'  options=["SMA""EMA""SMMA (RMA)""HullMA""WMA""VWMA""DEMA""TEMA""NONE"], group=   'MA 2'  )
    len2      input.int   (     50    'Length'                                                                                       group=   'MA 2'  )

    tentacles input.bool  (    true   ,    ''   ,                                   inline'1',                                         group='tentacles')
    typeMA3   input.string(   "EMA"  ,'******' ,                                   inline'1' 
                                                  
    options=["SMA""EMA""SMMA (RMA)""HullMA""WMA""VWMA""DEMA""TEMA""NONE"], group='tentacles')

    UpCol1    input.color (color.rgb(  5250131    ),  ""  ,                   inline'1',         group '***********Head************-**Tentacles')
    UpCol2    input.color (color.rgb(255176,   680),  ""  ,                   inline'1',         group '***********Head************-**Tentacles')
    UpCol3    input.color (color.rgb1423624337),"*-**",                   inline'1',         group '***********Head************-**Tentacles')
    DnCol1    input.color (color.rgb(255,   0,   0    ),  ""  ,                   inline'2',         group '***********Head************-**Tentacles')
    DnCol2    input.color (color.rgb(255176,   680),  ""  ,                   inline'2',         group '***********Head************-**Tentacles')
    DnCol3    input.color (color.rgb(243,  2525537),"*-**",                   inline'2',         group '***********Head************-**Tentacles')

    _                                                                                                                                                                                                                                                                        '
                                                                   Methods                                               
                                                                 -----------                                                                                                                                                                                                '

    method ma(string typeint length) =>
        
    //
        
    ema1 ta.ema(closelength)
        
    ema2 ta.ema(ema1 length)
        
    ema3 ta.ema(ema2 length)
        
    //
        
    switch type
            
    "SMA"        => ta.sma (closelength)
            
    "EMA"        => ema1
            
    "SMMA (RMA)" => ta.rma (closelength)
            
    "HullMA"     => ta.hma (closelength)
            
    "WMA"        => ta.wma (closelength)
            
    "sar"       => ta.ema(closelength)
            
    "DEMA"       =>  ema1  -      ema2
            
    "TEMA"       => (ema1) - (ema2) + ema3
            
    => na

    method cond
    (int countint n1int n2) => count >= n1 and count <= n2

    _                                                                                                                                                                                                                                                                        
    '
                                                                  Calculations                                                
                                                                 --------------                                                                                                                                                                                                 '

    ma1    typeMA1.ma(len1)
    ma2    typeMA2.ma(len2)

    trigUp ta.crossover (ma1ma2), bsUp ta.barssince(trigUp)
    trigDn ta.crossunder(ma1ma2), bsDn ta.barssince(trigDn)
     
    UpR1   color.r(UpCol1), UpG1 color.g(UpCol1), UpB1 color.b(UpCol1), UpT1 color.t(UpCol1)
    UpR2   color.r(UpCol2), UpG2 color.g(UpCol2), UpB2 color.b(UpCol2), UpT2 color.t(UpCol2)
    DnR1   color.r(DnCol1), DnG1 color.g(DnCol1), DnB1 color.b(DnCol1), DnT1 color.t(DnCol1)
    DnR2   color.r(DnCol2), DnG2 color.g(DnCol2), DnB2 color.b(DnCol2), DnT2 color.t(DnCol2)

    TupMn  math.min(UpT1UpT2), TupMx math.max(UpT1UpT2)
    TdnMn  math.min(DnT1DnT2), TdnMx math.max(DnT1DnT2)

    Rdn = (DnR1  -  DnR2) / 12Rup = (UpR1  -  UpR2) / 12
    Gdn 
    = (DnG1  -  DnG2) / 12Gup = (UpG1  -  UpG2) / 12
    Bdn 
    = (DnB1  -  DnB2) / 12Bup = (UpB1  -  UpB2) / 12
    Tup 
    = (TupMx TupMn) / 12Tdn = (TdnMx TdnMn) / 12

    _                                                                                                                                                                                                                                                                        
    '
                                                                   Sentinels                                                
                                                                 --------------                                                                                                                                                                                                 '

    plot(bsUp.cond0,  1) ? ma1 na''color=            color.rgb(UpR1 - (Rup *  0), UpG1 - (Gup *  0), UpB1 - (Bup *  0), TupMn + (Tup *  0)), style=plot.style_linebrlinewidth=7)
    plot(bsUp.cond1,  2) ? ma1 na''color=            color.rgb(UpR1 - (Rup *  1), UpG1 - (Gup *  1), UpB1 - (Bup *  1), TupMn + (Tup *  1)), style=plot.style_linebrlinewidth=6)
    plot(bsUp.cond2,  5) ? ma1 na''color=bsUp <  color.rgb(UpR1 - (Rup *  2), UpG1 - (Gup *  2), UpB1 - (Bup *  2), TupMn + (Tup *  2))
                                                           : 
    color.rgb(UpR1 - (Rup *  3), UpG1 - (Gup *  3), UpB1 - (Bup *  3), TupMn + (Tup *  3)), style=plot.style_linebrlinewidth=5)
    plot(bsUp.cond511) ? ma1 na''color=bsUp <  color.rgb(UpR1 - (Rup *  4), UpG1 - (Gup *  4), UpB1 - (Bup *  4), TupMn + (Tup *  4)) 
                                                           : 
    color.rgb(UpR1 - (Rup *  5), UpG1 - (Gup *  5), UpB1 - (Bup *  5), TupMn + (Tup *  5)), style=plot.style_linebrlinewidth=4)
    plot(bsUp.cond(1127) ? ma1 na''color=bsUp 18 color.rgb(UpR1 - (Rup *  6), UpG1 - (Gup *  6), UpB1 - (Bup *  6), TupMn + (Tup *  6))
                                                           : 
    color.rgb(UpR1 - (Rup *  7), UpG1 - (Gup *  7), UpB1 - (Bup *  7), TupMn + (Tup *  7)), style=plot.style_linebrlinewidth=3)
    plot(bsUp.cond(2740) ? ma1 na''color=bsUp 30 color.rgb(UpR1 - (Rup *  8), UpG1 - (Gup *  8), UpB1 - (Bup *  8), TupMn + (Tup *  8))
                                                           : 
    color.rgb(UpR1 - (Rup *  9), UpG1 - (Gup *  9), UpB1 - (Bup *  9), TupMn + (Tup *  9)), style=plot.style_linebrlinewidth=2)
    plot(bsUp.cond(4060) ? ma1 na''color=bsUp 50 color.rgb(UpR1 - (Rup 10), UpG1 - (Gup 10), UpB1 - (Bup 10), TupMn + (Tup 10)) 
                                                           : 
    color.rgb(UpR1 - (Rup 11), UpG1 - (Gup 11), UpB1 - (Bup 11), TupMn + (Tup 11)), style=plot.style_linebrlinewidth=1)

    plot(bsDn.cond0,  1) ? ma2 na''color=            color.rgb(DnR1 - (Rdn *  0), DnG1 - (Gdn *  0), DnB1 - (Bdn *  0), TdnMn + (Tdn *  0)), style=plot.style_linebrlinewidth=7)
    plot(bsDn.cond1,  2) ? ma2 na''color=            color.rgb(DnR1 - (Rdn *  1), DnG1 - (Gdn *  1), DnB1 - (Bdn *  1), TdnMn + (Tdn *  1)), style=plot.style_linebrlinewidth=6)
    plot(bsDn.cond2,  5) ? ma2 na''color=bsDn <  color.rgb(DnR1 - (Rdn *  2), DnG1 - (Gdn *  2), DnB1 - (Bdn *  2), TdnMn + (Tdn *  2))
                                                           : 
    color.rgb(DnR1 - (Rdn *  3), DnG1 - (Gdn *  3), DnB1 - (Bdn *  3), TdnMn + (Tdn *  3)), style=plot.style_linebrlinewidth=5)
    plot(bsDn.cond511) ? ma2 na''color=bsDn <  color.rgb(DnR1 - (Rdn *  4), DnG1 - (Gdn *  4), DnB1 - (Bdn *  4), TdnMn + (Tdn *  4)) 
                                                           : 
    color.rgb(DnR1 - (Rdn *  5), DnG1 - (Gdn *  5), DnB1 - (Bdn *  5), TdnMn + (Tdn *  5)), style=plot.style_linebrlinewidth=4)
    plot(bsDn.cond(1127) ? ma2 na''color=bsDn 18 color.rgb(DnR1 - (Rdn *  6), DnG1 - (Gdn *  6), DnB1 - (Bdn *  6), TdnMn + (Tdn *  6))
                                                           : 
    color.rgb(DnR1 - (Rdn *  7), DnG1 - (Gdn *  7), DnB1 - (Bdn *  7), TdnMn + (Tdn *  7)), style=plot.style_linebrlinewidth=3)
    plot(bsDn.cond(2740) ? ma2 na''color=bsDn 30 color.rgb(DnR1 - (Rdn *  8), DnG1 - (Gdn *  8), DnB1 - (Bdn *  8), TdnMn + (Tdn *  8))
                                                           : 
    color.rgb(DnR1 - (Rdn *  9), DnG1 - (Gdn *  9), DnB1 - (Bdn *  9), TdnMn + (Tdn *  9)), style=plot.style_linebrlinewidth=2)
    plot(bsDn.cond(4060) ? ma2 na''color=bsDn 50 color.rgb(DnR1 - (Rdn 10), DnG1 - (Gdn 10), DnB1 - (Bdn 10), TdnMn + (Tdn 10)) 
                                                           : 
    color.rgb(DnR1 - (Rdn 11), DnG1 - (Gdn 11), DnB1 - (Bdn 11), TdnMn + (Tdn 11)), style=plot.style_linebrlinewidth=1)

    plotshape(bsUp == ma1 na''color=          chart.fg_color     location=location.absolutestyle=shape.circlesize=size.tiny  )
    plotshape(bsUp == ma1 na''color=color.new(chart.fg_color75), location=location.absolutestyle=shape.circlesize=size.small )
    plotshape(bsUp == ma1 na''color=color.new(chart.fg_color85), location=location.absolutestyle=shape.circlesize=size.normal)

    plotshape(bsDn == ma2 na''color=          chart.fg_color     location=location.absolutestyle=shape.circlesize=size.tiny  )
    plotshape(bsDn == ma2 na''color=color.new(chart.fg_color75), location=location.absolutestyle=shape.circlesize=size.small )
    plotshape(bsDn == ma2 na''color=color.new(chart.fg_color85), location=location.absolutestyle=shape.circlesize=size.normal)

    diff   math.round((len2 len1) / 6)

    vwma1  typeMA3.ma(len1 diff 1)
    vwma2  typeMA3.ma(len1 diff 2)
    vwma3  typeMA3.ma(len1 diff 3)
    vwma4  typeMA3.ma(len1 diff 4)
    vwma5  typeMA3.ma(len1 diff 5)
    vwma6  typeMA3.ma(len1 diff 6)

    plot(tentacles bsDn and bsDn <= 15 bsDn ma2 vwma1 na na''color=DnCol3style=plot.style_linebr)
    plot(tentacles bsDn and bsDn <= 20 bsDn ma2 vwma2 na na''color=DnCol3style=plot.style_linebr)
    plot(tentacles bsDn and bsDn <= 25 bsDn ma2 vwma3 na na''color=DnCol3style=plot.style_linebr)
    plot(tentacles bsDn and bsDn <= 30 bsDn ma2 vwma4 na na''color=DnCol3style=plot.style_linebr)
    plot(tentacles bsDn and bsDn <= 35 bsDn ma2 vwma5 na na''color=DnCol3style=plot.style_linebr)
    plot(tentacles bsDn and bsDn <= 40 bsDn ma2 vwma6 na na''color=DnCol3style=plot.style_linebr)

    plot(tentacles bsUp and bsUp <= 15 bsUp ma1 vwma1 na na''color=UpCol3style=plot.style_linebr)
    plot(tentacles bsUp and bsUp <= 20 bsUp ma1 vwma2 na na''color=UpCol3style=plot.style_linebr)
    plot(tentacles bsUp and bsUp <= 25 bsUp ma1 vwma3 na na''color=UpCol3style=plot.style_linebr)
    plot(tentacles bsUp and bsUp <= 30 bsUp ma1 vwma4 na na''color=UpCol3style=plot.style_linebr)
    plot(tentacles bsUp and bsUp <= 35 bsUp ma1 vwma5 na na''color=UpCol3style=plot.style_linebr)
    plot(tentacles bsUp and bsUp <= 40 bsUp ma1 vwma6 na na''color=UpCol3style=plot.style_linebr)
    _                                                                                                                                                                                                                                                                        '
                                                                 --------------                                                                                                                                                                                                 ' 
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  5. son 16 barı...ikili gruplar....ve açılış ile kapanışı hesaplar...
    kapanışa göre renklendirir....
    pozitif momentumu bulut şeklinde gösterir....

    PHP Code:
     //@version=5
    indicator('Squeeze TD'shorttitle='.'overlay=trueprecision=2)

    length input.int(20"TTM Squeeze Length")

    //BOLLINGER BANDS
    BB_mult input.float(2.0"Bollinger Band STD Multiplier")
    BB_basis ta.sma(closelength)
    dev BB_mult ta.stdev(closelength)
    BB_upper BB_basis dev
    BB_lower 
    BB_basis dev
    atr 
    ta.atr(14)

    //KELTNER CHANNELS
    KC_mult_high input.float(1.0"Keltner Channel #1")
    KC_mult_mid input.float(1.5"Keltner Channel #2")
    KC_mult_low input.float(2.0"Keltner Channel #3")
    KC_basis ta.sma(closelength)
    devKC ta.sma(ta.trlength)
    KC_upper_high KC_basis devKC KC_mult_high
    KC_lower_high 
    KC_basis devKC KC_mult_high
    KC_upper_mid 
    KC_basis devKC KC_mult_mid
    KC_lower_mid 
    KC_basis devKC KC_mult_mid
    KC_upper_low 
    KC_basis devKC KC_mult_low
    KC_lower_low 
    KC_basis devKC KC_mult_low

    //SQUEEZE CONDITIONS
    NoSqz BB_lower KC_lower_low or BB_upper KC_upper_low //NO SQUEEZE: GREEN
    LowSqz BB_lower >= KC_lower_low or BB_upper <= KC_upper_low //LOW COMPRESSION: BLACK
    MidSqz BB_lower >= KC_lower_mid or BB_upper <= KC_upper_mid //MID COMPRESSION: RED
    HighSqz BB_lower >= KC_lower_high or BB_upper <= KC_upper_high //HIGH COMPRESSION: ORANGE

    //MOMENTUM OSCILLATOR
    mom ta.linreg(close math.avg(math.avg(ta.highest(highlength), ta.lowest(lowlength)), ta.sma(closelength)), length0)

    //MOMENTUM HISTOGRAM COLOR
    iff_1 mom nz(mom[1]) ? color.new(color.aqua0) : color.new(#2962ff, 0)
    iff_2 mom nz(mom[1]) ? color.new(color.red0) : color.new(color.yellow0)
    mom_color mom iff_1 iff_2

    // Bullsqueeze and Bearsqueeze Conditions
    bullsqueeze = ((NoSqz and mom_color == color.new(color.aqua0)) or (mom_color == color.new(color.aqua0) and mom_color[1] == color.new(color.red0)))
    bearsqueeze = ((NoSqz and mom_color == color.new(color.red0)) or (mom_color == color.new(color.red0) and mom_color[1] == color.new(color.aqua0)))


    // BULL AND BEAR WATCH OUT Conditions
    buyConf = (mom_color == color.new(color.aqua0) and mom_color[1] == color.new(color.yellow0)) and not bullsqueeze
    sellConf 
    = (mom_color == color.new(color.red0) and mom_color[1] == color.new(#2962ff, 0)) and not bearsqueeze


    // User inputs for colors and widths related to the BAND
    userColorBullish input.color(color.silver"Bullish Band Color"group"Customize BAND")
    userColorBearish input.color(color.black"Bearish Band Color",group"Customize BAND")
    bandWidthMultiplier input.float(2.0"Band Width Multiplier"minval=1.0,group"Customize BAND")
    userWidth input.int(1"Band Width"minval=1,group"Customize BAND")

    // Adjusted band calculations
    upperBand high + (atr bandWidthMultiplier)
    lowerBand low - (atr bandWidthMultiplier)

    // Initialize a color variable for the band
    var color bandColor na
    // Initialize a variable to store the previous band color
    var color prevBandColor na

    // Update the previous band color for the next bar
    prevBandColor := bandColor[1]

    // Create variables to store the previous squeeze state
    var bool prevBullSqueeze false
    var bool prevBearSqueeze false

    // Update the previous squeeze state at the beginning of each new bar
    if (barstate.isnew)
        
    prevBullSqueeze := bandColor == color.new(userColorBullish75)
        
    prevBearSqueeze := bandColor == color.new(userColorBearish75)

    // Determine the band color based on custom conditions
    if (bullsqueeze)
        
    bandColor := color.new(userColorBullish50)
    else if (
    bearsqueeze
        
    bandColor := color.new(userColorBearish100)
    else if (
    sellConf and prevBullSqueeze)
        
    bandColor := color.new(userColorBullish70
    else if (
    sellConf)
        
    bandColor := color.new(userColorBearish100)
    else if (
    buyConf and prevBearSqueeze)
        
    bandColor := color.new(userColorBearish100
    else if (
    buyConf)
        
    bandColor := color.new(userColorBullish70)

        

    // Plot the bands and store the plot references
    upperBandPlot plot(upperBand"H"color=bandColorlinewidth=userWidth)
    lowerBandPlot plot(lowerBand"L"color=bandColorlinewidth=userWidth)

    // Fill between the bands using the plot references
    fill(upperBandPlotlowerBandPlotcolor=bandColor)
    ///////////////////////////////

    //@version=5

    dual_color=false
    var bar_value//(1-16)

    currentHigh high
    previousHigh 
    high[1]
    currentClose close
    previousClose 
    close[1]
    currentLow low
    previousLow 
    low[1]

    // 
    condition1 currentHigh previousHigh and currentClose previousClose and currentLow previousLow
    condition2 
    currentHigh previousHigh and currentClose previousClose and currentLow previousLow
    condition3 
    currentHigh previousHigh and currentClose previousClose and currentLow previousLow
    condition4 
    currentHigh previousHigh and currentClose previousClose and currentLow previousLow
    //--------------------------------------------------------
    condition5 currentHigh previousHigh and currentClose previousClose and currentLow previousLow
    condition6 
    currentHigh previousHigh and currentClose previousClose and currentLow previousLow
    condition7 
    currentHigh previousHigh and currentClose previousClose and currentLow previousLow
    condition8 
    currentHigh previousHigh and currentClose previousClose and currentLow previousLow

    open_up   
    close open[1]
    open_down close open[1]

    switch
        
    condition1 and open_up   => bar_value:=16
        condition1 
    and open_down => bar_value:=15
        condition2 
    and open_up   => bar_value:=14
        condition2 
    and open_down => bar_value:=13
        condition3 
    and open_up   => bar_value:=12
        condition3 
    and open_down => bar_value:=11
        condition4 
    and open_up   => bar_value:=10
        condition4 
    and open_down => bar_value:=9
        condition5 
    and open_up   => bar_value:=8
        condition5 
    and open_down => bar_value:=7
        condition6 
    and open_up   => bar_value:=6
        condition6 
    and open_down => bar_value:=5
        condition7 
    and open_up   => bar_value:=4
        condition7 
    and open_down => bar_value:=3
        condition8 
    and open_up   => bar_value:=2
        condition8 
    and open_down => bar_value:=
    //plot(bar_value,display = display.none,title="Bar Value")


    plotchar(open_up  char="+"color=color.white)
    plotchar(open_downchar="-"color=color.white)
    barcolor(condition1 and not dual_color color.lime natitle="C+L+H+")  
    barcolor(condition2 and not dual_color color.lime   natitle="C+L+H-")
    barcolor(condition3 and not dual_color color.lime   natitle="C+L-H+")
    barcolor(condition4 and not dual_color color.yellow  natitle="C+L-H-")
    //--------------------------------------------------------------------------
    barcolor(condition5 and not dual_color color.yellow natitle="C-L+H+")
    barcolor(condition6 and not dual_color color.red natitle="C-L+H-")
    barcolor(condition7 and not dual_color color.red    natitle="C-L-H+")     
    barcolor(condition8 and not dual_color color.red natitle="C-L-H-")
    /////////////////////// 
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  6. sadece günlükte çalışan...
    yüzdeleme mantığı....
    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/
    // © faiyaz7283
    //@version=5

    indicator(title="Hi-Lo-Gauges"overlay=true)

    // ::Imports:: {
    import faiyaz7283/tools/12 as tools
    import faiyaz7283
    /printer/as prnt
    import faiyaz7283
    /multidata/as mltd
    import faiyaz7283
    /Gauge/as gge
    // }

    // ::Inputs:: {


    var section01 'POSITION, SIZE & COLORS'
    //---------------------:

    var displayLoc input.string(defval position.middle_centertitle 'Display Location'options = [position.top_left
      
    position.top_centerposition.top_rightposition.middle_leftposition.middle_centerposition.middle_right
      
    position.bottom_leftposition.bottom_centerposition.bottom_right], group section01)

    var 
    cellPad input.int(defval 1title 'Cell Spacing'minval 0maxval 5group section01)

    var 
    orientation input.string(defval 'vertical'title 'Orientation',  options = ['horizontal''vertical'], 
      
    group section01) == 'vertical' false true 

    var grdUp input.color(defval #00ff007a, title = '⬆ Max', inline = 'grdnt', group = section01)

    var grdNeutral input.color(defval #fff9c47e, title = '⮕ Neutral', inline = 'grdnt', group = section01)

    var grdDown input.color(defval #ff00006b, title = '⬇ Min', inline = 'grdnt', group = section01)

    var titleColor input.color(defval #ffe0b2, title = 'Title:\tText', inline = 'ttlCl', group = section01)

    var titleBgColor input.color(defval #1E283273, title = 'Bg', inline = 'ttlCl', group = section01)

    var titleSize input.string(defval=size.autotitle 'Size'options = ['hide'size.autosize.tinysize.small
      
    size.normalsize.largesize.huge], inline 'ttlCl'group section01)

    var 
    titleAlign input.string(defval=text.align_centertitle 'Align'
      
    options = [text.align_lefttext.align_centertext.align_right], inline 'ttlCl'group section01)

    var 
    labelColor input.color(defval #00e3ff, title = 'Label:\tColor', inline = 'lblCl', group = section01)

    var labelSize input.string(defval=size.autotitle 'Size'options = ['hide'size.autosize.tinysize.small
      
    size.normalsize.largesize.huge], inline 'lblCl'group section01)

    var 
    keySize input.string(defval=size.autotitle 'Percentage Size'options = ['hide'size.autosize.tinysize.small
      
    size.normalsize.largesize.huge], inline 'prcCl'group section01)

    var 
    offColor input.color(defval #0098E736, title = 'Inactive Color', inline = 'inctCl', group = section01)

    var size input.int(defval 5title 'Gauge Size'minval 5maxval 20group section01)


    var 
    section02 'DATA DISPLAY'
    //----------------------------:

    var closeTip 'Check this box to measure price based on a candle\'s closing price. Uncheck the box to use a candle\'s high/low prices.'

    useClose input.bool(defval=falsetitle='Use Close'tooltip=closeTipgroup=section02)
    highSource useClose close high
    hs 
    bool(useClose) ? 'close' 'high'
    lowSource useClose close low
    ls 
    bool(useClose) ? 'close' 'low'
    var showAT input.bool(defval=truetitle='Show All Time High and Low'group=section02)
    var 
    show52W input.bool(defval=truetitle='Show 52 Weeks High and Low'group=section02)
    var 
    show1Y input.bool(defval=truetitle='Show Current Annual High and Low'group=section02)
    var 
    show6M input.bool(defval=truetitle='Show Current Semi-Annual High and Low'group=section02)
    var 
    show3M input.bool(defval=truetitle='Show Current Quarterly High and Low'group=section02)
    var 
    show1M input.bool(defval=truetitle='Show Current Monthly High and Low'group=section02)
    var 
    show1W input.bool(defval=truetitle='Show Current Weekly High and Low'group=section02)
    var 
    show1D input.bool(defval=truetitle='Show Current Daily High and Low'group=section02)

    // }


    // :Functions: {

    weeklyMs() =>
        
    dayOfWeek dayofweek(timenow)
        
    ms = switch
            
    dayOfWeek == => timenow - (86400000)
            
    dayOfWeek => timenow - ((dayOfWeek 1) * 86400000)
        
    timenow timestamp(year(timenow), month(timenow), dayofmonth(ms))

    monthlyMs() =>
        
    timenow timestamp(year(timenow), month(timenow), 01)

    quaterlyMs() =>
        
    cm month(timenow)
        
    = switch
            
    cm <= => 01
            cm 
    <= and cm => 04
            cm 
    <= and cm => 07
            cm 
    <= 12 and cm => 10
        timenow 
    timestamp(year(timenow), m01)

    semiAnnuallyMs() =>
        
    month(timenow) <= 01 07
        timenow 
    timestamp(year(timenow), m01)

    annuallyMs() =>
        
    timenow timestamp(year(timenow), 0101)

    // }


    if timeframe.isdaily

        
    // ::Data:: {

        
    var fiftyTwoWeekMS timeframe.in_seconds('52W') * 1000
        atL 
    lowSource.allTimeLowest().get(ls)
        
    atH highSource.allTimeHighest().get(hs)
        
    _52wL fiftyTwoWeekMS.timeRangeLowest(lowSource).get(ls)
        
    _52wH fiftyTwoWeekMS.timeRangeHighest(highSource).get(hs)
        
    _1yL annuallyMs().timeRangeLowest(lowSource).get(ls)
        
    _1yH annuallyMs().timeRangeHighest(highSource).get(hs)
        
    _6mL semiAnnuallyMs().timeRangeLowest(lowSource).get(ls)
        
    _6mH semiAnnuallyMs().timeRangeHighest(highSource).get(hs)
        
    _3mL quaterlyMs().timeRangeLowest(lowSource).get(ls)
        
    _3mH quaterlyMs().timeRangeHighest(highSource).get(hs)
        
    _1mL monthlyMs().timeRangeLowest(lowSource).get(ls)
        
    _1mH monthlyMs().timeRangeHighest(highSource).get(hs)
        
    _1wL weeklyMs().timeRangeLowest(lowSource).get(ls)
        
    _1wH weeklyMs().timeRangeHighest(highSource).get(hs)

        
    // }

        
    if barstate.islast
            tbs 
    prnt.tableStyle.new(bgColor=naframeColor=naborderColor=naborderWidth=cellPad)
            
    printer prnt.printer(stack=orientationloc=displayLoctableStyle=tbsgutterStyle=prnt.gutterStyle.new(true11))
            
    prms gge.gaugeParams.new(num=closemin=0max=0size=sizeoffColor=offColorupColor=grdUp
              
    downColor=grdDownneutralColor=grdNeutraltitleColor=titleColortitleBgColor=titleBgColor
              
    labelColor=labelColortitleAlign=titleAligntitleSize=titleSizekeySize=keySizelabelSize=labelSize
              
    horizontal=orientation)

            if 
    showAT
                paramsAT 
    gge.gaugeParams.copy(prms)
                
    paramsAT.min := atL
                paramsAT
    .max := atH
                paramsAT
    .title := 'TÜM ZAMANLAR'
                
    paramsAT.minLabel := str.format("{0,number,currency}"atL)
                
    paramsAT.maxLabel := str.format("{0,number,currency}"atH)
                
    printer.gauge(paramsAT)
            
            if 
    show52W
                params52W 
    gge.gaugeParams.copy(prms)
                
    params52W.min := _52wL
                params52W
    .max := _52wH
                params52W
    .title := '52 HAFTA'
                
    params52W.minLabel := str.format("{0,number,currency}"_52wL)
                
    params52W.maxLabel := str.format("{0,number,currency}"_52wH)
                
    printer.gauge(params52W)
            
            if 
    show1Y
                params1Y 
    gge.gaugeParams.copy(prms)  
                
    params1Y.min := _1yL
                params1Y
    .max := _1yH
                params1Y
    .title := 'YILLIK'
                
    params1Y.minLabel := str.format("{0,number,currency}"_1yL)
                
    params1Y.maxLabel := str.format("{0,number,currency}"_1yH)
                
    printer.gauge(params1Y)

            if 
    show6M
                params6M 
    gge.gaugeParams.copy(prms)  
                
    params6M.min := _6mL
                params6M
    .max := _6mH
                params6M
    .title := '6 AYLIK'
                
    params6M.minLabel := str.format("{0,number,currency}"_6mL)
                
    params6M.maxLabel := str.format("{0,number,currency}"_6mH)
                
    printer.gauge(params6M)

            if 
    show3M
                params3M 
    gge.gaugeParams.copy(prms)  
                
    params3M.min := _3mL
                params3M
    .max := _3mH
                params3M
    .title := '3 AYLIK'
                
    params3M.minLabel := str.format("{0,number,currency}"_3mL)
                
    params3M.maxLabel := str.format("{0,number,currency}"_3mH)
                
    printer.gauge(params3M)

            if 
    show1M
                params1M 
    gge.gaugeParams.copy(prms)  
                
    params1M.min := _1mL
                params1M
    .max := _1mH
                params1M
    .title := 'AYLIK'
                
    params1M.minLabel := str.format("{0,number,currency}"_1mL)
                
    params1M.maxLabel := str.format("{0,number,currency}"_1mH)
                
    printer.gauge(params1M)

            if 
    show1W
                params1W 
    gge.gaugeParams.copy(prms)
                
    params1W.min := _1wL
                params1W
    .max := _1wH
                params1W
    .title := 'HAFTALIK'
                
    params1W.minLabel := str.format("{0,number,currency}"_1wL)
                
    params1W.maxLabel := str.format("{0,number,currency}"_1wH)
                
    printer.gauge(params1W)

            if 
    show1D
                params1D 
    gge.gaugeParams.copy(prms)
                
    params1D.min := low
                params1D
    .max := high
                params1D
    .title := 'GÜNLÜK'
                
    params1D.minLabel := str.format("{0,number,currency}"low)
                
    params1D.maxLabel := str.format("{0,number,currency}"high)
                
    printer.gauge(params1D)
    else
        
    prnt._printer.new().print("SADECE GÜNLÜK GRAFİKTE ÇALIŞIR."
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

  7. korku-çoşku kodu....
    PHP Code:
     //@version=5
    // ══════════════════════════════════════════════════════════════════════════════════════════════════ //
    //# * ══════════════════════════════════════════════════════════════════════════════════════════════
    //# *
    //# * Study       : Trading Psychology - Fear & Greed Index by DGT
    //# * Author      : © dgtrd
    //# *
    //# * Revision History
    //# *  Release    : Jul 21, 2020
    //# *  Update     : Apr 09, 2021 : Added ability to display Current Time Frame's Fear and Greed Index
    //# *  Update     : Apr 09, 2022 : Added Price Candle display option with Fear & Greed weighted risk levels 
    //# *
    //# * ══════════════════════════════════════════════════════════════════════════════════════════════
    // ══════════════════════════════════════════════════════════════════════════════════════════════════ //

    indicator('Trading Psychology - Fear & Greed Index by DGT''.'truemax_bars_back=252)

    // -Inputs ====================================================================================== //

    display input.string('Price Candles''Display as'options=['Price Candles''Fear & Greed Index'])
    smoothLength input.int(5'RMA Smoothing Length'minval=1maxval=13)
    faster input(false'Fear & Greed Index : Calculation with Faster Legths')
    daily input(true'Display Daily Time Frame Calculated Value')
    lagendDesc input(true'Show Color Legend')
    hLabel input(false'Hide Statistical Label')


    fastLength faster 13 21
    slowLength 
    faster 89 144

    // -Calculations ================================================================================ //

    pmacd = (close ta.ema(closeslowLength) - 1) * 100
    pmacd_d 
    request.security(syminfo.tickerid'D'pmacdbarmerge.gaps_offbarmerge.lookahead_on)

    ror = (close close[slowLength]) / close[slowLength] * 100
    ror_d 
    request.security(syminfo.tickerid'D'rorbarmerge.gaps_offbarmerge.lookahead_on)

    accDist close == high and close == low or high == low : (close low high) / (high low)
    nzVolume nz(volume)
    moneyFlow math.sum(accDist nzVolumefastLength) / math.sum(nzVolumefastLength) * 100

    accDist_d 
    request.security(syminfo.tickerid'D'accDistbarmerge.gaps_offbarmerge.lookahead_on)
    nzVolume_d request.security(syminfo.tickerid'D'nzVolume)
    moneyFlow_d math.sum(accDist_d nzVolume_dfastLength) / math.sum(nzVolume_dfastLength) * 100

    vix 
    request.security('VIX'timeframe.period, -(close ta.ema(closeslowLength) - 1) * 100barmerge.gaps_offbarmerge.lookahead_on)
    vix_d request.security('VIX''D', -(close ta.ema(closeslowLength) - 1) * 100barmerge.gaps_offbarmerge.lookahead_on)

    gold request.security('BIST:XU100'timeframe.period, -(close[fastLength] / close) * 100barmerge.gaps_offbarmerge.lookahead_on)
    gold_d request.security('BIST:XU100''D', -(close[fastLength] / close) * 100barmerge.gaps_offbarmerge.lookahead_on)

    cycle_raw nzVolume math.avg(pmacdrormoneyFlowvixgold) : math.avg(pmacdrorvixgold)
    cycle_raw_d nzVolume_d math.avg(pmacd_dror_dmoneyFlow_dvix_dgold_d) : math.avg(pmacd_dror_dvix_dgold_d)

    cycle ta.rma(cycle_rawsmoothLength)
    cycle_d ta.rma(cycle_raw_dsmoothLength)

    f_getText(_cycle) =>
        if 
    _cycle 73
            
    'AŞIRI ÇOSKULU'
        
    else if _cycle 33
            
    'ÇOSKULU'
        
    else if _cycle < -25
            
    'KORKU'
        
    else if _cycle < -41
            
    'AŞIRI KORKU'
        
    else
            
    'NÖTR'

    f_getColor(_cycle) =>
        if 
    _cycle >= 73
            
    #006400
        
    else if _cycle >= 63 and _cycle 73
            
    #007439
        
    else if _cycle >= 52 and _cycle 63
            
    #008368
        
    else if _cycle >= 41 and _cycle 52
            
    #009096
        
    else if _cycle >= 30 and _cycle 41
            
    #009bbf
        
    else if _cycle >= 20 and _cycle 30
            
    #00a4df
        
    else if _cycle >= 10 and _cycle 20
            
    #00a4df
        
    else if _cycle >= and _cycle 10
            
    #65a095
        
    else if _cycle < -and _cycle >= -10
            
    #b7b763
        
    else if _cycle < -10 and _cycle >= -15
            
    #fafa6e
        
    else if _cycle < -15 and _cycle >= -20
            
    #fecb35
        
    else if _cycle < -20 and _cycle >= -25
            
    #ff9800
        
    else if _cycle < -25 and _cycle >= -31
            
    #ff7434
        
    else if _cycle < -31 and _cycle >= -37
            
    #ff5252
        
    else if _cycle < -37 and _cycle >= -41
            
    #c72e29
        
    else if _cycle < -41
            
    #910000
        
    else
            
    #92928f

    f_getColor1(_cycle) =>
        if 
    _cycle >= 73
            
    #910000
        
    else if _cycle >= 63 and _cycle  <  73
            
    #c72e29
        
    else if _cycle >= 52 and _cycle  <  63
            
    #ff5252
        
    else if _cycle >= 41 and _cycle  <  52
            
    #ff7434
        
    else if _cycle >= 30 and _cycle  <  41
            
    #ff9800
        
    else if _cycle >= 20 and _cycle  <  30
            
    #fecb35
        
    else if _cycle >= 10 and _cycle  <  20
            
    #fafa6e
        
    else if _cycle >= 5  and _cycle  <  10
            
    #b7b763
        
    else if _cycle < -5  and _cycle >= -10
            
    #65a095
        
    else if _cycle < -10 and _cycle >= -15
            
    #00a4df
        
    else if _cycle < -15 and _cycle >= -20
            
    #00a4df
        
    else if _cycle < -20 and _cycle >= -25
            
    #009bbf
        
    else if _cycle < -25 and _cycle >= -31
            
    #009096
        
    else if _cycle < -31 and _cycle >= -37
            
    #008368
        
    else if _cycle < -37 and _cycle >= -41
            
    #007439
        
    else if _cycle < -41 
            
    #006400
        
    else
            
    #92928f

    // -Plotting ==================================================================================== //

    fgColor daily f_getColor(cycle_d) : f_getColor(cycle)
    //plot(display == 'Fear & Greed Index' ? daily ? cycle_d : cycle : na, 'Psychology of The Market Cycle - Index Display', fgColor, 2)

    var label fgiLabel na
    if not hLabel
        fgiLabel 
    := label.new(time math.round(ta.change(time) * 7), display == 'Price Candles' close daily cycle_d cycle, (daily '*Daily' 'Daily') + ' Time Frame : ' f_getText(cycle_d) + ' : ' 
                                 
    str.tostring(math.round(cycle_d2)) + '%\n' + (daily 'Current' '*Current') + ' Time Frame (' timeframe.period ') : ' f_getText(cycle) + ' : ' 
                                 
    str.tostring(math.round(cycle2)) + '%'xloc.bar_timetooltip='Psychology of The Market Cycle by DGT\n\n' 'Fear & Greed Index :\nDaily Time Frame : ' f_getText(cycle_d) + ' : ' 
                                 
    str.tostring(math.round(cycle_d2)) + '%\nCurrent Time Frame (' timeframe.period ') : ' f_getText(cycle) + ' : ' 
                                 
    str.tostring(math.round(cycle2)) + '%' '%\n\nReference Sources : ' '\n-------------------------------------------------------------------' 
                                 
    '\n 1 - Price Convergence/Divergence to/from its Moving Average (' str.tostring(slowLength) + ') :\n     Daily TF ' str.tostring(math.round(pmacd_d2)) + '% / Current TF ' str.tostring(math.round(pmacd2)) + '%' 
                                 
    '\n 2 - Rate of Return (Momentum/RoC), Length (' str.tostring(slowLength) + ') :\n     Daily TF ' str.tostring(math.round(ror_d2)) + '% / Current TF ' str.tostring(math.round(ror2)) + '%' 
                                 
    '\n 3 - Chaikin Money Flow, Length (' str.tostring(fastLength) + ') :\n     Daily TF ' str.tostring(math.round(moneyFlow_d2)) + '% / Current TF ' str.tostring(math.round(moneyFlow2)) + '% \n      ps: cmf calculated only if volume data is provided' 
                                 
    '\n 4 - VIX - Volatility (Fear) Index, Length (' str.tostring(slowLength) + ') :\n     Daily TF ' str.tostring(math.round(vix_d2)) + '% / Current TF ' str.tostring(math.round(vix2)) + '%' 
                                 
    '\n 5 - Safe Haven Demand - Gold Demand, Length (' str.tostring(fastLength) + ') :\n     Daily TF ' str.tostring(math.round(gold_d2)) + '% / Current TF ' str.tostring(math.round(gold2)) + '%' 
                                 
    '\n\nWarren Buffett’s quote, buy when others are fearful, and sell when others are greedy'color=color.new(color.gray85), style=label.style_label_lefttextcolor=color.graytextalign=text.align_left)

    label.delete(fgiLabel[1])

    var 
    0., var 0., var 0., var 0.

    if display == 'Price Candles'
        
    := open:= high:= low:= close

    fgColor 
    := daily f_getColor1(cycle_d) : f_getColor1(cycle)

    if 
    display == 'Fear & Greed Index'
        
    fgColor := na

    //plotcandle(o, h, l, c, 'Psychology of The Market Cycle - Price Display', fgColor, fgColor, bordercolor = fgColor)

    //var table logo = table.new(position.bottom_right, 1, 1)
    //table.cell(logo, 0, 0, "☼☾  ", text_size = size.normal, text_color = color.teal)


    var table legend table.new(position.middle_center   15)

    if 
    lagendDesc
        
    if display == 'Price Candles'
            
    table.cell(legend00"Max FIRSAT █"text_size size.smalltext_color #006400, text_halign = text.align_right)
            
    table.cell(legend01"FIRSAT █"text_size size.smalltext_color #008368, text_halign = text.align_right)
            
    table.cell(legend02"NÖTR █"text_size size.smalltext_color #92928f, text_halign = text.align_right)
            
    table.cell(legend03"RİSK █"text_size size.smalltext_color #ff7434, text_halign = text.align_right)
            
    table.cell(legend04"Max RİSK █"text_size size.smalltext_color #910000, text_halign = text.align_right)
        
    else
            
    table.cell(legend00"AŞIRI ÇOŞKU █"text_size size.smalltext_color #006400, text_halign = text.align_right)
            
    table.cell(legend01"ÇOŞKU █"text_size size.smalltext_color #008368, text_halign = text.align_right)
            
    table.cell(legend02"NÖTR █"text_size size.smalltext_color #92928f, text_halign = text.align_right)
            
    table.cell(legend03"KORKU █"text_size size.smalltext_color #ff7434, text_halign = text.align_right)
            
    table.cell(legend04"AŞIRI KORKU █"text_size size.smalltext_color #910000, text_halign = text.align_right) 
    Teknik olarak; yarına gebe olan bugünü yaşamalı ki, yarın, yaşanmış olsun.

Sayfa 372/440 İlkİlk ... 272322362370371372373374382422 ... 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
  •