Buenas Iván, gran trabajo el que hiciste en el anterior screener, me gustaría que lo pudieras hacer mucho más efectivo y sería de la siguiente forma: añadiendo dos indicadores más de los que tengo y me gustan mucho, son el WICK PRESSURE ZONES y el DOUBLE TOP AND BOTTON. Y el screener sería que cuando hiciera un CHoCH tuviera en cuanta también si antes hubo un doble suelo o techo (según el caso), o hubiera una zona de mecha, además de mejorar algo del screener que hiciste el viernes y es que según me he fijado, antes del CHoCH a veces el precio corta la línea de tendencia y no después, por lo que al hacer el CHoCH, el screener también debiera de fijarse si se ha hecho un corte de dicha línea, gracias por todo tu trabajo. Te dejo a continuación los dos indicadores al que hago mención por si no supieras cuales son:
DOUBLE TOP AND BOTTON:
//----------------------------------------------------------//
//PRC_Double Top and Bottom
//version = 0
//16.07.2024
//Iván González @ 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]
//----------------------------------------------------------//
//-----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)
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)
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
//----------------------------------------------------------//
return
WICK PRESSURE ZONES:
//---------------------------------------------------
//PRC_Wick Pressure Zones by BigBeluga
//version = 0
//09.09.2025
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//---------------------------------------------------
DEFPARAM DrawOnLastBarOnly = true
//---------------------------------------------------
// inputs
//---------------------------------------------------
lookback = 200
threshold = 80
extendBars = 20
maxLevels = 10
rsiLen = 14
upR = 255
upG = 0
upB = 0
dnR = 0
dnG = 255
dnB = 0
//---------------------------------------------------
// Variables auxiliares
//---------------------------------------------------
bodyTop = MAX(open, close)
bodyBot = MIN(open, close)
// Mechas relativas (evitar división por 0)
denUp = MAX(bodyTop, 0.0000001)
denLo = MAX(low, 0.0000001)
upperWick = (high - bodyTop) / denUp
lowerWick = (bodyBot - low) / denLo
maxUpper = HIGHEST[lookback](upperWick)
maxLower = HIGHEST[lookback](lowerWick)
sizeUpWick = 0
sizeLoWick = 0
IF maxUpper > 0 THEN
sizeUpWick = FLOOR( (upperWick / maxUpper) * 100 )
ENDIF
IF maxLower > 0 THEN
sizeLoWick = FLOOR( (lowerWick / maxLower) * 100 )
ENDIF
//---------------------------------------------------
myrsi = RSI[rsiLen](close)
vol = volume
//---------------------------------------------------
// Separación mínima entre zonas
ONCE startidx = -100000
//---------------------------------------------------
// Boxes
//---------------------------------------------------
ONCE n = 0
newUpper = sizeUpWick >= threshold AND NOT (sizeLoWick >= threshold) AND myrsi > 50 AND (BarIndex - startidx > extendBars)
newLower = sizeLoWick >= threshold AND NOT (sizeUpWick >= threshold) AND myrsi < 50 AND (BarIndex - startidx > extendBars)
// Crear zona superior
IF newUpper THEN
startidx = BarIndex
n = n + 1
$side[n] = 1
$left[n] = BarIndex - 1
$top[n] = high
$bot[n] = bodyTop
$right[n] = barindex + 1
$broken[n] = 0
$volume[n] = volume
// Límite de zonas: mantener sólo las más recientes
IF n > maxLevels THEN
// Shift a la izquierda
FOR k = 1 TO n - 1 DO
$side[k] = $side[k+1]
$left[k] = $left[k+1]
$top[k] = $top[k+1]
$bot[k] = $bot[k+1]
$right[k] = $right[k+1]
$broken[k] = $broken[k+1]
$volume[k] = $volume[k+1]
NEXT
n = maxLevels
ENDIF
ENDIF
// Crear zona inferior
IF newLower THEN
startidx = BarIndex
n = n + 1
$side[n] = -1
$left[n] = BarIndex - 1
$top[n] = bodyBot
$bot[n] = low
$right[n] = barindex + 1
$broken[n] = 0
$volume[n] = volume
IF n > maxLevels THEN
FOR k = 1 TO n - 1 DO
$side[k] = $side[k+1]
$left[k] = $left[k+1]
$top[k] = $top[k+1]
$bot[k] = $bot[k+1]
$right[k] = $right[k+1]
$broken[k] = $broken[k+1]
$volume[k] = $volume[k+1]
NEXT
n = maxLevels
ENDIF
ENDIF
//---------------------------------------------------
// DIBUJO y GESTIÓN
//---------------------------------------------------
IF islastbarupdate THEN
FOR i = 1 TO n DO
for j=barindex-$right[i] downto 0 do
IF $side[i] = 1 AND low[j] > $top[i] THEN
$broken[i] = 1
$right[i] = barindex[j]
break
ELSIF $side[i] = -1 AND high[j] < $bot[i] THEN
$broken[i] = 1
$right[i] = barindex[j]
break
ENDIF
next
vol=$volume[i]
if $broken[i]=1 and $side[i]=1 then
drawrectangle($left[i],$bot[i],$left[i]+2,$top[i])coloured("red")
drawsegment($left[i],$top[i],$right[i],$top[i])coloured("grey",125)style(line,3)
ELSIF $broken[i]=0 AND $side[i]=1 THEN
leftX = $left[i]
rightX = barindex
topY = $top[i]
botY = $bot[i]
height = ABS(topY - botY)
IF height > 0 THEN
steps = 10
stepH = height / steps
DRAWRECTANGLE(leftX, topY, leftX + 2, botY) COLOURED(upR,upG,upB)
FOR s = 0 TO steps - 1 DO
segBot = botY + stepH * s
segTop = segBot + stepH
alphaVal = 30 + s * 12
IF s = steps - 1 THEN
alphaVal = 160
ENDIF
DRAWRECTANGLE(leftX, segTop, rightX, segBot) COLOURED(upR,upG,upB, 0)fillcolor(upR,upG,upB, alphaVal)
NEXT
midY = botY + height * 0.5
DRAWTEXT("#vol#", rightX, midY)
ENDIF
elsif $broken[i]=1 and $side[i]=-1 then
drawrectangle($left[i],$bot[i],$left[i]+2,$top[i])coloured("green")
drawsegment($left[i],$bot[i],$right[i],$bot[i])coloured("grey",125)style(line,3)
ELSIF $broken[i]=0 AND $side[i]=-1 THEN
leftX = $left[i]
rightX = barindex
topY = $top[i]
botY = $bot[i]
height = ABS(topY - botY)
IF height > 0 THEN
steps = 10
stepH = height / steps
DRAWRECTANGLE(leftX, topY, leftX + 2, botY) COLOURED(dnR,dnG,dnB)
FOR s = 0 TO steps - 1 DO
segBot = botY + stepH * s
segTop = segBot + stepH
alphaVal = 160 - s * 12
IF s = 0 THEN
alphaVal = 160
ENDIF
DRAWRECTANGLE(leftX, segTop, rightX, segBot) COLOURED(dnR,dnG,dnB, 0)fillcolor(dnR,dnG,dnB, alphaVal)
NEXT
midY = botY + height * 0.5
DRAWTEXT("#vol#", rightX, midY)
ENDIF
endif
NEXT
ENDIF
RETURN