Range Budget [AFD]
Range Budget answers one question at a glance: **how much of a
typical session's range has today already used?**
A day that has spent 40% of its typical range and a day that has spent 130% are different trading environments. This indicator measures which one you are in, from this chart's own price history, and says so in one number, onecolour, and one word.
###What it does###
- **Headline percentage** — today's realized range so far, divided by thetypical completed-session range. Never clamped: a wide day reads 130%, not100%.
- **State word and meter** — ROOM → PAST HALF (50%) → NEAR FULL (80%) → OVER
TYPICAL (100%). The word, the meter and every state colour come from the same thresholds, so they cannot disagree.
- **Envelope levels** — session low + typical range, and session high − typicalrange, drawn as glowing lines with a gradient band between them. Aconditional identity, not a projection: IF the session finishes at itstypical size AND the low holds, the high lands exactly on the upper level. Once the day crosses its typical range, the levels take the state colour.
- **Percentile ladder** (optional) — where a finished day of each size (p25 /p50 / p75 / p90 of the lookback window) would top out, measured up fromtoday's low. Nearest-rank percentiles: every rung is a session range thatactually occurred, never an interpolation.
- **Dashboard** — distance left to (or past) typical in both price points andpercent, how many of the last N sessions ran wider than typical, and optional detail rows (range so far, typical range, percentile standing,widest/narrowest, envelope and ladder values). Compact by default; everycryptic cell explains itself on hover; the whole panel can be switched off.
###How it works###
- **Typical range is user-selectable**, and the chart always names the activestatistic:
- **ADR** — the average of the last N completed session ranges (high − low).
- **ATR RMA** — the average true range, so overnight gaps count. Seeded withthe first true range rather than an initial SMA, which is why it is labelled "ATR RMA" and will not match `ta.atr()` to the last digit. Under ATR the numerator is the live session's true range too, so the percentageis never a ratio of two different measures.
- **Median** — the middle completed session range, which is also theladder's p50 rung.
- The three are identical on a symbol that never gaps and diverge as gaps grow — on heavily gapping symbols ATR can run near 2.5× ADR. That is why the choice exists and why the active one is named on the chart.
- **Completed sessions only.** The live day never feeds its own denominator —a partial day would drag the typical range down as the day progressed and bias the percentage upward with no symptom. Statistics update when a session completes; the live day contributes only its running range.
- **One session rule for everything.** Regular hours or regular + extended:history and the live day follow the same rule, and if the filter cannot change anything on your chart (no extended-hours bars loaded), the dashboard says so instead of staying silent.
- **The sample is what your chart holds.** n is capped by the sessions actually loaded — roughly 64 completed regular-hours sessions on a 5-minute chart from 5,000 bars on a Basic plan, more on higher plans and higher timeframes. The dashboard shows the n actually in use, plus a spread figure ((p90 − p25) ÷ p50) that says whether recent sessions were similar in size
or mixed.
- Eleven plotted values sit in the Data Window (percentage, ranges, envelope percentiles, sample size and more), so every number on the panel can be read, checked and exported.
###How to use it###
1. Add it to a liquid intraday chart. The defaults are the intended reading: compact dashboard, ADR(20), regular hours.
2. Read the headline first. ROOM means the day is still small next to its recent finished sessions; OVER TYPICAL means it has already run further than a typical one.
3. Use the envelope as context for the day's remaining room under the stated conditions — the tooltip on every input spells those conditions out.
4. Turn on the ladder to see today against the whole recent distribution instead of one average: price between p50 and p75 means today has already matched a mid-sized finished day.
5. Hover the bottom row of the dashboard whenever a figure is unclear — the statistic, the sample and any active caveat (gap counted, filter inert, no completed session yet) are explained there.
###What it deliberately does not do###
**Realized range from OHLCV — not an implied or expected move.** Every number is measured from this chart's own price history. Nothing comes from options pricing, and the typical range describes completed sessions — a description of what happened, not a statement about what happens next.
- No alerts, no signals, no entries or exits.
- Counts stay counts — "Sessions over typical: 4 of last 20" describes this chart's history, and the indicator never converts a count into odds.
- The percentage is never capped at 100%, because a day past its typical range is the most informative reading the tool produces.
###Why it is original###
Range tools usually hand you one number (an ADR level pair) or one overlay (an ATR band). Range Budget treats the session range as a budget and reports its consumption: one percentage against a user-chosen, chart-named statistic, computed from completed sessions only, with its sample size, its spread and every degeneracy disclosed on the panel itself. The three statistics are not interchangeable and the tool is built around that fact rather than hiding it: the active one is named on the chart, the ATR path measures true range on both sides of the ratio, and the ladder shows the whole recent distribution so one average never has to stand in for it.
Open source under the Mozilla Public License 2.0. All calculations are native
Pine v6 — no security() calls, no external data. Indicator

Range Zones AlertsRange Zones — Buy the Green, Sell the Red
Get alerted when price enters a buy zone or a sell zone.
This indicator detects the current trading range, splits it into three color-coded zones, and sends you an alert the moment price touches the zone you care about. No guessing where support and resistance are — the indicator finds them for you.
Green Zone = Buy Zone
The bottom third of the range is shaded green. This is where price has historically found support. When price drops into the green, buyers tend to step in. Set up the Bull alert and get notified the instant price touches this zone — that's your signal to start looking for a long entry.
Red Zone = Sell Zone
The top third of the range is shaded pink/red. This is where price has historically hit resistance. When price pushes into the red, sellers tend to step in. Set up the Bear alert and get notified the instant price touches this zone — that's your signal to start looking for a short entry or to take profits on longs.
Blue Zone = No Trade Zone
The middle third is shaded blue. Price is stuck between support and resistance with no clear edge in either direction. When price is in the blue, wait.
Alerts
Three options in PulseWire's alert panel:
— Bull Alert: fires when price touches the green support zone.
— Bear Alert: fires when price touches the red resistance zone.
— Both: fires on either — one alert covers everything.
A built-in cooldown (default 20 bars) prevents spam. You get one alert per zone touch, then silence until the cooldown clears. Bull and bear cooldowns are independent — a green zone alert won't block a red zone alert.
How It Works
The indicator uses pivot-based swing detection to find the most recent significant high and low. The range between them is divided into three equal horizontal zones. The zones update automatically as new swing highs and lows form. A Max Range Age setting ensures stale, outdated ranges are dropped.
Settings
— Pivot Strength: how significant the swing points need to be. Default 20. Higher = wider ranges.
— Max Range Age: how old the range can be before it's dropped. Default 300 bars.
— Alert Cooldown: bars of silence after an alert fires. Default 20.
— Zone Colors: fully customizable.
Works on any ticker, any timeframe. Add it to your chart, set up your alerts, and let the zones tell you when it's time to trade. Indicator

Indicator

Recent Range DetectorOverview
The Recent Range Detector is a specialized indicator designed to identify when an asset is currently range-bound, providing traders with clear support and resistance levels for range trading strategies. Unlike traditional indicators that focus on trend detection, this tool specifically answers the question: "Is the price range-bound right now, and what are the exact trading levels?"
Key Features
✅ Smart Range Detection - Uses a multi-factor scoring system to identify legitimate ranges
✅ Dynamic Support/Resistance Levels - Automatically calculates and displays key trading levels
✅ Range Quality Scoring - Provides confidence levels (Strong/Moderate/Weak Range)
✅ Touch Validation - Counts actual price touches to confirm range reliability
✅ Breakout Detection - Alerts when price exits the established range
✅ Visual Clarity - Clean boxes, lines, and labels for easy interpretation
How It Works
The indicator analyses recent price action using three core metrics:
Touch Quality (40%) - How many times price has respected support/resistance levels
Containment Quality (40%) - What percentage of recent bars stayed within the range
Recent Respect (20%) - Whether the latest price action confirms the range
These combine into a Range Score (0-1) that determines range strength and reliability.
Settings & Parameters
Range Lookback Period (Default: 15)
Number of bars to analyse for range detection
Shorter periods = more responsive to recent ranges
Longer periods = more stable, fewer false signals
Range Tolerance (Default: 2.0%)
Tolerance for price touches around exact highs/lows
Lower values = stricter range requirements
Higher values = more flexible range detection
Minimum Touches (Default: 3)
Required number of support/resistance touches for valid range
Higher values = more confirmed ranges, fewer signals
Lower values = more sensitive, earlier detection
Visual Options
Show Range Box: Displays the range boundaries
Show Support/Resistance Lines: Extends levels into the future
Understanding the Output
Range Score (0.000 - 1.000)
0.7+ = Strong Range (Green) - High confidence range trading setup
0.5-0.7 = Moderate Range (Yellow) - Decent range with some caution
0.3-0.5 = Weak Range (Orange) - Low confidence, be careful
<0.3 = Not Ranging - Avoid range trading strategies
Range Status Classifications
Strong Range - Perfect for range trading strategies
Moderate Range - Good range with normal risk
Weak Range - Marginal range, use smaller positions
Not Ranging - Price is trending or too choppy for range trading
Key Metrics in Info Table
Range Size (%) - Size of the range relative to price level
5-15% = Ideal range size for most strategies
<5% = Tight range, lower profit potential
>15% = Wide range, higher profit potential but more risk
Support/Resistance Levels - Exact price levels for entries/exits
Use these as your key trading levels
Support = potential buy zone
Resistance = potential sell zone
Total Touches - Number of times price respected the levels
3-5 touches = Newly formed range
6-10 touches = Well-established range
10+ touches = Very strong, reliable range
Price Position (%) - Current location within the range
0-20% = Near support (potential long opportunity)
80-100% = Near resistance (potential short opportunity)
40-60% = Middle of range (wait for better entry)
Visual Elements
Range Box
Green Box = Strong Range (Score ≥ 0.7)
Yellow Box = Moderate Range (Score 0.5-0.7)
Orange Box = Weak Range (Score 0.3-0.5)
Support/Resistance Lines
- Horizontal lines showing exact trading levels
- Extend into the future for forward guidance
- Colour matches the range strength
Background Colouring
- Subtle background tint during range periods
- Helps quickly identify ranging vs trending markets
Breakout Signals
- 📈 RANGE BREAK UP - Price breaks above resistance
- 📉 RANGE BREAK DOWN - Price breaks below support
- Only appears for confirmed ranges (Score ≥ 0.5)
Trading Applications
Range Trading Strategy
1. Look for Range Score ≥ 0.5
2. Buy near support (Price Position 0-20%)
3. Sell near resistance (Price Position 80-100%)
4. Set stops just outside the range
5. Exit on breakout signals
Breakout Strategy
1. Identify strong ranges (Score ≥ 0.7)
2. Wait for volume-confirmed breakout
3. Enter in breakout direction
4. Use previous resistance as support (or vice versa)
Market Context
- Strong ranges often occur after trending moves
- Use higher timeframes to confirm overall market structure
- Combine with volume analysis for better entries/exits
Best Practices
What to Look For
✅ Range Score ≥ 0.5 for trading consideration
✅ Multiple touches (5+) for confirmation
✅ Clear price rejection at levels
✅ Reasonable range size (5-15% for most assets)
✅ Recent price respect of boundaries
What to Avoid
❌ Trading ranges with Score < 0.3
❌ Very tight ranges (<3% size) - low profit potential
❌ Ranges with only 1-2 touches - not confirmed
❌ Ignoring breakout signals
❌ Trading against the higher timeframe trend
Alerts Available
- Range Detected - New range formation
- Range Break Up - Upward breakout
- Range Break Down - Downward breakout
- Range Ended - Range condition ended
Timeframe Recommendations
- Daily Charts - Best for swing trading ranges
- 4H Charts - Good for intermediate-term ranges
- 1H Charts - Suitable for day trading ranges
- Lower Timeframes - May produce more noise
Conclusion
The Recent Range Detector eliminates guesswork in range identification by providing objective, quantified range analysis. It's particularly valuable for traders who prefer range-bound strategies or need to identify when trending strategies should be avoided.
Remember: No indicator is perfect. Always combine with proper risk management, volume analysis, and broader market context for best results.
Disclaimer
This indicator is for educational purposes only and should not be considered as financial advice. Trading involves risk, and past performance does not guarantee future results. Always conduct your own research and consider your risk tolerance before making any trading decisions. Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

Fractal BreakoutFirst of all, huge credit to synapticEx , whose brilliant use of the security function inspired me to figure out a way to get quasi-shape boundaries automatically drawn on a chart.
This study draws upper and lower trend lines, based on configurable fractal*** reversal detection, calculates slope from the last two upper or lower reversal points, and then extends a dotted line along the same slope...until the next upper (or lower) reversal occurs. If the high (or low) breaks this extension, the dotted line becomes solid to aid visibility. Reversal detection is configurable to use any number of ticks, but probably four to eight will work best.
I made the inclusion of volume in the reversal logic optional (off by default) and left the existing SMA input found in synapticEx's code intact, albeit with a lower default. With the addition of trend lines, I found volume hindered identification of reversals, although I could try various other filters than the SMA included originally.
I have also left intact the very nice ability to change the period and use the requested period identify reversals, courtesy of synapticEx.
This could be used in a strategy, as the values plotted are actual values that are available to include in logic and do not include knowledge of the future. However , information is not available until the floor of half the number of ticks used in reversal detection (I then offset by that number to line things up visually). Having never heard of it until now, I just Googled the Bill Williams Alligator strategy, which looks interesting, so maybe I could see how this could be ported to that.
***As I typed this, I remembered that while making reversal detection configurable, I changed the detection logic simply to look for highest (or lowest) of the desired length of ticks. I don't know whether this is not strictly fractal anymore, but if desired, with a little work, I could make it require consecutive, consistent changes before and after each reversal again.
Here are a few screenshots from hourly ticks, using the "current" (hourly) period, with and without volume, and playing with the number of points used to identify reversals.
Not using volume
Using volume
Indicator

Indicator
