Necesito Indicador para valores que estén empezando la onda 3 de elliott

Forums ProRealTime foro Español Soporte ProBuilder Necesito Indicador para valores que estén empezando la onda 3 de elliott

  • This topic has 4 replies, 2 voices, and was last updated 4 days ago by avatarIván.
Viewing 5 posts - 1 through 5 (of 5 total)
  • #243366

    Iván: Veo que la mayor parte de foreros éstan pidiendo el Screener  de cuando empieza la Onda 3 o bien la Extensión de Fibonacci con retroceso 0.618 %. Creo que primero tengo que empezar por conseguir el indicador para luego

    hacer el Screener correspondiente.

    Voy o vamos abusar un poco de tu confianza para ver si se puede conseguir la conversión de este indicador de Tradingview que acabo de visualizar, con el enlace:

    https://es.tradingview.com/script/2nHEU4W8/

    Gracias,

    A continuación te voy a pasar la codificación:

     

    // This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © ShunKK
    //@version=5
    indicator(“fibs Retracement/Extension”, “fibs Retracement/Extension”, overlay = true, max_lines_count = 500, max_labels_count = 500)
    //——————————————————————————
    //Settings
    //—————————————————————————–{
    length = input.int(defval = 8,minval = 8,step = 1,group = ‘ZigZagLength’)
    //—————————————————————————–}
    //Data
    //—————————————————————————–{
    var float phy = na
    var float ply = na
    var zigzagCh = 0
    var ZigZagTopArr = array.new_float(0)
    var ZigZagBotArr = array.new_float(0)
    var ZigZagbarTopArr = array.new_int(0)
    var ZigZagbarBptArr = array.new_int(0)
    var ZigZagUpArr = array.new_line(0)
    var ZigZagDnArr = array.new_line(0)
    _array_add_section(_array,add_value)=>
        array.push(_array,add_value)
    _array_add_section2(_array,add_value)=>
        index = _array.size()-1
        if index > 0
            array.remove(_array,index)
        array.push(_array,add_value)
    _array_line_Set(_ZigZagTopArr,_ZigZagbarTopArr,_ZigZagBotArr,_ZigZagbarBptArr,_bar_index,_ZigZagUpArr,_ph,_phy,_zigzagCh,ZigZagtrend)=>
        _zigzagCh1 = _zigzagCh
        if ZigZagtrend
            if _zigzagCh == -1
                if _ph > _phy
                    _array_add_section2(_ZigZagTopArr,_ph)
                    _array_add_section2(_ZigZagbarTopArr,_bar_index)
                    idex = _ZigZagUpArr.size() -1
                    line.set_x2(_ZigZagUpArr.get(idex),_bar_index)
                    line.set_y2(_ZigZagUpArr.get(idex),_ph)
                    _zigzagCh1 := 1
            else
                _array_add_section(_ZigZagTopArr,_ph)
                _array_add_section(_ZigZagbarTopArr,_bar_index)
                //Set label
            ZigTop = _ZigZagTopArr.size() -1
            ZigBot = _ZigZagBotArr.size() -1
            if ZigTop > 0 and ZigBot > 0
                _array_add_section(_ZigZagUpArr,line.new(x1 = _ZigZagbarBptArr.get(ZigBot),y1 = _ZigZagBotArr.get(ZigBot),x2 = _ZigZagbarTopArr.get(ZigTop),y2 = _ZigZagTopArr.get(ZigTop),xloc = xloc.bar_index,color=color.new(color.gray,80),width = 2))
        else
            if zigzagCh == 1
                if _ph < _phy
                    _array_add_section2(_ZigZagBotArr,_ph)
                    _array_add_section2(_ZigZagbarBptArr,_bar_index)
                    idex = _ZigZagUpArr.size() -1
                    line.set_x2(_ZigZagUpArr.get(idex),_bar_index)
                    line.set_y2(_ZigZagUpArr.get(idex),_ph)
                    _zigzagCh1 := -1
            else
                //Set label
                _array_add_section(_ZigZagBotArr,_ph)
                _array_add_section(_ZigZagbarBptArr,_bar_index)
            ZigTop = _ZigZagTopArr.size() -1
            ZigBot = _ZigZagBotArr.size() -1
            if ZigTop > 0 and ZigBot > 0
                _array_add_section(_ZigZagUpArr,line.new(x1 = _ZigZagbarTopArr.get(ZigTop),y1 = _ZigZagTopArr.get(ZigTop),x2 = _ZigZagbarBptArr.get(ZigBot),y2 = _ZigZagBotArr.get(ZigBot),xloc = xloc.bar_index,color=color.new(color.gray,80),width = 2))
        _zigzagCh1
    _Retracement_Set(_array1,_leg,_array2,_line)=>
        ZigZagLegindex = _array1.size() -1 – _leg
        _y1 = line.get_y1(_array1.get(ZigZagLegindex))
        _y2 = line.get_y2(_array1.get(ZigZagLegindex))
        _x1 = line.get_x1(_array1.get(ZigZagLegindex))
        _x2 = bar_index
        for i = 0 to 6
            fibline = fibs.retracement(_y1,_y2,_array2.get(i))
            line.set_x1(_line.get(i),_x1)
            line.set_x2(_line.get(i),_x2)
            line.set_y1(_line.get(i),fibline)
            line.set_y2(_line.get(i),fibline)
    _Extension_Set(_array_A,_array_B,_array_C,_leg,_array2,_line,_array_X1,_array_X2,_array_X3,_line8_ex,_line9_ex,_color)=>
        ZigZagLegindex = _array_A.size() -1 – _leg
        _a = _array_A.get(ZigZagLegindex)
        _b = _array_B.get(ZigZagLegindex)
        _c = _array_C.get(ZigZagLegindex)
        _x1 = _array_X1.get(ZigZagLegindex)
        _x2 = _array_X2.get(ZigZagLegindex)
        _x3 = _array_X3.get(ZigZagLegindex)
        _line8_ex.set_xy1(_x3,_a)
        _line8_ex.set_xy2(_x1,_b)
        _line8_ex.set_color(_color)
        _line9_ex.set_xy1(_x1,_b)
        _line9_ex.set_xy2(_x2,_c)
        _line9_ex.set_color(_color)
        for i = 0 to 7
            fibline = fibs.extension(_a,_b,_c,_array2.get(i))
            line.set_x1(_line.get(i),_x1)
            line.set_x2(_line.get(i),_x2)
            line.set_y1(_line.get(i),fibline)
            line.set_y2(_line.get(i),fibline)
    _Extension_array_Set(_array_A,_fibExt_A,_fibExt_B,_fibExt_C,_ExtensionSet_x1,_ExtensionSet_x2,_ExtensionSet_x3,_trendSw)=>
        for i = 1 to _array_A.size() -1
            _a = line.get_y2(_array_A.get(i-1))
            _b = line.get_y1(_array_A.get(i))
            _c = line.get_y2(_array_A.get(i))
            _x1 = line.get_x1(_array_A.get(i))
            _x2 = line.get_x2(_array_A.get(i))
            _x3 = line.get_x2(_array_A.get(i-1))
            if _trendSw
                if _a < _c
                    _array_add_section(_fibExt_A,_a)
                    _array_add_section(_fibExt_B,_b)
                    _array_add_section(_fibExt_C,_c)
                    _array_add_section(_ExtensionSet_x1,_x1)
                    _array_add_section(_ExtensionSet_x2,_x2)
                    _array_add_section(_ExtensionSet_x3,_x3)
            else
                if _a > _c
                    _array_add_section(_fibExt_A,_a)
                    _array_add_section(_fibExt_B,_b)
                    _array_add_section(_fibExt_C,_c)
                    _array_add_section(_ExtensionSet_x1,_x1)
                    _array_add_section(_ExtensionSet_x2,_x2)
                    _array_add_section(_ExtensionSet_x3,_x3)
    o = open[length]
    h = high[length]
    l = low[length]
    c = close[length]
    d = math.abs(c – o)
    ph = ta.pivothigh(length, length)
    pl = ta.pivotlow(length, length)
    //—————————————————————————–}
    //Set labels
    //—————————————————————————–{
    n = bar_index
    var ZigTop = 0
    var ZigBot = 0
    if ph
        zigzagCh := _array_line_Set(ZigZagTopArr,ZigZagbarTopArr,ZigZagBotArr,ZigZagbarBptArr,n[length],ZigZagUpArr,ph,phy,zigzagCh,true)
        phy := ph
        zigzagCh := -1
    else if pl
        zigzagCh := _array_line_Set(ZigZagTopArr,ZigZagbarTopArr,ZigZagBotArr,ZigZagbarBptArr,n[length],ZigZagDnArr,pl,ply,zigzagCh,false)
        ply := pl
        zigzagCh := 1
    //—————————————————————————–}
    TrendSw = input.int(defval = 1,title = ‘FibTrend [1 :Bull] ,[-1:Bear],[0.:None]’,options = [0,1,-1],group = ‘FibsConfing_Trend’)
    ZigZagleg = input.int(defval = 1,minval = 0,title = ‘FibRetraceSet CountBack’ ,group = ‘FibsConfing_Rit’)
    TrendSw_Ex = TrendSw
    ZigZagleg_Ex = input.int(defval = 0,minval = 0,title = ‘FibExtensionSet CountBack’ ,group = ‘FibsConfing_Ext’)
    import HeWhoMustNotBeNamed/FibRatios/1 as fibs
    var fibarray = array.new_float(0)
    var fibarray2 = array.new_float(0)
    var fibarrayline  = array.new_line(0)
    var fibarrayline2 = array.new_line(0)
    var fibarrayline3 = array.new_line(0)
    var fibarrayline4 = array.new_line(0)
    var fibSetSw = true
    var line0 = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.gray  ,40))
    var line1 = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.red   ,40))
    var line2 = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.orange,40))
    var line3 = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.green ,40))
    var line4 = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.blue  ,40))
    var line5 = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.aqua  ,40))
    var line6 = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.gray  ,40))
    var line0_ex = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.gray  ,40))
    var line1_ex = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.red   ,40))
    var line2_ex = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.orange,40))
    var line3_ex = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.green ,40))
    var line4_ex = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.blue  ,40))
    var line5_ex = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.aqua  ,40))
    var line6_ex = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.white ,40))
    var line7_ex = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.gray  ,40))
    var line8_ex = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.white  ,0),style = line.style_dashed,width = 3)
    var line9_ex = line.new(0, low, bar_index, high, extend=extend.none,xloc = xloc.bar_index,color=color.new(color.white  ,0),style = line.style_dashed,width = 3)
    var fibExt_A = array.new_float(0)
    var fibExt_B = array.new_float(0)
    var fibExt_C = array.new_float(0)
    var fibExt_AA = array.new_float(0)
    var fibExt_BB = array.new_float(0)
    var fibExt_CC = array.new_float(0)
    var ExtensionSet_x1 = array.new_int(0)
    var ExtensionSet_x2 = array.new_int(0)
    var ExtensionSet_x3 = array.new_int(0)
    var ExtensionSet_x1a = array.new_int(0)
    var ExtensionSet_x2a = array.new_int(0)
    var ExtensionSet_x3a = array.new_int(0)
    if fibSetSw
        fibSetSw := false
        fibarray.insert(0,0.0)
        fibarrayline.insert(0,line0)
        fibarray.insert(1,0.236)
        fibarrayline.insert(1,line1)
        fibarray.insert(2,0.382)
        fibarrayline.insert(2,line2)
        fibarray.insert(3,0.5)
        fibarrayline.insert(3,line3)
        fibarray.insert(4,0.618)
        fibarrayline.insert(4,line4)
        fibarray.insert(5,0.786)
        fibarrayline.insert(5,line5)
        fibarray.insert(6,1.0)
        fibarrayline.insert(6,line6)
        fibarray2.insert(0,0.618)
        fibarrayline2.insert(0,line0_ex)
        fibarray2.insert(1,1.0)
        fibarrayline2.insert(1,line1_ex)
        fibarray2.insert(2,1.382)
        fibarrayline2.insert(2,line2_ex)
        fibarray2.insert(3,1.618)
        fibarrayline2.insert(3,line3_ex)
        fibarray2.insert(4,2.382)
        fibarrayline2.insert(4,line4_ex)
        fibarray2.insert(5,2.618)
        fibarrayline2.insert(5,line5_ex)
        fibarray2.insert(6,3.618)
        fibarrayline2.insert(6,line6_ex)
        fibarray2.insert(7,4.236)
        fibarrayline2.insert(7,line7_ex)
    linefill.new(line2_ex,line3_ex,TrendSw_Ex == 1 ? color.new(color.lime,90) : TrendSw_Ex == -1 ? color.new(color.red,90) : na)
    linefill.new(line4_ex,line5_ex,TrendSw_Ex == 1 ? color.new(color.lime,90) : TrendSw_Ex == -1 ? color.new(color.red,90) : na)
    linefill.new(line6_ex,line7_ex,TrendSw_Ex == 1 ? color.new(color.lime,90) : TrendSw_Ex == -1 ? color.new(color.red,90) : na)
    linefill.new(line6,line4,TrendSw == 1 ? color.new(color.lime,90) : TrendSw == -1 ? color.new(color.red,90) : na)
    var fibsw  = false
    var fibsw2 = false
    var ZigZagCheck1    =0,var ZigZagCheck2    = 0,ZigZagCheck3    = 0,ZigZagCheck4    = 0
    var ZigZagCheck1_bk =0,var ZigZagCheck2_bk = 0,ZigZagCheck3_bk = 0,ZigZagCheck4_bk = 0
    if TrendSw != 0 and zigzagCh != zigzagCh[1]
        ZigZagCheck1 := ZigZagUpArr.size() -1 – ZigZagleg
        if ZigZagCheck1 >= 0 and TrendSw == 1 and zigzagCh == -1 and ZigZagCheck1_bk != ZigZagCheck1
            ZigZagCheck1_bk := ZigZagCheck1
            _Retracement_Set(ZigZagUpArr,ZigZagleg,fibarray,fibarrayline)
            fibsw := true
        ZigZagCheck2 := ZigZagDnArr.size() -1 – ZigZagleg
        if ZigZagCheck2 >= 0 and TrendSw == -1 and zigzagCh == 1 and ZigZagCheck2 != ZigZagCheck2_bk
            ZigZagCheck2_bk := ZigZagCheck2
            _Retracement_Set(ZigZagDnArr,ZigZagleg,fibarray,fibarrayline)
            fibsw := true
    if TrendSw_Ex != 0 and zigzagCh != zigzagCh[1]
        if TrendSw_Ex == 1 and ZigZagDnArr.size() -1 > 1 and zigzagCh == 1
            _Extension_array_Set(ZigZagDnArr,fibExt_A,fibExt_B,fibExt_C,ExtensionSet_x1,ExtensionSet_x2,ExtensionSet_x3,true)
        if TrendSw_Ex == -1 and ZigZagUpArr.size() -1 > 1 and zigzagCh == -1
            _Extension_array_Set(ZigZagUpArr,fibExt_AA,fibExt_BB,fibExt_CC,ExtensionSet_x1a,ExtensionSet_x2a,ExtensionSet_x3a,false)
        ZigZagCheck3 := fibExt_A.size() -1 – ZigZagleg_Ex
        if ZigZagCheck3  >= 0 and  TrendSw_Ex == 1 and ZigZagCheck3 != ZigZagCheck3_bk
            ZigZagCheck3_bk := ZigZagCheck3
            fibsw2 := true
            _Extension_Set(fibExt_A,fibExt_B,fibExt_C,ZigZagleg_Ex,fibarray2,fibarrayline2,ExtensionSet_x1,ExtensionSet_x2,ExtensionSet_x3,line8_ex,line9_ex,color.white)
        ZigZagCheck4 := fibExt_AA.size() -1 – ZigZagleg_Ex
        if ZigZagCheck4  >= 0 and  TrendSw_Ex == -1 and ZigZagCheck4 != ZigZagCheck4_bk
            ZigZagCheck4_bk := ZigZagCheck4
            fibsw2 := true
            _Extension_Set(fibExt_AA,fibExt_BB,fibExt_CC,ZigZagleg_Ex,fibarray2,fibarrayline2,ExtensionSet_x1a,ExtensionSet_x2a,ExtensionSet_x3a,line8_ex,line9_ex,color.white)
    if barstate.islast and fibsw
        for i = 0 to 6
            line.set_x2(fibarrayline.get(i),bar_index)
    if barstate.islast and fibsw2
        for i = 0 to 7
            line.set_x2(fibarrayline2.get(i),bar_index)

     

     

    #243590

    Aquí va el indicador.

    #243605

    Buenas

    Hice la comprobación del indicador en un gráfico de MTS de 1 Hora y las extensiones están clavadas. Eso indica IVAN que clavaste la idea.

    No obstante si se pudiesen modificar el texto,  creo que sería más ilustrativo.

    Me explico mejor, en lugar de marcar los niveles Fibonacci del 0 al 100% (Longitud que va entre el inicio del pivote 1 y del pivote 2).

    Deberíamos poner sobre las extensiones dichos porcentajes. Por supuesto si esto fuera posible.

    Es fabuloso lo que hiciste.

    GRACIAS

     

    #243606

    Se me olvido el gráfico que adjunto

    #243662

    Hola! me alegro que funcione.
    El texto lo puedes añadir fácilmente. Sólo tienes que modificar las líneas 152-154 y 206-208 por los niveles que necesites. Puedes incluso añadir más líneas siguiendo esa estructura.

Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login