PROTECTED SOURCE SCRIPT
Range Finder (PUBLIC)

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.
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.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
Crypto Scalp & intraweek trades t.co/Lu1b6sNtky
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
Crypto Scalp & intraweek trades t.co/Lu1b6sNtky
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.