FRACTAL WILLIAMS TRADINGVIEW

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #190355 quote
    CIRONET
    Participant
    New

    Hola a todos. Sé que existen varios indicadores FRACTAL WILLIAMS en el foro pero éste particularmente de la plataforma Tradingview me interesa mucho. Os adjunto el código de dicha plataforma para ver si pudieran transcribirlo a PRT por favor. Gracias por vuestro tiempo.

    //@version=5
    indicator(“Williams Fractals”, shorttitle=”Fractals”, format=format.price, precision=0, overlay=true)
    // Define “n” as the number of periods and keep a minimum value of 2 for error handling.
    n = input.int(title=”Periods”, defval=2, minval=2)

    // UpFractal
    bool upflagDownFrontier = true
    bool upflagUpFrontier0 = true
    bool upflagUpFrontier1 = true
    bool upflagUpFrontier2 = true
    bool upflagUpFrontier3 = true
    bool upflagUpFrontier4 = true

    for i = 1 to n
    upflagDownFrontier := upflagDownFrontier and (high[n-i] < high[n]) upflagUpFrontier0 := upflagUpFrontier0 and (high[n+i] < high[n]) upflagUpFrontier1 := upflagUpFrontier1 and (high[n+1] <= high[n] and high[n+i + 1] < high[n]) upflagUpFrontier2 := upflagUpFrontier2 and (high[n+1] <= high[n] and high[n+2] <= high[n] and high[n+i + 2] < high[n]) upflagUpFrontier3 := upflagUpFrontier3 and (high[n+1] <= high[n] and high[n+2] <= high[n] and high[n+3] <= high[n] and high[n+i + 3] < high[n]) upflagUpFrontier4 := upflagUpFrontier4 and (high[n+1] <= high[n] and high[n+2] <= high[n] and high[n+3] <= high[n] and high[n+4] <= high[n] and high[n+i + 4] < high[n]) flagUpFrontier = upflagUpFrontier0 or upflagUpFrontier1 or upflagUpFrontier2 or upflagUpFrontier3 or upflagUpFrontier4 upFractal = (upflagDownFrontier and flagUpFrontier) // downFractal bool downflagDownFrontier = true bool downflagUpFrontier0 = true bool downflagUpFrontier1 = true bool downflagUpFrontier2 = true bool downflagUpFrontier3 = true bool downflagUpFrontier4 = true for i = 1 to n downflagDownFrontier := downflagDownFrontier and (low[n-i] > low[n])
    downflagUpFrontier0 := downflagUpFrontier0 and (low[n+i] > low[n])
    downflagUpFrontier1 := downflagUpFrontier1 and (low[n+1] >= low[n] and low[n+i + 1] > low[n])
    downflagUpFrontier2 := downflagUpFrontier2 and (low[n+1] >= low[n] and low[n+2] >= low[n] and low[n+i + 2] > low[n])
    downflagUpFrontier3 := downflagUpFrontier3 and (low[n+1] >= low[n] and low[n+2] >= low[n] and low[n+3] >= low[n] and low[n+i + 3] > low[n])
    downflagUpFrontier4 := downflagUpFrontier4 and (low[n+1] >= low[n] and low[n+2] >= low[n] and low[n+3] >= low[n] and low[n+4] >= low[n] and low[n+i + 4] > low[n])
    flagDownFrontier = downflagUpFrontier0 or downflagUpFrontier1 or downflagUpFrontier2 or downflagUpFrontier3 or downflagUpFrontier4

    downFractal = (downflagDownFrontier and flagDownFrontier)

    plotshape(downFractal, style=shape.triangledown, location=location.belowbar, offset=-n, color=#F44336, size = size.small)
    plotshape(upFractal, style=shape.triangleup, location=location.abovebar, offset=-n, color=#009688, size = size.small)

    #190360 quote
    Nicolas
    Keymaster
    Master

    Es un fractal con período personalizado, revisa este código y cambia el período con la variable "cp" en la parte superior del código: https://www.prorealcode.com/topic/indicateurs-bill-williams/#post-20690

    thanked this post
    #190362 quote
    deletedaccount22102025
    Participant
    New

    Muchas gracias Nicolás. Era lo buscaba….por cierto se echa de menos alguna publicación de una estrategia tuya actual. Un saludo

    AngelPujalt thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

FRACTAL WILLIAMS TRADINGVIEW


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
CIRONET @cironet Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by deletedaccount22102025
3 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 03/23/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...