Buenas tardes, tengo dos screener que los suelo usar habitualmente, pero el tener que seleccionar uno u otro es algo que creo no resulta sacar el máximo rendimiento de estos, por eso me gustaría tener un screener con ambos unidos, de manera que me avise cuando ya sea uno u otro me den el aviso, los screeners en cuestión son los siguientes:
DOBLE TECHO DOBLE SUELO:
//———————————————————-//
//PRC_Double Top and Bottom
//version = 0
//16.07.2024
//Iván González @ http://www.prorealcode.com
//Sharing ProRealTime knowledge
//———————————————————-//
//—-inputs
prd = 5
tol =15
showPivot=1
Show2Bot=1
Show2Top=1
ShowShort=1
ShowLong=1
//src1 = low
//src2 = high
//———————————————————-//
//—-Pivots High&Low————————————-//
ph = high=highest[prd](high)
pl = low=lowest[prd](low)
//———————————————————-//
//—-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]
Box = 0
//———————————————————-//
//—-Calculate Arrays for each pivot———————-//
if ph or pl then
if dirchanged then
if dir=1 then
$zigzag[t+1]=highest[prd](high)
$zigzagidx[t+1]=barindex
$dir[t+1]=1
t=t+1
elsif dir=-1 then
$zigzag[t+1]=lowest[prd](low)
$zigzagidx[t+1]=barindex
$dir[t+1]=-1
t=t+1
endif
else
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
//———————————————————-//
if t>4 then
//—-Double Top pattern—————————-//
htop=($zigzag[t-3]+$zigzag[t-1])/2-$zigzag[t-2]
TopHigh=$zigzag[t-3]+htop*tol/100
BotHigh=$zigzag[t-3]-htop*tol/100
DoubleTop=($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] then
checkTop=1
short=0
//x1=$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 then
//drawrectangle(x2,y2,x4,y4)coloured("red")fillcolor("red",50)
Box = 2
endif
endif
if checkTop and ShowShort then
if not short and close crosses under y3 then
short=1
tpsh=(y3-dist)
slsh=max(y2,y4)
//drawarrowdown(barindex,high)coloured("blue")
//drawsegment(x3,y3,barindex,y3)coloured("blue")
endif
if short and low crosses under tpsh then
short=0
checkTop=0
//Drawsegment(x3,tpsh,barindex,tpsh)coloured("blue")style(dottedline)
//drawarrowup(barindex,low)coloured("orange")
endif
if short and close crosses over slsh then
checkTop=0
short=0
//Drawsegment(x4,slsh,barindex,slsh)coloured("blue")style(dottedline)
//drawarrowup(barindex,low)coloured("orange")
endif
endif
//—-Double Bottom pattern————————//
hbot=$zigzag[t-2]-($zigzag[t-3]+$zigzag[t-1])/2
topLow=$zigzag[t-3]+hbot*tol/100
botLow=$zigzag[t-3]-hbot*tol/100
DoubleBot=($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] then
checkBot=1
//xx1=$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 then
//drawrectangle(xx2,yy2,xx4,yy4)coloured("green")fillcolor("green",50)
Box = 1
endif
endif
if checkbot and ShowLong then
if not long and close crosses over yy3 then
long=1
tp=yy3+dist1
sl=min(yy2,yy4)
//drawarrowup(barindex,low)coloured("green")
//drawsegment(xx3,yy3,barindex,yy3)coloured("blue")
endif
if long and high crosses over tp then
long=0
checkBot=0
//Drawsegment(xx3,tp,barindex,tp)coloured("blue")style(dottedline)
//drawarrowdown(barindex,high)coloured("red")
endif
if long and close crosses under sl then
checkBot=0
long=0
//Drawsegment(xx4,sl,barindex,sl)coloured("blue")style(dottedline)
//drawarrowdown(barindex,high)coloured("red")
endif
endif
endif
//—-Draw Pivots——————————————//
if islastbarupdate and showPivot then
for i=t downto 4 do
//drawpoint($zigzagidx[i],$zigzag[i],2)coloured("blue",100)
next
endif
//———————————————————-//
SCREENER[Box AND (high <> low)](Box AS "1=ALCISTA,2=BAJISTA")
ELLIOTT WAVE IMPULSE:
// PRC_Elliott Wave Impulse Screener
// Basado en PRC_Elliott Wave - Impulse v2
// Adaptado a screener por Iván González @ prorealcode.com
// 17.03.2026
// — Inputs —
zigzagLength = 15
errorPercent = 5
entryPercent = 0
// — Constants —
errMin = (100 - errorPercent) / 100
errMax = (100 + errorPercent) / 100
entryRatio = entryPercent / 100
// ==============================================
// DETECCION DE PIVOTS (HighestBars/LowestBars)
// ==============================================
waveFound = 0
IF barindex >= zigzagLength THEN
hb = highestbars[zigzagLength](high)
lb = lowestbars[zigzagLength](low)
IF hb = 0 AND lb <> 0 THEN
phigh = high
plow = undefined
dir = 1
ELSIF lb = 0 AND hb <> 0 THEN
phigh = undefined
plow = low
dir = -1
ELSIF hb = 0 AND lb = 0 THEN
phigh = high
plow = low
dir = prevDir
ELSE
phigh = undefined
plow = undefined
dir = prevDir
ENDIF
// Hay pivot?
hasPivot = 0
IF phigh <> undefined OR plow <> undefined THEN
hasPivot = 1
ENDIF
IF hasPivot THEN
IF dir = 1 THEN
newVal = high
ELSE
newVal = low
ENDIF
newPDir = dir
// Cambio de direccion?
dirChanged = 0
IF dir <> prevDir AND prevDir <> 0 THEN
dirChanged = 1
ENDIF
// — MISMA DIRECCION: reemplazar pvt0 si el nuevo es mas extremo —
IF dirChanged = 0 AND pCount >= 1 THEN
IF dir = 1 THEN
IF newVal < pvt0 THEN
newVal = pvt0
ENDIF
ELSE
IF newVal > pvt0 THEN
newVal = pvt0
ENDIF
ENDIF
// Superseding
IF pCount >= 3 THEN
IF dir = 1 AND newVal > pvt2 THEN
newPDir = 2
ELSIF dir = -1 AND newVal < pvt2 THEN
newPDir = -2
ENDIF
ENDIF
// Reemplazar pvt0 sin shift
pvt0 = newVal
pd0 = newPDir
ELSE
// — CAMBIO DE DIRECCION: shift FIFO e insertar —
IF pCount >= 2 THEN
IF dir = 1 AND newVal > pvt1 THEN
newPDir = 2
ELSIF dir = -1 AND newVal < pvt1 THEN
newPDir = -2
ENDIF
ENDIF
// Shift: 2->3, 1->2, 0->1
pvt3 = pvt2
pvt2 = pvt1
pd2 = pd1
pvt1 = pvt0
pd1 = pd0
// Insertar nuevo en posicion 0
pvt0 = newVal
pd0 = newPDir
IF pCount < 6 THEN
pCount = pCount + 1
ENDIF
ENDIF
prevDir = dir
ENDIF
// ==============================================
// DETECCION DE ONDA IMPULSO
// ==============================================
IF pCount >= 4 THEN
p2 = pvt1
p2dir = pd1
p1 = pvt2
p1dir = pd2
p0 = pvt3
w1Len = abs(p1 - p0)
w2Len = abs(p2 - p1)
IF w1Len > 0 THEN
ir2 = w2Len / w1Len
ELSE
ir2 = 0
ENDIF
// Evitar re-detectar mismo patron
ignore = 0
IF oldP0 = p0 AND oldP1 = p1 AND oldP2 = p2 THEN
ignore = 1
ENDIF
// Validar ratio Fibonacci con tolerancia
patternMatched = 0
IF ir2 > 0.50 * errMin AND ir2 < 0.50 * errMax THEN
patternMatched = 1
ENDIF
IF ir2 > 0.618 * errMin AND ir2 < 0.618 * errMax THEN
patternMatched = 1
ENDIF
IF ir2 > 0.764 * errMin AND ir2 < 0.764 * errMax THEN
patternMatched = 1
ENDIF
IF ir2 > 0.854 * errMin AND ir2 < 0.854 * errMax THEN
patternMatched = 1
ENDIF
// Validar direcciones: W1=supersede(+-2), W2=normal(+-1)
dirMatched = 0
IF (p1dir = 2 AND p2dir = -1) OR (p1dir = -2 AND p2dir = 1) THEN
dirMatched = 1
ENDIF
IF ignore = 0 AND patternMatched = 1 AND dirMatched = 1 THEN
IF p0 > p1 THEN
wdir = -1
ELSE
wdir = 1
ENDIF
wEntry = p2 + wdir * entryRatio * w2Len
wStop = p0
waveFound = 1
oldP0 = p0
oldP1 = p1
oldP2 = p2
ENDIF
ENDIF
ENDIF
// ==============================================
// SCREENER OUTPUT
// ==============================================
SCREENER[waveFound = 1](wdir AS "Dir 1=Bull", wEntry AS "Entry", wStop AS "Stop")