Show weekly fibonnacis on daily graph

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #227431 quote
    kaoklai
    Participant
    New

    Hello,

    I’m looking for a way to show weekly fibonnacis retracements on a daily graph, the perfect thing would is to be possible to chose period to apply after drawing but draw levels as lines are ok too.

    I’m taking the liberty of asking it here because it doesn’t look as simple as it sounds.

    Thanks for your welcome help 🙂

    #227433 quote
    robertogozzi
    Moderator
    Master

    Add this indicator on your Daily price chart. It will plot weekly FIBO levels according to the number of weekly periods you selected:

    // Weekly Fibonacci Levels
    //
    DEFPARAM CalculateOnLastBars = 3000
    DEFPARAM DrawOnLastBarOnly   = True
    
    ONCE p   = 30
    Timeframe(Weekly)
    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
    //
    Timeframe(default)
    DRAWHLINE(HH) coloured(238,122,233,255)//(0,128,0,255)
    DRAWHLINE(LL) coloured(238,122,233,255)//(0,128,0,255)
    LastBar = BarIndex
    IF Up THEN
    DRAWTEXT("---------------------------(23.6%)",LastBar,HH - Fib0236,SansSerif,Bold,10)coloured(238,122,233,255)
    DRAWTEXT("---------------------------(38.2%)",LastBar,HH - Fib0382,SansSerif,Bold,10)coloured(238,122,233,255)
    DRAWTEXT("---------------------------(50.0%)",LastBar,HH - Fib0500,SansSerif,Bold,10)coloured(238,122,233,255)
    DRAWTEXT("---------------------------(61.8%)",LastBar,HH - Fib0618,SansSerif,Bold,10)coloured(238,122,233,255)
    DRAWTEXT("---------------------------(76.4%)",LastBar,HH - Fib0764,SansSerif,Bold,10)coloured(238,122,233,255)
    ELSIF Dn THEN
    DRAWTEXT("---------------------------(23.6%)",LastBar,LL + Fib0236,SansSerif,Bold,10)coloured(238,122,233,255)
    DRAWTEXT("---------------------------(38.2%)",LastBar,LL + Fib0382,SansSerif,Bold,10)coloured(238,122,233,255)
    DRAWTEXT("---------------------------(50.0%)",LastBar,LL + Fib0500,SansSerif,Bold,10)coloured(238,122,233,255)
    DRAWTEXT("---------------------------(61.8%)",LastBar,LL + Fib0618,SansSerif,Bold,10)coloured(238,122,233,255)
    DRAWTEXT("---------------------------(76.4%)",LastBar,LL + Fib0764,SansSerif,Bold,10)coloured(238,122,233,255)
    ENDIF
    RETURN
    x-1.jpg x-1.jpg
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Show weekly fibonnacis on daily graph


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
kaoklai @kaoklai Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
2 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/05/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...