zigzag autre méthode de calcul

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #238988 quote
    Atemi19
    Participant
    New

    Bonjour, je voulais savoir s’il était possible d’avoir une autre prise de calcul du zig zag car il y a plusieurs méthodes de calcul mais je voudrais qu’il prennent en compte les plus et le plus bas car parfois certains ne sont pas pris en compte du fait que le calcul est différent donc il y a parfois des mouvements de 20 points en prenant en compte tout le mouvement sauf qu’avec les modes de calculs proposés ce mouvement est rejeté….

    cordialement.

    #238993 quote
    Iván González
    Moderator
    Master

    Vous pouvez utiliser ce code qui calcule le zigzag de deux manières :

    1) si zzpercent=1, il effectue le calcul comme d’habitude.

    2) si zzpercent=0 alors il le fait avec un canal de maximums et de minimums de X périodes.

    //----------------------------------------------------------------------------//
    //PRC_ZigZag
    //version = 0
    //26.06.24
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //----------------------------------------------------------------------------//
    //-----Inputs-----------------------------------------------------------------//
    ZZpercent=0
    prd=15
    percent=2
    
    //----------------------------------------------------------------------------//
    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])
    drawpoint($zigzagidx[max(0,t-1)],$zigzag[max(0,t-1)],2)coloured("blue",100)
    drawpoint($zigzagidx[t],$zigzag[t],2)coloured("blue",100)
    
    //-----Draw all Fibonacci levels and ZigZag-----------------------------------------//
    for i=t-1 downto 1 do
    //----------------------------------------------------------------------------//
    drawsegment($zigzagidx[max(0,i-1)],$zigzag[max(0,i-1)],$zigzagidx[i],$zigzag[i])
    drawpoint($zigzagidx[i],$zigzag[i],2)coloured("blue",100)
    next
    
    endif
    return
    
    #239011 quote
    Atemi19
    Participant
    New

    Merci beaucoup Ivan….

    #239026 quote
    Atemi19
    Participant
    New

    Coucou ivan je viens de le tester il fait le calcul sur période mais je parlais de points.

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

zigzag autre méthode de calcul


Support ProBuilder

New Reply
Author
author-avatar
Atemi19 @atemi19 Participant
Summary

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

Topic Details
Forum: Support ProBuilder
Language: French
Started: 10/14/2024
Status: Active
Attachments: No files
Logo Logo
Loading...