PROTECTED SOURCE SCRIPT

Range Finder (PUBLIC)

48
Purpose: Draws a single “current range” (Upper, Lower, Median, 25%, 75%) based on the selected range timeframe: W / D1 / H4.

Range construction (initial):

Finds the latest significant pivot high (Upper) and pivot low (Lower) on the selected range TF (using configurable left/right pivot bars).

Calculates:

Median = (Upper + Lower) / 2

25% = Lower + 0.25 × (Upper−Lower)

75% = Lower + 0.75 × (Upper−Lower)

Draws horizontal lines from the range start to “now” (no infinite extension).

Range validity rule (no nested ranges):

Once a range is set, it does not change unless a strong break occurs.

“Strong break” is defined as a confirmed swing (not just closes):

Break-down: a confirmed swing low below the Lower threshold

Break-up: a confirmed swing high above the Upper threshold

Swing confirmation uses a window-extreme method (robust to equal highs/lows), controlled by Strong break swing left/right (default 3-candle swing = 1/1).

Optional buffer % can be applied to Upper/Lower to avoid tiny overshoots.

New range after a break:

After a break-down, it stores the break swing low as new Lower candidate, then waits for a confirmed swing high after that low that is still outside the old range to become the new Upper, then locks the new range.

After a break-up, it stores the break swing high as new Upper candidate, then waits for a confirmed swing low after that high still outside the old range to become the new Lower, then locks the new range.

If a new lower low (or higher high) forms while rebuilding, it updates the candidate and restarts the “wait for opposite swing” step.

High-probability zones (optional):

Only highlights 0–30% (Lower to 30%) and 70–100% (70% to Upper).

The fill appears only when current price is inside one of those zones.

Colors + opacity are user-configurable.

Dashboard (optional):

Shows selected range TF (W/D1/H4).

Shows D1 range size % and warns visually if D1 range exceeds a set threshold (default 14%).

In H4 mode, warning is suppressed (shows status only).

Position and text colors are configurable.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.