Doble techo, doble suelo
Forums › ProRealTime foro Español › Soporte ProScreener › Doble techo, doble suelo
- This topic has 0 replies, 1 voice, and was last updated 10 hours ago by
NicoGB67.
Viewing 1 post (of 1 total)
-
-
12/13/2025 at 9:39 PM #254531
Hola, me gustaría obtener un screener del indicador que detecta doble suelo o techo, en concreto me gustaría que me avisara cuando se forme el rectángulo verde o rojo del doble suelo o doble suelo, aquí dejo el código del indicador que hizo Iván hace un año, gracias de antemano:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163//———————————————————-////PRC_Double Top and Bottom//version = 0//16.07.2024//Iván González @ http://www.prorealcode.com//Sharing ProRealTime knowledge//———————————————————-////—–inputsprd = 5tol = 15showPivot=1Show2Bot=1Show2Top=1ShowShort=1ShowLong=1src1 = lowsrc2 = high//———————————————————-////—–Pivots High&Low————————————–//ph = high=highest[prd](high)pl = low=lowest[prd](low)//———————————————————-////—–Direction Calculation——————————–//if ph and pl=0 thendir=1elsif pl and ph=0 thendir=–1elsedir=direndifdirchanged=dir<>dir[1]//———————————————————-////—–Calculate Arrays for each pivot———————-//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//———————————————————-//if t>4 then//—–Double Top pattern—————————-//htop=($zigzag[t–3]+$zigzag[t–1])/2–$zigzag[t–2]TopHigh=$zigzag[t–3]+htop*tol/100BotHigh=$zigzag[t–3]–htop*tol/100DoubleTop=($zigzag[t–1]>=BotHigh and $zigzag[t–1]<=TopHigh) and ($zigzag[t–3]>y1 and $zigzag[t–3]>$zigzag[t–2] and $zigzag[t–1]>$zigzag[t–2])if DoubleTop and not DoubleTop[1] thencheckTop=1short=0x1=$zigzagidx[t–4]y1=$zigzag[t–4]x2=$zigzagidx[t–3]y2=$zigzag[t–3]x3=$zigzagidx[t–2]y3=$zigzag[t–2]x4=$zigzagidx[t–1]y4=$zigzag[t–1]x5=$zigzagidx[t]y5=$zigzag[t]dist=abs(y3–min(y2,y4))if Show2Top thendrawrectangle(x2,y2,x4,y4)coloured(“red”)fillcolor(“red”,50)endifendifif checkTop and ShowShort thenif not short and close crosses under y3 thenshort=1tpsh=(y3–dist)slsh=max(y2,y4)drawarrowdown(barindex,high)coloured(“blue”)drawsegment(x3,y3,barindex,y3)coloured(“blue”)endifif short and low crosses under tpsh thenshort=0checkTop=0Drawsegment(x3,tpsh,barindex,tpsh)coloured(“blue”)style(dottedline)drawarrowup(barindex,low)coloured(“orange”)endifif short and close crosses over slsh thencheckTop=0short=0Drawsegment(x4,slsh,barindex,slsh)coloured(“blue”)style(dottedline)drawarrowup(barindex,low)coloured(“orange”)endifendif//—–Double Bottom pattern————————//hbot=$zigzag[t–2]–($zigzag[t–3]+$zigzag[t–1])/2topLow=$zigzag[t–3]+hbot*tol/100botLow=$zigzag[t–3]–hbot*tol/100DoubleBot=($zigzag[t–1]>=botLow and $zigzag[t–1]<=toplow) and ($zigzag[t–3]<$zigzag[t–4] and $zigzag[t–3]<$zigzag[t–2] and $zigzag[t–1]<$zigzag[t–2])if DoubleBot and not DoubleBot[1] thencheckBot=1xx1=$zigzagidx[t–4]yy1=$zigzag[t–4]xx2=$zigzagidx[t–3]yy2=$zigzag[t–3]xx3=$zigzagidx[t–2]yy3=$zigzag[t–2]xx4=$zigzagidx[t–1]yy4=$zigzag[t–1]xx5=$zigzagidx[t]yy5=$zigzag[t]dist1=abs(yy3–min(yy2,yy4))if Show2Bot thendrawrectangle(xx2,yy2,xx4,yy4)coloured(“green”)fillcolor(“green”,50)endifendifif checkbot and ShowLong thenif not long and close crosses over yy3 thenlong=1tp=yy3+dist1sl=min(yy2,yy4)drawarrowup(barindex,low)coloured(“green”)drawsegment(xx3,yy3,barindex,yy3)coloured(“blue”)endifif long and high crosses over tp thenlong=0checkBot=0Drawsegment(xx3,tp,barindex,tp)coloured(“blue”)style(dottedline)drawarrowdown(barindex,high)coloured(“red”)endifif long and close crosses under sl thencheckBot=0long=0Drawsegment(xx4,sl,barindex,sl)coloured(“blue”)style(dottedline)drawarrowdown(barindex,high)coloured(“red”)endifendifendif//—–Draw Pivots——————————————//if islastbarupdate and showPivot thenfor i=t downto 4 dodrawpoint($zigzagidx[i],$zigzag[i],2)coloured(“blue”,100)nextendif//———————————————————-//return -
AuthorPosts
Viewing 1 post (of 1 total)
