Retracements de Fibonacci

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #248050 quote
    RICOU
    Participant
    New

    Bonjour,

    existe t-il un code qui puisse tracer les retracements de fibonacci automatiquement sur un graphique ?

    Par avance merci,

    #248054 quote
    ARLEQUIN49
    Participant
    Veteran

    oui il y en a au moins 3 qui existent en Zigzag & Fibonacci Levels: Indicator for Detecting Key Market Levels, ou ZigZag Fibonacci levels ou Fibonacci 61.8% retracement

    #248060 quote
    RICOU
    Participant
    New

    merci, pourrais tu m,indiquer ou les trouver  stp.

    #248065 quote
    ARLEQUIN49
    Participant
    Veteran

    Il faut aller dans la recherche des mots clés en tapant fibonacci comme sur l’image jointe et tu auras tous les sujets concernant ta recherche.

    #248067 quote
    RICOU
    Participant
    New

    Ok merci

    #248079 quote
    RICOU
    Participant
    New

    En fait j’ai bien regardé mais ce n’est exactement ce que je recherche.

    En effet, les codes proposés affichent des retracements basés sur un certain nombre de périodes mais ce que je recherche c’est un code qui prend en compte vraiment les derniers plus hauts et plus bas.

    Merci

    #248080 quote
    ARLEQUIN49
    Participant
    Veteran

    sinon il y a FIBO AUTO RETRAC DID dont  voici le code:

    ajouter les variables  p=14

    // FIBO AUTO RETRAC DID 01 juillet 2018
    // d ‘ après Fibonacci auto channels PRC

    //parameters
    // period = 14

    DefParam DrawOnLastBarOnly = true

    ll = lowest[period](low)
    hh = highest[period](high)
    //mid = (ll+hh)/2

    fibo0 = (hh-ll)*1+ll
    fibo1 = (hh-ll)*0.786+ll
    fibo2 = (hh-ll)*0.618+ll
    fibo3 = (hh-ll)*0.382+ll
    fibo4 = (hh-ll)*0.500+ll
    fibo5 = (hh-ll)*0.236+ll
    fibo6 = (hh-ll)*0+ll

    a=255

    DRAWHLINE(fibo0) COLOURED(255,9,0,a)
    DRAWHLINE(fibo1) COLOURED(255,9,0,a)
    DRAWHLINE(fibo2) COLOURED(255,9,0,a)
    DRAWHLINE(fibo3) COLOURED(0,128,0,a)
    DRAWHLINE(fibo4) COLOURED(30,144,255,a)
    DRAWHLINE(fibo5) COLOURED(0,128,0,a)
    DRAWHLINE(fibo6) COLOURED(0,255,0,a)

    RETURN fibo1 as “fibo1 “, fibo2 as ” fibo2 “, fibo3 as ” fibo3 “, fibo4 as ” fibo4 “, fibo5 as ” fibo5 ” , customclose as ” customclose ” //mid as “center”,

    #248086 quote
    Iván González
    Moderator
    Master

    Voyons si cela peut aider :

    //----------------------------------------------------------------------------//
    //PRC_ZigZag & Fibonacci levels
    //version = 0
    //26.06.24
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //----------------------------------------------------------------------------//
    //-----Inputs-----------------------------------------------------------------//
    ZZpercent=1 //Boolean//Method for pivot points calculation
    prd=15 //Periods for Donchian Channel and pivot calculation
    percent=5 //Percentage for zigzag calculation
    
    showpastFib=1 //Boolean//shows all zigzag and Fibo levels
    showDN=1 //Boolean//shows fibo levels in a Uptrend
    ShowUP=0 //Boolean//shows fibo levels in a Downtrend
    //----------------------------------------------------------------------------//
    atr=averagetruerange[14](close) //Only drawing porpouse
    //----------------------------------------------------------------------------//
    //-----Pivots High&Low--------------------------------------------------------//
    if ZZpercent then
    //-----Mode Percent--------------------------------------------------------//
    zz = zigzag[percent](close)
    ph = zz<zz[1] and zz[1]>zz[2]
    pl = zz>zz[1] and zz[1]<zz[2]
    //-----Mode Highest/lowest Values------------------------------------------//
    else
    ph = high=highest[prd](high)
    pl = low=lowest[prd](low)
    endif
    //----------------------------------------------------------------------------//
    //-----Direction Calculation--------------------------------------------------//
    if ph and pl=0 then
    dir=1
    elsif pl and ph=0 then
    dir=-1
    else
    dir=dir
    endif
    
    dirchanged=dir<>dir[1]
    //----------------------------------------------------------------------------//
    //-----Calculate Arrays for each pivot----------------------------------------//
    if ph or pl then
    if dirchanged then
    if dir=1 and not ZZpercent then
    $zigzag[t+1]=highest[prd](high)
    $zigzagidx[t+1]=barindex
    $dir[t+1]=1
    t=t+1
    elsif dir=-1 and not ZZpercent then
    $zigzag[t+1]=lowest[prd](low)
    $zigzagidx[t+1]=barindex
    $dir[t+1]=-1
    t=t+1
    elsif dir=1 and ZZpercent then
    $zigzag[t+1]=zz[1]
    $zigzagidx[t+1]=barindex[1]
    $dir[t+1]=1
    t=t+1
    elsif dir=-1 and ZZpercent then
    $zigzag[t+1]=zz[1]
    $zigzagidx[t+1]=barindex[1]
    $dir[t+1]=-1
    t=t+1
    endif
    else
    if not ZZpercent then
    if dir=1 and highest[prd](high)> $zigzag[t] then
    $zigzag[t]=highest[prd](high)
    $zigzagidx[t]=barindex
    elsif dir=-1 and lowest[prd](low)< $zigzag[t] then
    $zigzag[t]=lowest[prd](low)
    $zigzagidx[t]=barindex
    endif
    endif
    endif
    endif
    //----------------------------------------------------------------------------//
    //-----Drawing conditions-----------------------------------------------------//
    if islastbarupdate then
    //-----Last Zig and Fibonacci Levels---------------------------------------//
    drawsegment($zigzagidx[max(0,t-1)],$zigzag[max(0,t-1)],$zigzagidx[t],$zigzag[t])
    if $dir[t]=1 then
    //-----Calculation when trend Up----------------------------------------//
    fib0=$zigzag[max(0,t-1)]
    fib100=$zigzag[t]
    diff=fib100-fib0
    fib0236=fib100-diff*0.236
    fib0382=fib100-diff*0.382
    fib0500=fib100-diff*0.500
    fib0618=fib100-diff*0.618
    fib0786=fib100-diff*0.786
    drawsegment($zigzagidx[max(0,t-1)],fib0,barindex+10,fib0)style(line,2)coloured("grey")
    drawsegment($zigzagidx[max(0,t-1)],fib0236,barindex+10,fib0236)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[max(0,t-1)],fib0382,barindex+10,fib0382)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[max(0,t-1)],fib0500,barindex+10,fib0500)style(dottedline,2)coloured("blue")
    
    drawsegment($zigzagidx[max(0,t-1)],fib0618,barindex+10,fib0618)style(dottedline,2)coloured("red")
    drawsegment($zigzagidx[max(0,t-1)],fib0786,barindex+10,fib0786)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[max(0,t-1)],fib100,barindex+10,fib100)style(line,2)coloured("grey")
    drawtext("Fib 0%: #fib0#",barindex+10,fib100+0.05*atr)
    drawtext("Fib 50%: #fib0500#",barindex+10,fib0500+0.05*atr)
    drawtext("Fib 100%: #fib100#",barindex+10,fib0+0.05*atr)
    elsif $dir[t]=-1 then
    //-----Calculation when trend Down--------------------------------------//
    fib0=$zigzag[t]
    fib100=$zigzag[max(0,t-1)]
    diff=fib100-fib0
    fib0236=fib0+diff*0.236
    fib0382=fib0+diff*0.382
    fib0500=fib0+diff*0.500
    fib0618=fib0+diff*0.618
    fib0786=fib0+diff*0.786
    drawsegment($zigzagidx[max(0,t-1)],fib0,barindex+10,fib0)style(line,2)coloured("grey")
    drawsegment($zigzagidx[max(0,t-1)],fib0236,barindex+10,fib0236)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[max(0,t-1)],fib0382,barindex+10,fib0382)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[max(0,t-1)],fib0500,barindex+10,fib0500)style(dottedline,2)coloured("blue")
    drawsegment($zigzagidx[max(0,t-1)],fib0618,barindex+10,fib0618)style(dottedline,2)coloured("red")
    drawsegment($zigzagidx[max(0,t-1)],fib0786,barindex+10,fib0786)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[max(0,t-1)],fib100,barindex+10,fib100)style(line,2)coloured("grey")
    drawtext("Fib 0%: #fib0#",barindex+10,fib0+0.05*atr)
    drawtext("Fib 50%: #fib0500#",barindex+10,fib0500+0.05*atr)
    drawtext("Fib 100%: #fib100#",barindex+10,fib100+0.05*atr)
    endif
    //-----Draw all Fibonacci levels and ZigZag-----------------------------------------//
    if showpastFib then
    for i=t-1 downto 1 do
    //----------------------------------------------------------------------------//
    drawsegment($zigzagidx[max(0,i-1)],$zigzag[max(0,i-1)],$zigzagidx[i],$zigzag[i])
    //-----Show Fibonacci when trend Up-------------------------------------------//
    if $dir[i]=1  and showDN then
    fib0=$zigzag[i-1]
    fib100=$zigzag[i]
    diff=fib100-fib0
    fib0236=fib100-diff*0.236
    fib0382=fib100-diff*0.382
    fib0500=fib100-diff*0.500
    fib0618=fib100-diff*0.618
    fib0786=fib100-diff*0.786
    drawsegment($zigzagidx[i-1],fib0,$zigzagidx[i+1],fib0)style(line,2)coloured("grey")
    drawsegment($zigzagidx[i-1],fib0236,$zigzagidx[i+1],fib0236)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[i-1],fib0382,$zigzagidx[i+1],fib0382)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[i-1],fib0500,$zigzagidx[i+1],fib0500)style(dottedline,2)coloured("blue")
    drawsegment($zigzagidx[i-1],fib0618,$zigzagidx[i+1],fib0618)style(dottedline,2)coloured("red")
    drawsegment($zigzagidx[i-1],fib0786,$zigzagidx[i+1],fib0786)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[i-1],fib100,$zigzagidx[i+1],fib100)style(line,2)coloured("grey")
    drawtext("Fib 0%",$zigzagidx[i],fib100+0.05*atr)
    drawtext("Fib 50%",$zigzagidx[i],fib0500+0.05*atr)
    drawtext("Fib 100%",$zigzagidx[i],fib0+0.05*atr)
    //-----Show Fibonacci when trend Down-----------------------------------------//
    elsif $dir[i]=-1 and ShowUP then
    fib0=$zigzag[i]
    fib100=$zigzag[i-1]
    diff=fib100-fib0
    fib0236=fib0+diff*0.236
    fib0382=fib0+diff*0.382
    fib0500=fib0+diff*0.500
    fib0618=fib0+diff*0.618
    fib0786=fib0+diff*0.786
    drawsegment($zigzagidx[i-1],fib0,$zigzagidx[i+1],fib0)style(line,2)coloured("grey")
    drawsegment($zigzagidx[i-1],fib0236,$zigzagidx[i+1],fib0236)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[i-1],fib0382,$zigzagidx[i+1],fib0382)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[i-1],fib0500,$zigzagidx[i+1],fib0500)style(dottedline,2)coloured("blue")
    drawsegment($zigzagidx[i-1],fib0618,$zigzagidx[i+1],fib0618)style(dottedline,2)coloured("red")
    drawsegment($zigzagidx[i-1],fib0786,$zigzagidx[i+1],fib0786)style(dottedline,1)coloured("grey")
    drawsegment($zigzagidx[i-1],fib100,$zigzagidx[i+1],fib100)style(line,2)coloured("grey")
    drawtext("Fib 0%",$zigzagidx[i],fib0+0.05*atr)
    drawtext("Fib 50%",$zigzagidx[i],fib0500+0.05*atr)
    drawtext("Fib 100%",$zigzagidx[i],fib100+0.05*atr)
    endif
    next
    endif
    endif
    return

    vous avez le code itf ici :

    Zigzag & Fibonacci Levels: Indicator for Detecting Key Market Levels

    #248091 quote
    RICOU
    Participant
    New

    Bonjour Ivan,

    merci mais il y a une petite erreur dans le code lignes 22/23, si tu peut corriger.

    Muchas gracias

    #248094 quote
    Iván González
    Moderator
    Master
    #248096 quote
    RICOU
    Participant
    New

    Désolé Ivan mais le code ne fonctionne pas.

    #248106 quote
    Iván González
    Moderator
    Master

    Bonjour. Oui, ça marche. Veuillez m'indiquer le message d'erreur affiché à l'écran. N'oubliez pas que le lien que je vous ai envoyé contient le fichier .itf à télécharger.

    #248113 quote
    RICOU
    Participant
    New

    C’est bon Ivan, j’ai téléchargé le fichier itf et tout est Ok, merci

    #248117 quote
    RICOU
    Participant
    New

    Ivan,

    l’affichage est bizzare, les niveaux/lignes se cumulent après chaque bougies, de plus pourquoi il n’y a pas les niveau 61,8/78,6/38,2/23,6

    Merci pour tes réponses

    #248149 quote
    Iván González
    Moderator
    Master

    Bonjour. Je ne sais pas… sur quel actif et quel timeframe ? Quoi qu’il en soit, regardez, peut-être préférez-vous cet autre indicateur.

    //----------------------------------------//
    //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
    
Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.

Retracements de Fibonacci


Support ProBuilder

New Reply
Author
author-avatar
RICOU @ricou Participant
Summary

This topic contains 15 replies,
has 3 voices, and was last updated by RICOU
7 months, 3 weeks ago.

Topic Details
Forum: Support ProBuilder
Language: French
Started: 06/07/2025
Status: Active
Attachments: 3 files
Logo Logo
Loading...