Retroceso Simple Fibonacci

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #244893 quote
    Maricarmen
    Participant
    Junior

    Buenas:

    Se podría traducir este indicador a esta plataforma, es bastante simple pero ofrece las dos lecturas Fibonacci  según el ultimo segmento Ascendente/descendente en un mismo gráfico., es:

    https://www.tradingview.com/script/mWmIRNVF-Simple-Fibonacci-Retracement/

    Gracias,

    #244905 quote
    Iván González
    Moderator
    Master

    hola.

    Aquí tienes el indicador

    //----------------------------------------//
    //PRC_Fibonacci Retracement
    //version = 0
    //13.03.25
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //----------------------------------------//
    // Inputs
    //----------------------------------------//
    defparam drawonlastbaronly=true
    fperiod=200
    reverse=1
    //----------------------------------------//
    // Calculations
    //----------------------------------------//
    if islastbarupdate then
    
    Fhigh=highest[fperiod](high)
    Flow=lowest[fperiod](low)
    FH=max(highestBars[fperiod](high),1)
    FL=max(lowestBars[fperiod](low),1)
    bb=min(barindex[FH],barindex[FL])
    
    if reverse=0 then
    revfibs=FL>FH
    else
    revfibs=FL<FH
    endif
    
    if revfibs then
    current=(close-Flow)/(Fhigh-Flow)
    fib0=(Fhigh-Flow)*0+Flow
    fib236=(Fhigh-Flow)*0.236+Flow
    fib382=(Fhigh-Flow)*0.382+Flow
    fib500=(Fhigh-Flow)*0.500+Flow
    fib618=(Fhigh-Flow)*0.618+Flow
    fib786=(Fhigh-Flow)*0.786+Flow
    fib1000=(Fhigh-Flow)*1+Flow
    r=255
    g=0
    b=0
    else
    current=(Fhigh-close)/(Fhigh-Flow)
    fib0=Fhigh-(Fhigh-Flow)*0
    fib236=Fhigh-(Fhigh-Flow)*0.236
    fib382=Fhigh-(Fhigh-Flow)*0.382
    fib500=Fhigh-(Fhigh-Flow)*0.500
    fib618=Fhigh-(Fhigh-Flow)*0.618
    fib786=Fhigh-(Fhigh-Flow)*0.786
    fib1000=Fhigh-(Fhigh-Flow)*1
    r=100
    g=255
    b=100
    endif
    //----------------------------------------//
    //Draw Fibonacci Levels
    //----------------------------------------//
    drawsegment(bb,fib0,barindex+10,fib0)style(dottedline)
    drawsegment(bb,fib236,barindex+10,fib236)style(dottedline)coloured(r,g,b)
    drawsegment(bb,fib382,barindex+10,fib382)style(dottedline)coloured(r,g,b)
    drawsegment(bb,fib500,barindex+10,fib500)style(dottedline)coloured(r,g,b)
    drawsegment(bb,fib618,barindex+10,fib618)style(dottedline)coloured(r,g,b)
    drawsegment(bb,fib786,barindex+10,fib786)style(dottedline)coloured(r,g,b)
    drawsegment(bb,fib1000,barindex+10,fib1000)style(dottedline)
    //----------------------------------------//
    //Drawtext Fibonacci Levels
    //----------------------------------------//
    drawtext("0     : (#fib0#)",barindex+20,fib0)
    drawtext("23.6% : (#fib236#)",barindex+20,fib236)
    drawtext("38.2% : (#fib382#)",barindex+20,fib382)
    drawtext("50.0% : (#fib500#)",barindex+20,fib500)
    drawtext("61.8% : (#fib618#)",barindex+20,fib618)
    drawtext("78.6% : (#fib786#)",barindex+20,fib786)
    drawtext("100 % : (#fib1000#)",barindex+20,fib1000)
    endif
    
    //----------------------------------------//
    return
    Maricarmen thanked this post
    #244918 quote
    Maricarmen
    Participant
    Junior

    Ivan:

    En minutajes altos no coge el ultimo segmento de ahí que traza avances Fibonacci, sin embargo, al ir bajando en minutos si coge el ultimo segmento y coge ya el retroceso Fibonacci

    correcto. No permite la configuración del indicador  para invertir djchos  niveles como te comentaba.

    No obstante si los cambia  en configuración si cambio el eje y leo el precio al revés (O sea de arriba hacia abajo).

    En todo lo demás funciona correctamente. Gracias,

    Iván González thanked this post
    #244923 quote
    Iván González
    Moderator
    Master

    Hola. No entiendo muy bien lo de minutajes altos. he chequeado en varios timeframes y con varios activos y funciona correcto.
    Al final lo que hace, independientemente del timeframe es chequear 200 barras, nada más…
    por otro lado, respecto a cambiar el eje, lo he programado para que así sea. Sólo tienes que cambiar la linea 12 reverse=1 por reverse=0.

    Y mejor aún, si creas las variables de fperiod (como entero) y reverse (como boleano) lo podrás coonfigurar directamente desde el cuadro de configuración.

    robertogozzi thanked this post
    #244946 quote
    Maricarmen
    Participant
    Junior

    Iván:

    A veces tenemos el tren delante y no lo vemos. Debe ser problemas de la edad.

    Con las explicaciones que me diste, todo aclarado. Incluso en la variable  fperiod si pongo menos ya corrige también todo lo que te había expuesto.

    Muchísimas gracias,

    Iván González thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Retroceso Simple Fibonacci


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
Maricarmen @maricarmen Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Maricarmen
10 months, 4 weeks ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 03/13/2025
Status: Active
Attachments: No files
Logo Logo
Loading...