Aplicación con Fibonacci

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #232524 quote
    Maricarmen
    Participant
    New

    Buenos Días:

    Sería posible convertir este indicador en screener.

    Quisiera hacer unas pruebas a nivel Fibonacci con los resultados que arojase el screener

    //—Initialisation Zeiierman

    once idx0 = 0
    once idx1 = 0
    once idx2 = 0
    once pos = 0

    ATR = AverageTrueRange[prd](typicalprice)

    IF barindex >= 2*prd+1 then

    If high[prd] >= highest[2*prd+1](high) and pos<=0 then

    If idx1 <> 0 then
    idx2 = idx1
    Endif

    If idx0 <> 0 then
    idx1 = idx0
    Endif

    idx0 = barindex[prd]
    pos=1

    If idx2<>0 then

    If showPvts then
    If High[barindex-idx0]>=High[barindex-idx2] then
    DRAWTEXT(“HH”,idx0,High[barindex-idx0]+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
    else
    DRAWTEXT(“LH”,idx0,High[barindex-idx0]+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
    Endif
    Endif

    Endif
    Endif

    If Low[prd] <= Lowest[2*prd+1](low) and pos>=0 then

    If idx1 <> 0 then
    idx2 = idx1
    Endif

    If idx0 <> 0 then
    idx1 = idx0
    Endif

    idx0 = barindex[prd]
    pos=-1

    If idx2<>0 then

    If showPvts then
    If Low[barindex-idx0]>=Low[barindex-idx2] then
    DRAWTEXT(“HL”,idx0,Low[barindex-idx0]-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
    else
    DRAWTEXT(“LL”,idx0,Low[barindex-idx0]-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
    Endif
    Endif

    Endif
    Endif

    If idx2<>0 then
    If pos=1 and High[barindex-idx0]>Low[barindex-idx1] and High[barindex-idx0]<High[barindex-idx2] and (Close<Low[barindex-idx1] and open>Low[barindex-idx1]) then

    If showPattern then
    DRAWTEXT(“1”,idx2,High[idx2]+ATR[Barindex-Idx2]/2,Dialog,Bold,20) coloured(“BLUE”,255)
    DRAWTEXT(“2”,idx1,Low[barindex-idx1]-ATR[Barindex-Idx1]/2,Dialog,Bold,20) coloured(“BLUE”,255)
    DRAWTEXT(“3”,idx0,High[barindex-idx0]+ATR[Barindex-Idx0]/2,Dialog,Bold,20) coloured(“BLUE”,255)
    DRAWSEGMENT(idx2,High[barindex-idx2],idx1,Low[barindex-idx1]) STYLE(Line,3) coloured(“BLUE”,255)
    DRAWSEGMENT(idx1,Low[barindex-idx1],idx0,High[barindex-idx0]) STYLE(Line,3) coloured(“BLUE”,255)
    Endif

    If showBreak then
    DRAWSEGMENT(idx1,Low[barindex-idx1],barindex+1,Low[barindex-idx1]) STYLE(DOTTEDLINE2,2) coloured(“BLUE”,255)
    DRAWARROWDOWN(barindex,High+ATR/2) coloured(“RED”,255)
    Endif

    Endif

    If pos=-1 and Low[barindex-idx0]<High[barindex-idx1] and Low[barindex-idx0]>Low[barindex-idx2] and (Close>High[barindex-idx1] and open<High[barindex-idx1]) then

    If showPattern then
    DRAWTEXT(“1”,idx2,Low[barindex-idx2]-ATR[Barindex-Idx2]/2,Dialog,Bold,20) coloured(“BLUE”,255)
    DRAWTEXT(“2”,idx1,High[barindex-idx1]+ATR[Barindex-Idx1]/2,Dialog,Bold,20) coloured(“BLUE”,255)
    DRAWTEXT(“3”,idx0,Low[barindex-idx0]-ATR[Barindex-Idx0]/2,Dialog,Bold,20) coloured(“BLUE”,255)
    DRAWSEGMENT(idx2,Low[barindex-idx2],idx1,High[barindex-idx1]) STYLE(Line,3) coloured(“BLUE”,255)
    DRAWSEGMENT(idx1,High[barindex-idx1],idx0,Low[barindex-idx0]) STYLE(Line,3) coloured(“BLUE”,255)
    Endif

    If showBreak then
    DRAWSEGMENT(idx1,High[barindex-idx1],barindex+1,High[barindex-idx1]) STYLE(DOTTEDLINE2,2) coloured(“BLUE”,255)
    DRAWARROWUP(barindex,Low-ATR/2) coloured(“GREEN”,255)
    Endif

    Endif
    Endif
    Endif

    Return

    Gracias,

    #232535 quote
    robertogozzi
    Moderator
    Master

    Esto devolverá instrumentos con una flecha trazada en el gráfico (roja o verde):

    //—Initialisation Zeiierman
    once prd  = 50
    once idx0 = 0
    once idx1 = 0
    once idx2 = 0
    once pos = 0
    Cond     = 0
    IF barindex >= 2*prd+1 then
    If high[prd] >= highest[2*prd+1](high) and pos<=0 then
    If idx1 <> 0 then
    idx2 = idx1
    Endif
    If idx0 <> 0 then
    idx1 = idx0
    Endif
    idx0 = barindex[prd]
    pos=1
    Endif
    If Low[prd] <= Lowest[2*prd+1](low) and pos>=0 then
    If idx1 <> 0 then
    idx2 = idx1
    Endif
    If idx0 <> 0 then
    idx1 = idx0
    Endif
    idx0 = barindex[prd]
    pos=-1
    Endif
    If idx2<>0 then
    If pos=1 and High[barindex-idx0]>Low[barindex-idx1] and High[barindex-idx0]<High[barindex-idx2] and (Close<Low[barindex-idx1] and open>Low[barindex-idx1]) then
    Cond = 2
    Endif
    If pos=-1 and Low[barindex-idx0]<High[barindex-idx1] and Low[barindex-idx0]>Low[barindex-idx2] and (Close>High[barindex-idx1] and open<High[barindex-idx1]) then
    Cond = 1
    Endif
    Endif
    Endif
    IF (high = low) THEN
    Cond = 0
    ENDIF
    Screener[Cond](Cond AS "1=Up,2=Down")
    #232554 quote
    Maricarmen
    Participant
    New

    Gracias Roberto, me contesta algo a lo que quería pero no me siento satisfecho con los resultados obtenidos.

    Sería posible hacer algo con el gráfico que te adjunto con sus explicaciones .

    Un saludo,

    #232568 quote
    robertogozzi
    Moderator
    Master

    Adjunte imágenes únicamente en su formato natural (JPG, PNG, etc…).
    Gracias 🙂

    Lo comprobaré lo antes posible.

    #232588 quote
    Maricarmen
    Participant
    New

    En lo sucesivo aportaré las imágenes como me indica (tendré que ver como se hace, anteriormente).

    Estuve viendo si cogía algunas ideas al respecto y por cierto veo algún gráfico que creo se adapta a lo que pretendo conseguir en:   http://www.tradingview.com/script/JU3WaXGC-Order-Blocks-W-Realtime-Fibs-QuantVue/

    Gracias,

    #236448 quote
    robertogozzi
    Moderator
    Master

    ¡Pido disculpas por la demora!

    Este es un indicador específico para los retrocesos de Fibonacci:

    // Fibonacci Lebels
    //
    DEFPARAM CalculateOnLastBars = 3000
    DEFPARAM DrawOnLastBarOnly   = True
    //
    ONCE p   = 100
    HH      = highest[p](high)
    LL      = lowest[p](low)
    Diff    = HH - LL
    Fib0236 = Diff * 0.236
    Fib0382 = Diff * 0.382
    Fib0500 = Diff * 0.500
    Fib0618 = Diff * 0.618
    Fib0764 = Diff * 0.764
    Up     = 0
    Dn     = 0
    FOR i = 0 TO (p - 1)
       IF high[i] = HH THEN
          Up = 1
          BREAK
       ENDIF
       IF low[i] = LL THEN
          Dn = 1
          BREAK
       ENDIF
    NEXT
    DRAWHLINE(HH) style(Line,2) coloured("Blue")
    DRAWHLINE(LL) style(Line,2) coloured("Red")
    LastBar = BarIndex
    IF Up THEN
       DRAWTEXT("---------------------------(23.6%)",LastBar,HH - Fib0236,SansSerif,Bold,12) coloured("Grey")
       DRAWTEXT("---------------------------(38.2%)",LastBar,HH - Fib0382,SansSerif,Bold,12) coloured("Tan")
       DRAWTEXT("---------------------------(50.0%)",LastBar,HH - Fib0500,SansSerif,Bold,12) coloured("Green")
       DRAWTEXT("---------------------------(61.8%)",LastBar,HH - Fib0618,SansSerif,Bold,12) coloured("Fuchsia")
       DRAWTEXT("---------------------------(76.4%)",LastBar,HH - Fib0764,SansSerif,Bold,12) coloured("DodgerBlue")
    ELSIF Dn THEN
       DRAWTEXT("---------------------------(23.6%)",LastBar,LL + Fib0236,SansSerif,Bold,12) coloured("Grey")
       DRAWTEXT("---------------------------(38.2%)",LastBar,LL + Fib0382,SansSerif,Bold,12) coloured("Tan")
       DRAWTEXT("---------------------------(50.0%)",LastBar,LL + Fib0500,SansSerif,Bold,12) coloured("Green")
       DRAWTEXT("---------------------------(61.8%)",LastBar,LL + Fib0618,SansSerif,Bold,12) coloured("Fuchsia")
       DRAWTEXT("---------------------------(76.4%)",LastBar,LL + Fib0764,SansSerif,Bold,12) coloured("DodgerBlue")
    ENDIF
    RETURN

    y este es el screener (filtro) que devuelve las acciones que tienen un precio que cruza el nivel del 50%:

    // Fibonacci Levels
    //
    ONCE p   = 100
    HH      = highest[p](high)
    LL      = lowest[p](low)
    Diff    = HH - LL
    //Fib0236 = Diff * 0.236
    //Fib0382 = Diff * 0.382
    Fib0500 = Diff * 0.500
    //Fib0618 = Diff * 0.618
    //Fib0764 = Diff * 0.764
    Up     = 0
    Dn     = 0
    FOR i = 0 TO (p - 1)
       IF high[i] = HH THEN
          Up = 1
          BREAK
       ENDIF
       IF low[i] = LL THEN
          Dn = 1
          BREAK
       ENDIF
    NEXT
    c1 = 0
    IF Up THEN
       Level50 = HH - Fib0500
       c1 = (high >= Level50) AND (low <= Level50)
    ELSIF Dn THEN
       Level50 = LL + Fib0500
       c1 = (high >= Level50) AND (low <= Level50)
    ENDIF
    SCREENER[c1 AND (low <> high)]
    Maricarmen thanked this post
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Aplicación con Fibonacci


Soporte ProScreener

New Reply
Author
author-avatar
Maricarmen @maricarmen Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by robertogozzi
1 year, 5 months ago.

Topic Details
Forum: Soporte ProScreener
Language: Spanish
Started: 05/10/2024
Status: Active
Attachments: 2 files
Logo Logo
Loading...