Buenas:
Se podría hacer Screener con las roturas correspondientes a marcos temporales bajos por ejemplo 15 o 30 minutos, de este indicador:
.https://www.prorealcode.com/topic/conversion-lineas-de-tendencia-y-rupturas-de-pivote-hg/
Gracias,
//--------------------------------------------------//
//PRC_Pivot Trendlines with Breaks [HG]
//version = 0
//14.01.2026
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//--------------------------------------------------//
// --- Inputs ---
//--------------------------------------------------//
pivotLen = 20
pivotType = 1 //(1 for Wicks, 0 for Body)
maxLines = 20 //(Limits how many historical lines are drawn to keep chart clean)
showOldBrokenLines = 1 //(Boolean: 1 to see history, 0 for clean chart)
//--------------------------------------------------//
// --- Initialization ---
//--------------------------------------------------//
leftBars = pivotLen
rightBars = MAX(1, ROUND(pivotLen / 2))
IF pivotType = 1 THEN
srcLo = low
srcHi = high
ELSE
srcLo = MIN(open, close)
srcHi = MAX(open, close)
ENDIF
//--------------------------------------------------//
// --- Pivot Detection and Array Storage ---
//--------------------------------------------------//
IF srcLo > srcLo[rightBars] AND LOWEST[rightBars](srcLo) > srcLo[rightBars] AND srcLo[rightBars] < LOWEST[leftBars](srcLo)[rightBars + 1] THEN
$PLy[z] = srcLo[rightBars]
$PLx[z] = barindex[rightBars]
IF z > 0 THEN
IF $PLy[z] > $PLy[z-1] THEN
$slopeL[z] = ($PLy[z] - $PLy[z-1]) / ($PLx[z] - $PLx[z-1])
ELSE
$slopeL[z] = 0
ENDIF
ENDIF
z = z + 1
ENDIF
IF srcHi < srcHi[rightBars] AND HIGHEST[rightBars](srcHi) < srcHi[rightBars] AND srcHi[rightBars] > HIGHEST[leftBars](srcHi)[rightBars + 1] THEN
$PHy[t] = srcHi[rightBars]
$PHx[t] = barindex[rightBars]
IF t > 0 THEN
IF $PHy[t] < $PHy[t-1] THEN
$slopeH[t] = ($PHy[t] - $PHy[t-1]) / ($PHx[t] - $PHx[t-1])
ELSE
$slopeH[t] = 0
ENDIF
ENDIF
t = t + 1
ENDIF
//--------------------------------------------------//
// --- Drawing Logic on Last Bar ---
//--------------------------------------------------//
IF ISLASTBARUPDATE THEN
// Limit the loop to the last N lines to match TradingView's cleanliness
startLoopH = MAX(1, t - maxLines)
startLoopL = MAX(1, z - maxLines)
// Resistance Lines (Bearish)
IF t > 2 THEN
FOR i = t - 1 DOWNTO startLoopH DO
IF $slopeH[i] <> 0 THEN
x1 = $PHx[i-1]
y1 = $PHy[i-1]
m = $slopeH[i]
breakX = 0
breakY = 0
FOR j = $PHx[i] + 1 TO barindex DO
valLine = y1 + (j - x1) * m
IF close[barindex - j] > valLine THEN
breakX = j
breakY = valLine
BREAK
ENDIF
NEXT
IF breakX = 0 THEN
// Active line
yEnd = y1 + (barindex - x1) * m
DRAWSEGMENT(x1, y1, barindex, yEnd) STYLE(dottedline, 2) COLOURED(255, 0, 0)
ELSE
// Broken line: only draw if the user wants to see history
IF showOldBrokenLines THEN
DRAWSEGMENT(x1, y1, breakX, breakY) COLOURED(150, 0, 0, 150) // More transparent
DRAWTEXT("Br", breakX, breakY + range, Dialog, Bold, 10) COLOURED(255, 0, 0)
ENDIF
ENDIF
ENDIF
NEXT
ENDIF
// Support Lines (Bullish)
IF z > 2 THEN
FOR i = z - 1 DOWNTO startLoopL DO
IF $slopeL[i] <> 0 THEN
x1 = $PLx[i-1]
y1 = $PLy[i-1]
m = $slopeL[i]
breakX = 0
breakY = 0
FOR j = $PLx[i] + 1 TO barindex DO
valLine = y1 + (j - x1) * m
IF close[barindex - j] < valLine THEN
breakX = j
breakY = valLine
BREAK
ENDIF
NEXT
IF breakX = 0 THEN
// Active line
yEnd = y1 + (barindex - x1) * m
DRAWSEGMENT(x1, y1, barindex, yEnd) STYLE(dottedline, 2) COLOURED(0, 255, 0)
ELSE
// Broken line
IF showOldBrokenLines THEN
DRAWSEGMENT(x1, y1, breakX, breakY) COLOURED(0, 150, 0, 150)
DRAWTEXT("Br", breakX, breakY - range, Dialog, Bold, 10) COLOURED(0, 200, 0)
ENDIF
ENDIF
ENDIF
NEXT
ENDIF
ENDIF
RETURN