Hola, me gustaría un screener del indicador “Kit de herramientas de acción de precios”, que me avisara cuando corta hacia arriba o hacia abajo la línea de tendencia, gracias.
Aquí está:
//----------------------------------------------
//PRC_Price Action Toolkit - Trend Line Break (screener)
//version = 1
//29.06.2026
//Ivan Gonzalez @ www.prorealcode.com
//Sharing ProRealTime knowledge
//----------------------------------------------
// Replica las trend lines del indicador "Price Action Toolkit" (UAlgo)
// y filtra los valores cuya ultima vela ROMPE una de ellas:
// - Resistencia bajista (2 pivots high, pendiente < 0) -> cruce al alza
// - Soporte alcista (2 pivots low, pendiente > 0) -> cruce a la baja
// Sin DEFPARAM (no permitido en screeners).
tlSens = 20
//--- Pivots high/low centrados y confirmados (mismo metodo que el indicador) ---
once tlBearEnd = -1
once tlBearEndVal = 0
once tlBearStart = -1
once tlBearStartVal = 0
once tlBullEnd = -1
once tlBullEndVal = 0
once tlBullStart = -1
once tlBullStartVal = 0
IF barindex >= 2*tlSens THEN
IF high[tlSens] = highest[2*tlSens+1](high) THEN
tlBearStart = tlBearEnd
tlBearStartVal = tlBearEndVal
tlBearEnd = barindex - tlSens
tlBearEndVal = high[tlSens]
ENDIF
IF low[tlSens] = lowest[2*tlSens+1](low) THEN
tlBullStart = tlBullEnd
tlBullStartVal = tlBullEndVal
tlBullEnd = barindex - tlSens
tlBullEndVal = low[tlSens]
ENDIF
ENDIF
//--- Resistencia bajista proyectada (vela actual y anterior) ---
bearValid = 0
tlBearNow = 0
tlBearPrev = 0
IF tlBearStart > 0 AND tlBearEnd > tlBearStart THEN
tlBearSlope = (tlBearEndVal - tlBearStartVal) / (tlBearEnd - tlBearStart)
IF tlBearSlope < 0 THEN
bearValid = 1
tlBearNow = tlBearEndVal + tlBearSlope * (barindex - tlBearEnd)
tlBearPrev = tlBearEndVal + tlBearSlope * (barindex - 1 - tlBearEnd)
ENDIF
ENDIF
//--- Soporte alcista proyectado (vela actual y anterior) ---
bullValid = 0
tlBullNow = 0
tlBullPrev = 0
IF tlBullStart > 0 AND tlBullEnd > tlBullStart THEN
tlBullSlope = (tlBullEndVal - tlBullStartVal) / (tlBullEnd - tlBullStart)
IF tlBullSlope > 0 THEN
bullValid = 1
tlBullNow = tlBullEndVal + tlBullSlope * (barindex - tlBullEnd)
tlBullPrev = tlBullEndVal + tlBullSlope * (barindex - 1 - tlBullEnd)
ENDIF
ENDIF
//--- Cruces sobre la prolongacion de cada linea ---
crossUp = bearValid AND close > tlBearNow AND close[1] <= tlBearPrev
crossDown = bullValid AND close < tlBullNow AND close[1] >= tlBullPrev
//--- Direccion (1 = ruptura alcista, -1 = ruptura bajista) y nivel roto ---
signal = 0
lvl = 0
IF crossUp THEN
signal = 1
lvl = tlBearNow
ELSIF crossDown THEN
signal = -1
lvl = tlBullNow
ENDIF
SCREENER[signal <> 0](signal AS "Direccion", lvl AS "Nivel TL")