ZigZag y SR
Forums › ProRealTime foro Español › Soporte ProScreener › ZigZag y SR
- This topic has 1 reply, 2 voices, and was last updated 2 months ago by
Iván.
Viewing 2 posts - 1 through 2 (of 2 total)
-
-
10/02/2025 at 3:47 PM #252108Hola, me gustaría que me hicieran un ProScreener del indicador ZigZag y Sr, que subió Iván hace un mes, lo llevo usando desde entoncces y me gusta mucho, es muy útil y para aprovecharlo al máximo me gustaría lo siguiente: He comprobado que en la vela del momento actual (con tiempo real lógicamente) según la sigla que esté en ese momento (HH,HL,LL,LH), puede variar en vivo según el movimiento del mercado que se este dando, pues si se pudiera avisar en el momento de dicho cambio me sería muy útil, gracias.Aquí la codificación del indicador://————————————////PRC_ZigZag and SR//version = 0//03.12.2024//Iván González @ http://www.prorealcode.com//Sharing ProRealTime knowledge//————————————//// Inputs//————————————//prd=15showSR=1 //Show Support and Resistance//Boolean// 0 means false 1 means TrueshowLabels=1 //Boolean// 0 means false 1 means TrueshowZZ=1 //Boolean// 0 means false 1 means Trueatr=averagetruerange[14](close)//————————————//// Calculate Pivot High and Low//————————————//ph = high=highest[prd](high)pl = low=lowest[prd](low)//————————————//// Calculate Direction//————————————//if ph and pl=0 thendir=1elsif pl and ph=0 thendir=–1elsedir=direndifdirchanged=dir<>dir[1]//————————————//// Calculate ZizZag levels and x//————————————//if ph or pl thenif dirchanged thenif dir=1 then$zigzag[t+1]=highest[prd](high)$zigzagidx[t+1]=barindex$dir[t+1]=1t=t+1elsif dir=–1 then$zigzag[t+1]=lowest[prd](low)$zigzagidx[t+1]=barindex$dir[t+1]=–1t=t+1endifelseif dir=1 and highest[prd](high)> $zigzag[t] then$zigzag[t]=highest[prd](high)$zigzagidx[t]=barindexelsif dir=–1 and lowest[prd](low)< $zigzag[t] then$zigzag[t]=lowest[prd](low)$zigzagidx[t]=barindexendifendifendif//————————————//// Draw ZigZag and Levels//————————————//$zigzag[0]=undefined$zigzagidx[0]=undefinedif islastbarupdate thenif showZZ then//Last ZigZagdrawsegment($zigzagidx[max(0,t–1)],$zigzag[max(0,t–1)],$zigzagidx[t],$zigzag[t])endifif showSR and $dir[t]=1 thendrawsegment($zigzagidx[t],$zigzag[t],barindex,$zigzag[t])style(dottedline,3)coloured(“green”)drawsegment($zigzagidx[max(0,t–1)],$zigzag[max(0,t–1)],barindex,$zigzag[max(0,t–1)])style(dottedline,3)coloured(“red”)if $zigzag[t]<$zigzag[t–2] thendrawtext(“HL”,$zigzagidx[t],$zigzag[t]+0.5*atr)coloured(“green”)elsedrawtext(“HH”,$zigzagidx[t],$zigzag[t]+0.5*atr)coloured(“green”)endifelsif showSR and $dir[t]=–1 thendrawsegment($zigzagidx[t],$zigzag[t],barindex,$zigzag[t])style(dottedline,3)coloured(“red”)drawsegment($zigzagidx[max(0,t–1)],$zigzag[max(0,t–1)],barindex,$zigzag[max(0,t–1)])style(dottedline,3)coloured(“green”)if $zigzag[t]<$zigzag[t–2] thendrawtext(“LL”,$zigzagidx[t],$zigzag[t]–0.5*atr)coloured(“red”)elsedrawtext(“LH”,$zigzagidx[t],$zigzag[t]–0.5*atr)coloured(“red”)endifendifif showLabels thendrawpoint($zigzagidx[max(0,t–1)],$zigzag[max(0,t–1)],2)coloured(“blue”,100)drawpoint($zigzagidx[t],$zigzag[t],2)coloured(“blue”,100)endif//Draw all ZigZagfor i=t–1 downto 3 doif showZZ thendrawsegment($zigzagidx[max(0,i–1)],$zigzag[max(0,i–1)],$zigzagidx[i],$zigzag[i])endifif showSR and $dir[i]=1 thendrawsegment($zigzagidx[i],$zigzag[i],$zigzagidx[i+1],$zigzag[i])style(dottedline,3)coloured(“green”)drawsegment($zigzagidx[max(0,i–1)],$zigzag[max(0,i–1)],$zigzagidx[i],$zigzag[max(0,i–1)])style(dottedline,3)coloured(“red”)elsif showSR and $dir[i]=–1 thendrawsegment($zigzagidx[i],$zigzag[i],$zigzagidx[i+1],$zigzag[i])style(dottedline,3)coloured(“red”)drawsegment($zigzagidx[max(0,i–1)],$zigzag[max(0,i–1)],$zigzagidx[i],$zigzag[max(0,i–1)])style(dottedline,3)coloured(“green”)endifif showLabels and $dir[i]=–1 and $zigzag[i]>$zigzag[i–2] thendrawtext(“LH”,$zigzagidx[i],$zigzag[i]–0.5*atr)coloured(“red”)elsif showLabels and $dir[i]=–1 and $zigzag[i]<=$zigzag[i–2] thendrawtext(“LL”,$zigzagidx[i],$zigzag[i]–0.5*atr)coloured(“red”)elsif showLabels and $dir[i]=1 and $zigzag[i]>$zigzag[i–2] thendrawtext(“HH”,$zigzagidx[i],$zigzag[i]+0.5*atr)coloured(“green”)elsif showLabels and $dir[i]=1 and $zigzag[i]<=$zigzag[i–2] thendrawtext(“HL”,$zigzagidx[i],$zigzag[i]+0.5*atr)coloured(“green”)endifnextendif//————————————//returnZ10/07/2025 at 2:19 PM #252260
Sería una cosa así.
Al pasar el screener detecta los cambios de dirección actual y además clasifica los pivotes por tipo:
type=12 // HL
type=11 // HH
type=22 // LL
type=21 // LH1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071//------------------------------------//// Inputs//------------------------------------//prd=18//atr=averagetruerange[14](close)//------------------------------------//// Calculate Pivot High and Low//------------------------------------//ph = high=highest[prd](high)pl = low=lowest[prd](low)//------------------------------------//// Calculate Direction//------------------------------------//if ph and pl=0 thendir=1elsif pl and ph=0 thendir=-1elsedir=direndifdirchanged=dir<>dir[1]//------------------------------------//// Calculate ZizZag levels and x//------------------------------------//if ph or pl thenif dirchanged thenif dir=1 then$zigzag[t+1]=highest[prd](high)$zigzagidx[t+1]=barindex$dir[t+1]=1t=t+1elsif dir=-1 then$zigzag[t+1]=lowest[prd](low)$zigzagidx[t+1]=barindex$dir[t+1]=-1t=t+1endifelseif dir=1 and highest[prd](high)> $zigzag[t] then$zigzag[t]=highest[prd](high)$zigzagidx[t]=barindexelsif dir=-1 and lowest[prd](low)< $zigzag[t] then$zigzag[t]=lowest[prd](low)$zigzagidx[t]=barindexendifendifendif//------------------------------------//// Draw ZigZag and Levels//------------------------------------//if islastbarupdate thenif $dir[t]=1 thenif $zigzag[t]<$zigzag[t-2] thentype=12 //HLelsetype=11 //HHendifelsif $dir[t]=-1 thenif $zigzag[t]<$zigzag[t-2] thentype=22 //LLelsetype=21 // LHendifendifendif//------------------------------------//screener[dirchanged](type as "Tipo")1 user thanked author for this post.
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
Find exclusive trading pro-tools on 
Similar topics: