Buenos días, ya que no se pudo hacer el último screener que propuse la semana pasada, me podrían modificar un poco este que me hizo Iván, es qué resulta que de los dos uno me avisa continuamente sin ser señales importantes, a ver si se puede hacer que el Supply Demand solo avise cuando el precio toca con posterioridad y no cuando aparece la primera vez:
// Screener combinado: zonas de alerta
// Dispara cuando Supply-Demand-CVD-Flow o Wick Pressure Zones
// forman una zona nueva en el momento actual
// === 1. Supply-Demand-CVD-Flow (ChartPrime) ===
atrLen = 14
momMult = 1.0
myATR = averagetruerange[atrLen](close)
brkBody = abs(close[1] - open[1])
isDemand = 0
isSupply = 0
if barindex > 2 then
if (close[2] < open[2]) and (close[1] > open[1]) and brkBody >= momMult * myATR[1] then
isDemand = 1
endif
if (close[2] > open[2]) and (close[1] < open[1]) and brkBody >= momMult * myATR[1] then
isSupply = 1
endif
endif
// === 2. Wick Pressure Zones (BigBeluga) ===
lookback = 200
threshold = 80
extendBars = 20
rsiLen = 14
bodyTop = max(open, close)
bodyBot = min(open, close)
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)
once startidx = -100000
newUpper = 0
newLower = 0
if sizeUpWick >= threshold and sizeLoWick < threshold and myrsi > 50 and (barindex - startidx > extendBars) then
newUpper = 1
startidx = barindex
endif
if sizeLoWick >= threshold and sizeUpWick < threshold and myrsi < 50 and (barindex - startidx > extendBars) then
newLower = 1
startidx = barindex
endif
// === 3. Condicion combinada ===
zoneFormed = isDemand or isSupply or newUpper or newLower
// === 4. Tipo de zona detectada ===
sType = 0
if isDemand then
sType = 1
endif
if isSupply then
sType = -1
endif
if newLower then
sType = 2
endif
if newUpper then
sType = -2
endif
SCREENER[zoneFormed] (sType as "Zone Type")
Si se puede, que el Wick pressure, también avise cuando el precio vuelva a tocar la zona, pero que me siga avisando cuando se forma la zona por primera vez porque para mí es lo más importante