Reversal Trap Probability Bands [BigBeluga]🔵 OVERVIEW
The Reversal Trap Probability Bands is an advanced technical indicator created by BigBeluga to identify and trade fakeout traps around market extremes. Traditional envelope or band indicators often fail because traders blindly enter breakouts that quickly reverse into whipsaw losses. In order to provide a solution to this problem, this indicator combines volatility-based envelope channels with a dynamic probability tracking engine, measuring historical RSI buckets to calculate real-time win probabilities for reversal traps.
The indicator aims to visualize institutional exhaustion and subsequent mean-reversion expansions. The core element of its calculation involves tracking baseline moving averages alongside outer volatility bounds defined as:
upper_band = basis + (multiplier * vola)
lower_band = basis - (multiplier * vola)
where basis is an exponential moving average of length envelope_len , and vola is the ATR volatility measure scaled by multiplier . Higher values of envelope_len and multiplier allow the indicator to filter out routine market noise and isolate major structural exhaustion points.
🔵 FEATURES
The system utilizes a multi-layered matrix structure to provide actionable market intelligence:
1 — Volatility Envelope & Basis Engine
envelope_len = input.int(55, "Envelope Smoothness") : Controls the responsiveness and smoothness of the central baseline.
upper_band & lower_band : Dynamic outer boundaries that shade gradient fills to visualize upper and lower market extremes.
2 — Reversal Trap Detection & RSI Probability Tracking
trap_window = input.int(10, "Trap Window (Candles)") : Defines the maximum candle count allowed outside the bands before invalidating a fakeout setup.
rsi_bucket = math.max(0, math.min(10, math.round(rsi / 10))) : Automatically categorizes momentum into distinct RSI tiers to calculate real-time win probability rates.
3 — Dynamic Target, Stop, & Signal Management
Bull_Stop = ta.lowest(low, 2) - atr & Bear_Stop = ta.highest(high, 2) + atr : Calculates volatility-adjusted safety padding for active trade management.
Signal Labels & Targets: Plots clear entry notifications displaying win probability percentages, along with dashed target and stop lines.
🔵 HOW TO USE
Apart from the basic visualization of volatility extremes, this tool can also act in alternative ways to support decision-making:
Identify Reversal Traps: Wait for price to break outside the upper or lower envelope boundaries and subsequently close back inside within the defined trap_window .
Evaluate Win Probability: Check the probability percentage displayed on the trap signal label (backed by historical RSI bucket tracking) before entering a trade.
Manage Risk with Stops and Targets: Use the projected dashed target lines (anchored to the basis line) and ATR-padded stop lines to execute and protect positions.
🔵 NOTES
Why this implementation is unique:
It moves beyond static band indicators by integrating a self-learning historical database that calculates live win probabilities based on momentum buckets.
The automated target and stop-loss line projection engine provides clear visual roadmaps for every triggered setup.
The script is fully optimized for Pine Script version 6, utilizing high-performance array tracking (`var int bull_total = array.new_int(11, 0)`) for smooth execution.
Note: Because the win probability engine evaluates historical trade performance dynamically in real time, initial signals on a freshly loaded chart may display "Tracking..." until sufficient sample data is recorded.
Indicator

Daily Range Exhaustion - ADR Probability MapAn intraday trader spends the whole session asking one question without ever measuring it: is there still room left in this move, or is the day already finished. Daily Range Exhaustion measures it.
The script records the completed range of every past day on the symbol you have open, and uses that sample to answer four things about the day in progress.
HOW MUCH OF THE DAY IS SPENT
Today's range is compared against the average daily range of the last 5, 10 or 20 days. The panel shows the result as a percentage. At 40 percent the day still has room in either direction. At 110 percent the day has already delivered more than an ordinary day and every further extension is, statistically, an outlier rather than the base case. The chart background tints once 100 percent is passed.
WHERE A FULL DAY COULD STILL REACH
Two levels are drawn:
Upside projection, today's low plus the average daily range. This is the highest point a statistically ordinary day could still print without becoming unusual.
Downside projection, today's high minus the average daily range.
Both compress as the session develops. Early in the day they sit far apart. By the afternoon they have squeezed toward price, and the distance left to each one is exactly the room the day has left. The shaded areas between price and each projection are that remaining room, made visible.
THE ODDS OF EXTENDING ANYWAY
Ranges are not a hard ceiling, so the panel reports how often the ceiling actually broke. Three lines show the share of past days whose range exceeded 100, 125 and 150 percent of the current average. On most liquid instruments roughly a quarter to a third of days exceed 100 percent, but far fewer reach 150 percent. Those numbers are the honest context for the exhaustion reading: they tell you whether a stretched day is rare or routine on this particular symbol.
WEEKDAY BREAKDOWN
A single average across all days hides a real effect. Many instruments have a quiet Monday and a violent Thursday, and judging Monday against a blended average will make it look exhausted when it is behaving normally. The panel breaks the sample down by weekday, shows the average range of each one, and expresses it as a percentage of the overall average. Today's weekday is highlighted.
HOW TO USE IT
As a filter on entries. Taking a fresh breakout when the day has already spent 120 percent of its average range is a different trade from taking the same breakout at 45 percent. The setup may be identical, the room available is not.
As target context. If the upside projection is 12 points away and your target is 30 points, the day would have to become a statistical outlier for that target to fill.
As mean reversion context. A day that hits the projection level and stalls has, by definition, reached the edge of its usual distribution.
As session planning. Check the weekday row before the session opens to know whether to expect a wide day or a narrow one.
NOTES ON THE DATA
The sample is built from the chart itself, so it needs history loaded. The panel shows a Building sample message and stays hidden until the minimum day count is reached, rather than showing statistics based on six observations.
Only intraday timeframes are supported. On a daily chart or higher the concept has no meaning, and the panel says so instead of printing misleading numbers.
Older days are dropped once the sample cap is reached, so the statistics follow the current volatility regime instead of averaging in a market from two years ago.
Days are bounded by the exchange session of the symbol. On instruments that trade nearly around the clock the day boundary is a convention, not a natural break, which slightly inflates the ranges of days that straddle a rollover.
WHAT IT IS NOT
There are no entry or exit signals here, and none are planned. This is context. A completed range is not a reversal signal, and an unfinished range is not a reason to expect continuation. Trends routinely spend two or three average ranges in a session, which is precisely why the extension odds are shown rather than hidden.
This is an analysis tool, not financial advice. Past distributions do not guarantee future ones. Use it alongside your own risk management and position sizing. Indicator

Gap Closure Stats# Gap Closure Stats — Publication Description
---
## What This Indicator Does
**Gap Closure Stats** tracks the gap between each session's **4:15pm ET close** (the anchor price) and up to three configurable **opening prices** — by default the midnight open (00:00 ET), the London/European open (03:00 ET), and the RTH open (09:30 ET). For each of those levels it draws a coloured box on the chart spanning from the anchor price to the opening price, and records statistics on how often price subsequently fills that gap during the regular trading session.
Every percentage in the stats table is computed **live, from the history on your own chart**. There are no hard-coded numbers. The statistics describe exactly the instrument and timeframe you are looking at, and they update automatically as new sessions complete.
The indicator answers a core structural question about daily price behaviour:
- Given a gap of a certain size between yesterday's 4:15pm close and today's open, how often does price retrace back to that 4:15pm level (a full gap fill)?
- How often does price retrace at least a defined partial amount of the gap?
- Do these tendencies differ depending on whether the gap is up or down?
- Do they change when the gap is unusually large or small relative to recent history?
It is an analytical and contextual tool. It does not issue buy or sell signals.
---
## Core Concepts and Definitions
### The Anchor Price (4:15pm ET Close)
The reference price for each trading day is the **close of the 4:15pm ET bar** from the prior session. This is captured during a narrow one-minute anchor session (default 16:15–16:16 ET). The anchor represents where the market last traded before overnight activity begins, and it is the level that a "gap fill" requires price to return to.
### The Gap
A gap exists when the opening price at one of the three configurable levels differs from the anchor. If the opening price is **above** the anchor, the gap is **up** — price has gapped higher overnight and a fill means price would need to fall back to the anchor. If the opening price is **below** the anchor, the gap is **down** — price would need to rally back to fill it.
The **gap size** in points is the absolute difference between the anchor and the opening price.
### Gap Size Buckets (Quartiles vs. History)
Each day's gap size is classified into one of four buckets based on where it falls in the **historical distribution of all prior gaps** on your chart:
- **Q1 (0–25th percentile)** — the smallest gaps relative to history
- **Q2 (25–50th percentile)** — below-median gaps
- **Q3 (50–75th percentile)** — above-median gaps
- **Q4 (75–100th percentile)** — the largest gaps relative to history
This classification requires at least 4 prior sessions of data before it becomes meaningful. On very fresh charts, all gaps are assigned to Q2 until enough history accumulates. The bucket thresholds update as each new session completes.
### Full Gap Fill (Hit%)
A **full gap fill** (labelled **FULL%** in the table) is recorded when price trades at or through the anchor price at any point during the RTH session (09:30–16:00 ET). It does not matter whether price opens, then reverses immediately, or whether it fills the gap hours later — any intraday touch of the anchor counts.
### Partial Gap Fill (≥X%)
The **partial fill level** is user-configurable (default 50%). A partial fill is recorded when price retraces at least that percentage of the gap back toward the anchor from the opening price. For example, with a 50% setting: if the gap up is 10 points (open is 10 points above the 4:15pm close), a partial fill is recorded when price falls to within 5 points of the open (i.e. 5 points back toward the anchor). A 100% setting makes this equivalent to FULL% — a complete gap fill.
### The Three Gap Levels
The indicator captures three independent opening prices, each at a configurable time:
- **Level 1** — defaults to the **RTH open at 09:30 ET**. This is the most widely watched gap — the difference between the prior day's 4:15pm close and the next day's regular-session open.
- **Level 2** — defaults to the **03:00 ET open** (broadly the London/European futures open). This captures the gap that existed when European trading began.
- **Level 3** — defaults to the **midnight (00:00 ET) open**. This captures the initial overnight gap that formed at the start of the new calendar day.
Each level builds its own independent statistics, so you can compare how gap-fill behaviour differs across these three time windows.
### Level Quartile (LQ)
For the current session, the **level quartile** describes where the opening price of each level sits **within the gap box** — i.e. how far into the gap that level's open was relative to the full anchor-to-RTH-open range. LQ1 means the level opened very close to the RTH open (near the far edge of the gap), LQ4 means it opened very close to the anchor (near full-fill territory already).
---
## What You See on the Chart
### Gap Boxes
For each active level, a shaded box is drawn spanning from the **anchor price** to the **opening price** at that level's time. The box extends rightward through the session, stopping at 4:15pm ET. The box colour matches the level's configured colour (default: purple for Level 1, blue for Level 2, teal for Level 3). Boxes are shown only when there is a genuine gap — if the opening price equals the anchor, no box is drawn.
### Quartile Lines Inside Boxes
When enabled, three dashed/solid lines are drawn inside each gap box, dividing it into four equal price quartiles:
- **Q1 line (dashed)** — 25% of the way from the opening price toward the anchor
- **Q2 line (solid)** — the midpoint of the gap (50%)
- **Q3 line (dashed)** — 75% of the way toward the anchor
These help you gauge how far price has retraced into the gap at a glance, and they correspond to the Level Quartile (LQ) measure in the stats table.
### Opening Price Lines
A dotted line is drawn at each level's opening price for the session and extends rightward to 4:15pm, giving a persistent visual reference for where each gap began.
### Session History
The indicator keeps and displays the last N sessions (configurable, default 10). Older boxes and lines are automatically removed as new sessions are added, keeping the chart uncluttered.
---
## The Stats Table, Explained Column by Column
The stats table has one block of four rows per level. Each block breaks down the statistics for that level across the four gap-size quartile buckets.
### Row structure
Each row corresponds to one **gap size bucket** (Q1 through Q4). The row currently matching today's session is highlighted in grey.
### Columns
**LEVEL** — identifies which opening level the block belongs to (shown as the configured session string, e.g. `0930-0931`). The label is coloured to match the level's chart colour.
**GAP SIZE BUCKET (vs history)** — the quartile label for that row:
- `0–25%ile (smallest gaps)` — Q1
- `25–50%ile` — Q2
- `50–75%ile` — Q3
- `75–100%ile (largest gaps)` — Q4
**GAP UP — N** — the number of completed sessions where the gap was **up** (open above anchor) and fell in this size bucket.
**GAP UP — FULL%** — of those sessions, the percentage where price returned to the anchor at any point during RTH. This is the full gap fill rate for up-gaps of this size.
**GAP UP — ≥X%** — of those sessions, the percentage where price retraced at least the configured partial fill percentage back toward the anchor. At the default 50% setting, this is how often the market covered at least half the gap.
**GAP UP — AVG GAP** — the average gap size in points for up-gap sessions in this bucket.
**GAP DOWN — N / FULL% / ≥X% / AVG GAP** — the same four columns as above, but for sessions where the gap was **down** (open below anchor).
**CURRENT SESSION — GAP-Q / LVL-Q** — visible only on the row matching today's gap size bucket, and only when a level has fired today. Shows two numbers:
- **GQ** — the gap size quartile for today (GQ1 = smallest, GQ4 = largest)
- **LQ** — the level quartile, indicating where that level's open sits within today's overall gap box (LQ1 = close to the RTH open, LQ4 = close to the anchor)
---
## How To Configure the Indicator
### Anchor Settings
**Anchor Session (4:15pm)** — the one-minute session window used to capture the previous session's closing price. The default `1615-1616` captures the 4:15pm ET bar close. Only change this if your instrument's reference close is at a different time.
### Gap Times
These three groups configure the three independent opening levels. Each has the same three inputs:
**Level X Open Time** — a PulseWire session string defining the one-minute window at which the opening price is captured. The default sessions are:
- Level 1: `0930-0931` (RTH open)
- Level 2: `0300-0301` (European open)
- Level 3: `0000-0001` (Midnight ET)
You can change any of these to any time of day. Common alternatives include the 08:30 ET futures open (`0830-0831`) or the London open (`0800-0801`). The level fires once per calendar day at the first bar inside that window, and only if the anchor has already been set.
**Level X Color** — the colour used for that level's box, lines, and table label.
**Show Level X** — master toggle. When off, the level's boxes and lines are hidden and its rows are omitted from the stats table.
### Gap Fill Stat
**Partial Fill Level (%)** — controls what counts as a partial fill, from 1% to 100%. At 50% (default), the ≥X% column in the table tracks how often price retraced at least halfway back to the anchor. Set this to 100% to track only complete fills, or to a lower value such as 25% to track more modest retracements. The column header in the table updates to reflect your chosen value (e.g. `≥50.0%`).
### Visuals
**Show Gap Boxes (per level)** — toggles the shaded gap boxes on or off for all levels. The opening-price dotted lines are still drawn when this is off.
**Show Quartile Lines Inside Boxes** — toggles the three internal Q1/Q2/Q3 division lines inside each gap box.
**Keep Last N Sessions** — how many sessions of boxes and lines to retain on the chart. Higher values give more context but can clutter the chart. Default is 10.
### Stats Table
**Position** — one of nine positions on the chart for the stats table (top/middle/bottom × left/center/right). Default is `bottom_right`.
**Text Size** — `tiny`, `small`, `normal`, or `large`. Default is `small`. Use `tiny` on smaller screens or when all three levels are shown simultaneously.
---
## Practical Tips for Interpreting the Statistics
**Focus on N first.** A FULL% or ≥X% figure is only meaningful with an adequate sample size. Rows with small N values (especially Q4, which by definition can only contain 25% of all sessions) should be read cautiously. As a general guide, treat any figure based on fewer than 20–30 sessions as directionally interesting but not statistically reliable.
**Compare up vs. down gaps.** Many instruments show different fill rates for up-gaps versus down-gaps. A market that fills up-gaps 80% of the time but down-gaps only 50% of the time has a structural asymmetry worth knowing about.
**Use the size buckets to understand context.** The quartile split reveals whether gap-fill behaviour is consistent across all gap sizes or whether it changes materially. For example, small gaps (Q1) may fill at very high rates while large gaps (Q4) fill much less often — or vice versa. Today's highlighted row tells you which regime today's gap falls into.
**The partial fill column adds nuance.** Even when FULL% is modest, the ≥50% column may be high, suggesting price often makes a meaningful but incomplete move back toward the anchor. This can be useful context for targets and stops.
**The current session column (GAP-Q / LVL-Q)** tells you at a glance where today sits historically. GQ4 / LQ2 would mean today has a historically large gap, and Level 2 opened roughly in the middle of that gap — already halfway to a fill before the RTH session began.
**Compare levels against each other.** If Level 3 (midnight open) shows a higher fill rate than Level 1 (RTH open), it may indicate that much of the gap-filling happens during the overnight and pre-market session before RTH begins. If Level 1 shows a higher fill rate, the RTH session is where fills predominantly occur.
---
## Important Limitations and Considerations
1. **Levels must fire after midnight ET.** Because the indicator resets its session state once per calendar day in Eastern Time, a level's open time must fall on or after 00:00 ET for it to be captured correctly for that calendar day. If you configure a level earlier than midnight ET (which would be the prior afternoon), it will not associate correctly with the next day's anchor. The three defaults (00:00, 03:00, 09:30) all respect this constraint.
2. **The indicator requires an anchor from the prior session.** On the very first bar of a chart's history (or after a gap in data), there is no prior 4:15pm close available and no gap is measured for that day. This is normal behaviour and those sessions are simply skipped.
3. **Gap size quartile buckets need history to calibrate.** Until at least 4 prior gaps have been recorded, all sessions are assigned to Q2. The quartile thresholds update as history grows, so the bucket assignments for earlier sessions may shift over time as more data accumulates. This is by design — the buckets are always relative to all available history, not a fixed absolute threshold.
4. **All times are Eastern Time (ET).** The indicator uses the `America/New_York` timezone for all session windows. If your chart's timezone is set differently, the session windows still fire at the correct ET times — but the visual bar positions will correspond to your chart's local timezone.
5. **The stats table only shows levels that are enabled.** If you turn off Level 2, its rows are removed from the table and its data is no longer accumulated. Stats accumulate only for sessions where a level is enabled, so disabling and re-enabling a level mid-history will cause a gap in its data.
6. **Descriptive, not predictive.** The indicator reports what has happened on your chart's history. Past fill rates do not guarantee future behaviour. A 75% full-fill rate means the gap did not fill 25% of the time. These statistics provide context, not certainty, and should be used alongside your own analysis and risk management.
7. **Not financial advice.** This is an analytical and educational tool. It does not provide buy or sell signals and makes no claim about future price direction.
---
*Gap Closure Stats computes everything from the sessions on your own chart — no external data, no hard-coded numbers. The statistics are only as reliable as the history available on your chart.* Indicator

Bitcoin Statistical Forecaster + Power Law [Gabremoku]Bitcoin Statistical Forecaster + Power Law combines two analytical layers into a single BTC-focused overlay.
The first layer is a statistical analog forecaster. It scans historical Bitcoin data and searches for the closest matches to the most recent pattern using a weighted multi-feature distance model based on candle structure, volatility, momentum, trend distance, and structural position relative to the Bitcoin power-law range.
The second layer is a long-term Bitcoin power-law framework built from three structural curves: Floor, Mid-Stair, and Fair Value. These curves are plotted directly from the power-law formula and are not altered by the forecasting engine.
The script is not a simple mashup of two unrelated tools. The power-law layer is used as structural context inside the forecaster itself: it contributes to analog selection, regime comparison, optional forecast anchoring, and optional probability adjustment. The goal is to make historical pattern matching more aware of where price is located inside Bitcoin’s broader long-term structure.
How the forecast works:
The script compares the latest pattern against historical BTC windows.
It keeps the best analogs according to the selected similarity method.
These analogs are separated into Bull, Central, and Bear groups using the final return at the selected forecast horizon.
For each step in the projection, each scenario path is built from the weighted average of its own analog group, so the paths remain internally coherent instead of mixing bullish and bearish trajectories.
An optional structural bias can softly pull projected prices toward the power-law range over time. This effect fades in progressively across the forecast horizon, so near-term projections are not abruptly distorted.
Scenario probabilities are derived from the same percentile thresholds used to build the Bull, Central, and Bear paths. This keeps the displayed percentages aligned with the projected paths shown on the chart.
The script is designed for daily Bitcoin charts and works best when enough historical data is available. It is a probabilistic context tool, not a prediction guarantee, and it should be used together with risk management and independent market analysis.
Suggested usage:
Use the power-law curves to identify long-term structural position.
Use the forecast paths to estimate how similar historical BTC conditions evolved.
Compare current price location, structural regime, and scenario probabilities before forming a directional bias.
Treat the output as a contextual model, not as a standalone trading signal. Indicator

The Strat Sequence Continuation / Reclaim Engine v1.0The Strat Sequence Continuation / Reclaim Engine
The Strat Sequence Continuation / Reclaim Engine is a body-close-based study designed to help traders review how specific Strat candle sequences have historically resolved on the selected chart timeframe.
This indicator combines two separate views:
1. **Markov Regime Permission Panel**
A regime-style table that evaluates recent price behavior and displays market state, return, transition probabilities, permission, and trade behavior context. This table can be turned on/off by the user.
2. **Strat Sequence Continuation / Reclaim Table**
A focused table that measures whether selected Strat sequences continued by body close or failed/reclaimed the relevant reference level.
The sequence table evaluates setups such as:
* Failed 2U → x
* Failed 2D → x
* F2U → 2D → x
* F2D → 2U → x
* F2U → 2D → 2D → x
* F2D → 2U → 2U → x
* 2-2U → x
* 2-2D → x
* 2-1-2U → x
* 2-1-2D → x
* 3-1-2U → x
* 3-1-2D → x
* 3H → x
* 3L → x
For bullish sequences, continuation is counted only when the next candle closes above the applicable reference candle high.
For bearish sequences, continuation is counted only when the next candle closes below the applicable reference candle low.
If price does not close beyond the reference level, the event is classified as reclaim/fail.
The table also includes:
* User-selected lookback
* Live setup candle read
* Live sequence watch
* Body-close decision rule
* Row visibility controls
* Minimum sample threshold filtering
* Optional bull/bear color coding
This tool is intended for historical sequence review, market context, and discretionary analysis. It does not predict future price movement, generate buy/sell signals, or provide financial advice. All outputs depend on the selected symbol, timeframe, lookback settings, and available chart history.
Indicator

Mean Reversion Pro 📊 Mean Reversion Pro — Data-Driven Edge on Any Market, Any Timeframe
Most mean reversion indicators tell you the price is "too far" from the moving average. This one tells you exactly how far is statistically worth trading — using your own chart's historical data as proof.
Works on all instruments and timeframes: futures (NQ, ES, CL, GC…), crypto (BTC, ETH, SOL…), forex (EUR/USD, GBP/USD…), indices (SPX, DAX, NASDAQ…), stocks, commodities — anything with a price and volume.
─────────────────────────────────────────
🔍 WHAT THIS INDICATOR DOES
─────────────────────────────────────────
Mean Reversion Pro silently analyses every historical instance where price deviated from a moving average by a given distance. For each of 15 tested threshold levels it computes:
• Win rate — % of times price returned to the MA within the timeout
• Expectancy — (win-rate × avg MFE) − (loss-rate × avg MAE)
• Profit Factor — gross gain / gross loss ratio
• Avg MAE — average adverse excursion (how far against you before reverting)
• Avg MFE — average favourable excursion (how far in your favour)
• Avg return time — average bars needed to reach the MA
It then automatically selects the threshold with the highest expectancy that also satisfies your minimum win-rate and minimum occurrences filters — and only then shows a signal. No manual optimisation. No curve-fitting.
─────────────────────────────────────────
⚙️ KEY FEATURES
─────────────────────────────────────────
✅ Universal — works on futures, crypto, forex, indices, stocks, commodities
✅ 3 threshold modes: fixed Points, ATR multiples, Z-Score (adapts to any volatility regime)
✅ 5 MA types: EMA, SMA, WMA, VWMA, Hull MA
✅ Auto-optimised threshold — the indicator finds the best level by itself
✅ Real-time dashboard: win-rate, expectancy, profit factor, MAE, MFE, return time (Long & Short)
✅ Dynamic bands: 1× and 1.5× optimal threshold zones drawn on the chart
✅ Non-repainting signals — only fires on confirmed, closed bars
✅ Optional filters: trend (EMA 50), volume, US session, minimum ATR
✅ Minimum history guard — signals are held until enough bars have been analysed
✅ All parameters fully exposed and documented with tooltips
─────────────────────────────────────────
📈 WHO IS THIS FOR
─────────────────────────────────────────
• Futures traders — NQ, MNQ, ES, MES, CL, GC, SI, ZB…
• Crypto traders — BTC, ETH, SOL and all altcoins on any exchange
• Forex traders — all major, minor and exotic pairs
• Index traders — SPX, NDX, DAX, FTSE, CAC, Nikkei…
• Stock traders and swing traders looking for mean reversion pullbacks
• Prop firm traders who need a systematic, rules-based edge
• Any trader tired of arbitrary support/resistance levels with no statistical backing
─────────────────────────────────────────
🧠 HOW TO USE IT
─────────────────────────────────────────
1. Apply to any chart on any timeframe
2. Let at least 500 bars load (recommended: 1000–2000 for robust statistics)
3. Choose Threshold Mode:
— Points → best for futures and indices (fixed price distances)
— ATR → best for crypto and forex (volatility-adjusted)
— Z-Score → best for statistical/quant approaches
4. Set your minimum Win Rate (default 65%) and minimum Occurrences (default 15)
5. A signal appears only when all statistical conditions are met AND your filters pass
6. Read the dashboard to assess setup quality before entering a trade
─────────────────────────────────────────
💡 WHY EXPECTANCY MATTERS MORE THAN WIN RATE
─────────────────────────────────────────
A strategy with 80% win rate can still lose money if the average loss is 5× the average win. Mean Reversion Pro uses expectancy — the only metric that combines win rate, average gain and average loss into a single number — as its selection criterion. A signal only appears when the math is in your favour.
─────────────────────────────────────────
⚠️ DISCLAIMER
─────────────────────────────────────────
This indicator is a decision-support tool only. It does not provide financial advice and does not guarantee future results. Past statistical performance is not indicative of future performance. Always use proper risk management. Indicator

Session Probability Grid [JOAT]Session Probability Grid
Introduction
Session Probability Grid is an open-source session auction map. It builds percent-based ladder levels from the active session open, tracks historical hit behavior for those levels, and displays probability-style context for expansion, exhaustion, and unusual session movement.
The problem it solves is session framing. Traders often know the open is important, but they may not know whether a move is normal for the current symbol and timeframe. This script records session outcomes and converts them into visible ladder probabilities.
Core Concepts
1. Session Open Ladder
The script creates six upside and six downside levels from the session open using configurable percentage steps. These levels frame how far price has moved away from the open.
2. Historical Hit Memory
At the end of each session, the script updates arrays storing hit counts, sample counts, and continuation distance. This creates a rolling sample of how often each ladder has been reached.
3. Opening Range Context
The first configurable number of bars defines the opening range. The session box and opening range box help distinguish early balance from later expansion.
4. Expansion and Exhaustion States
Expansion states identify movement through areas with supportive historical behavior. Exhaustion states mark stretched locations where continuation may be less reliable.
5. Session VWAP Gradient
The optional session VWAP gradient adds a live auction mean reference so ladder movement can be compared against the developing session control line.
Features
Open-relative ladder: Six upside and six downside levels based on configurable percent steps.
Statistical memory: Tracks hit count, sample count, and continuation distance from completed sessions.
Probability cards: Right-side cards show ladder behavior without crowding price.
Expansion and exhaustion states: Highlights meaningful session movement conditions.
Session and opening range boxes: Frames current auction development.
Session VWAP gradient: Adds a developing mean reference.
Candle coloring: Bars can be colored by session state.
Dashboard: Shows session state, nearest ladder, hit probability, expected continuation, and range condition.
Alerts: Upside expansion, downside expansion, upper exhaustion, and lower exhaustion.
Input Parameters
Core Session: Active Session, Opening Range Bars, Stat Sample Cap, Session Range Box, Opening Range Box.
Ladder: Open-Relative Ladders and Step 1 through Step 6.
Signals and Visuals: Auction State Zones, State Projection Bars, Continuation Probability Gate, Right Probability Cards, Session Candle Color, Session VWAP Gradient, Dashboard.
How to Use This Indicator
Step 1: Start from the session open
The ladder levels are built from the open, so they frame the current session relative to its starting price.
Step 2: Compare price to the ladder
As price approaches a ladder level, check the probability card and dashboard for historical hit and continuation context.
Step 3: Distinguish expansion from exhaustion
Expansion and exhaustion states help separate normal auction development from stretched movement.
Indicator Limitations
Probabilities are based on the chart's available historical sessions and are not universal statistics.
Session boundaries depend on the selected exchange/session setting.
The script needs enough completed sessions to build useful samples.
Probability context does not predict future price.
Originality Statement
Session Probability Grid is original in its combination of open-relative ladders, rolling hit memory, continuation-distance storage, session VWAP context, opening range framing, and expansion/exhaustion visualization. It is not just a static percent-level tool; it updates its context from completed session behavior.
Disclaimer
This script is for educational and informational purposes only. It is not financial advice and does not recommend trades. Historical session behavior may not repeat. Use independent analysis and risk management.
Made with passion by jackofalltrades
Indicator

Structural Sequence Pressure [JOAT]Structural Sequence Pressure
Introduction
Structural Sequence Pressure is a market-structure breakout indicator built around the idea that not all pivot levels carry the same weight. A level formed after one isolated pivot is ordinary. A level formed after repeated higher lows or lower highs represents structural persistence. This script quantifies that persistence, plots the resulting support and resistance levels, and highlights when those levels break.
The indicator is designed for traders who want clean structure without overfitting. It tracks sequence depth, manages active levels, and focuses attention on breaks that matter more because the market spent time constructing them.
Why This Indicator Exists
Sequence-Based Structure: Measures how many pivots formed in the same directional progression
Level Significance Filter: Helps distinguish weak levels from structurally reinforced ones
Live Break Detection: Signals when meaningful support or resistance gives way
Clutter Control: Caps active lines and labels to keep charts readable
Statistical Feedback: Shows the most recent sequence pressure behavior directly in the dashboard
Core Components Explained
1. Confirmed Pivot Detection
pivHigh = ta.pivothigh(high, leftBars, rightBars)
pivLow = ta.pivotlow(low, leftBars, rightBars)
The script only reacts to confirmed pivots. This means levels are built from validated swing points rather than from intrabar noise, which keeps the tool stable and non-repainting after pivot confirmation.
2. Upward and Downward Sequence Counting
When a new pivot low forms higher than the previous pivot low, the upward sequence count increases. When a new pivot high forms lower than the previous pivot high, the downward sequence count increases. If the relationship fails, the sequence resets to one.
Higher lows: Build upward structural pressure
Lower highs: Build downward structural pressure
Longer sequences: Represent stronger structural continuity
3. Active Level Engine
Every confirmed pivot creates a horizontal level that extends right. Support levels come from pivot lows. Resistance levels come from pivot highs. Each level stores:
Its price
Whether it is support or resistance
Its sequence depth
Its creation time
Levels are trimmed by age and capped by quantity so the chart stays clean.
4. Break Logic
brokeSupport = close < supportLevel
brokeResistance = close > resistanceLevel
Only levels with sequence depth greater than or equal to the selected threshold can trigger signals. This creates a cleaner breakout map that emphasizes structurally meaningful failures and expansions.
5. Chart Hygiene Controls
The script stores and prunes pivot labels so they do not accumulate indefinitely. Broken or expired levels are removed from active management, and broken levels can optionally be deleted immediately for a cleaner chart.
Visual Elements
Support Lines: Teal dashed levels extending from higher-low pivots
Resistance Lines: Red dashed levels extending from lower-high pivots
Pivot Labels: Compact U/D sequence tags showing progression depth
Break Markers: Triangles on bullish resistance breaks and bearish support breaks
Dashboard: Up sequence, down sequence, total breaks, last break depths, and active level count
Input Parameters
Pivot Left / Right Bars: Confirmation strength for structural swings
Minimum Sequence: Required sequence depth before a break can trigger
Max Active Levels: Hard cap for line management and chart cleanliness
Max Level Age: Removes stale structure from consideration
Delete Broken Levels: Optional cleanup for a more minimal chart
How to Use This Indicator
Step 1: Identify whether the market is building higher lows or lower highs.
Step 2: Focus on levels with deeper sequence counts.
Step 3: Treat bullish signals as upside breaks of resistance sequences.
Step 4: Treat bearish signals as downside breaks of support sequences.
Step 5: Use the level count and recent break depths to judge whether structure is compressing or resolving.
Best Practices
Use larger pivot settings on volatile instruments to reduce noise
Increase minimum sequence length when markets are choppy
Pair with trend or participation tools to separate continuation from exhaustion
Respect old levels less than fresh ones unless they were built with deep sequence pressure
Use the dashboard to calibrate structure sensitivity instrument by instrument
Indicator Limitations
Pivot-based tools confirm after the fact by design
Sequence strength measures persistence, not certainty
Very low pivot settings can create too many structural levels
Very high pivot settings can delay signals
Breakouts can still fail, especially in range-bound conditions
Technical Implementation
Built in Pine Script v6 using:
Confirmed pivot detection
Directional sequence counting
Array-managed line storage
Label retention caps for chart cleanliness
Age-based level cleanup
Non-repainting break logic on confirmed bars
Originality Statement
This indicator is original in its focus on sequence depth as the source of structural weighting. Many support and resistance tools draw levels; this one grades their importance by the persistence of the swing process that created them, then filters breakout logic through that structural pressure.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Structural breaks can fail, reverse, or whipsaw. Always use independent analysis, stops, and appropriate risk management.
-Made with passion by officialjackofalltrades
Indicator

Deviation Lens [JOAT]Deviation Lens
Introduction
Deviation Lens is an open-source multi-dimensional statistical displacement tool that applies Z-Score analysis simultaneously to three market dimensions: price level, close-to-close price change, and volume. Rather than using arbitrary overbought/oversold thresholds derived from historical maxima and minima, Deviation Lens computes exactly how many standard deviations each dimension is from its recent rolling mean. This provides a precise, adaptive, distribution-aware measure of how statistically extreme current market conditions are.
The core insight is that markets are mean-reverting systems over short time horizons. Statistical extremes — conditions where price, momentum, or volume are far from their recent averages — represent transient states. The further from the mean, the greater the statistical probability that conditions will normalize. Deviation Lens quantifies this probability directly, from 0% (at the mean) to 99.7% (at three standard deviations), and displays it as a live reversal probability for every bar.
Core Concepts
1. Three-Dimensional Z-Score Calculation
Three independent Z-Scores are computed on every bar:
The Price Z-Score measures how far the current close is from the rolling mean close in standard deviation units. This captures whether the current price level is statistically cheap or expensive relative to recent history.
The Change Z-Score measures how far the current bar's close-to-close price change is from the rolling mean change — quantifying momentum extremity rather than price level extremity.
The Volume Z-Score measures how far the current volume is from the rolling mean volume. High-volume Z-Score values identify bars where unusual institutional participation is statistically evident:
priceZ = priceStd > 0 ? (close - priceMean) / priceStd : 0.0
changeZ = changeStd > 0 ? (chg - changeMean) / changeStd : 0.0
volumeZ = volStd > 0 ? (volume - volMean) / volStd : 0.0
2. Reversal Probability Mapping
The absolute Z-Score is mapped to a reversal probability percentage based on the properties of the normal distribution. A Z-Score of 1.0 corresponds to 68.3% of values lying within one standard deviation — meaning only 31.7% of readings exceed this level, implying a 68.3% probability of mean reversion. A Z-Score of 2.0 corresponds to 95.4%, and 3.0 to 99.7%:
calcRevProb(float z) =>
float absZ = math.abs(z)
absZ >= 3.0 ? 99.7 : absZ >= 2.5 ? 98.8 : absZ >= 2.0 ? 95.4 : absZ >= 1.5 ? 86.6 : absZ >= 1.0 ? 68.3 : absZ >= 0.5 ? 38.3 : 0.0
This probability is displayed in the dashboard alongside the live Z-Score value, giving the trader both the raw statistical reading and its corresponding reversal likelihood.
3. Composite Z-Score and Zone Classification
The three individual Z-Scores are combined into a composite score using configurable weights for each dimension. The composite is then classified into a zone: EXTREME (above the configurable extreme threshold), ELEVATED, NEUTRAL, or the opposing directional equivalents. Zone classification determines the dashboard color coding and alert triggers:
composite = (priceZ * wPrice + changeZ * wChange + volumeZ * wVolume) / totalWeight
4. Divergence and Hidden Divergence Detection
Deviation Lens monitors for two divergence conditions. Standard divergence occurs when the Z-Score direction disagrees with the price direction — price makes a higher high but the Z-Score makes a lower high (bearish divergence), or price makes a lower low but the Z-Score makes a higher low (bullish divergence). Hidden divergence occurs when the Z-Score makes an extreme move while price action is relatively contained — a potential continuation pattern. Divergence events are labeled directly on the chart with bold, clearly sized labels:
bullDiv = close > close and priceZ < priceZ // Price up, Z down = bull div
bearDiv = close < close and priceZ > priceZ // Price down, Z up = bear div
Labels: BULL DIV, BEAR DIV (size.small), H.BULL, H.BEAR (size.tiny for hidden divergence).
5. Multi-Dimensional Dashboard
The institutional dashboard presents all three Z-Scores, the composite Z-Score, current zone classification, reversal probability, and divergence status simultaneously. The layout is designed so the most actionable information — Zone and Rev. Probability — is displayed at the largest text size, with supporting metrics at smaller sizes.
Features
Three independent Z-Scores: Price level, price change (momentum), and volume — each computed on its own rolling mean and standard deviation
Configurable Z-Score weights: The composite score uses adjustable per-dimension weights allowing emphasis on price, momentum, or volume depending on trading context
Live reversal probability: Probability percentage mapped directly from the Z-Score using normal distribution properties (68.3% at 1σ through 99.7% at 3σ)
Zone classification: Composite Z-Score classified as Extreme, Elevated, or Neutral in both directions with color-coded dashboard display
Divergence labels (BULL DIV / BEAR DIV): Z-Score vs price direction disagreement labeled on-chart at size.small
Hidden divergence labels (H.BULL / H.BEAR): Z-Score extreme with contained price action labeled at size.tiny
Configurable extreme and elevated thresholds: Both Z-Score thresholds independently adjustable
Institutional dashboard (top right): 14-row table with Price Z, Change Z, Volume Z, Composite Z, Zone, Reversal Probability, and divergence status
Adaptive thresholds: All calculations normalize to the rolling lookback period, adapting to current instrument and timeframe volatility
Alerts: Separate alertconditions for extreme bull and extreme bear composite Z-Score readings
Input Parameters
Z-Score Settings:
Z-Score Length: Rolling window for all three Z-Score calculations (default: 20)
Extreme Threshold: Z-Score magnitude classified as Extreme zone (default: 2.0)
Elevated Threshold: Z-Score magnitude classified as Elevated zone (default: 1.0)
Dimension Weights:
Price Weight: Relative weight of the price Z-Score in composite (default: 1.0)
Change Weight: Relative weight of the momentum Z-Score in composite (default: 1.0)
Volume Weight: Relative weight of the volume Z-Score in composite (default: 0.5)
Divergence:
Divergence Lookback: Bars back for divergence comparison (default: 5)
Show Divergence Labels toggle
Display:
Show Dashboard toggle
Bull and Bear color inputs
How to Use This Indicator
Step 1: Read the Composite Zone
The Zone row in the dashboard shows the current composite Z-Score classification. EXTREME readings at the top of the scale indicate the highest statistical probability of mean reversion. NEUTRAL readings indicate current conditions are close to the mean and have low statistical directional edge from this tool alone.
Step 2: Check Reversal Probability
The Rev. Probability row translates the Z-Score magnitude directly into a percentage. A reading above 95% means the current composite Z-Score is in the outer 5% of its historical distribution — a statistical extreme that has preceded mean reversion 95% of the time in the measured period.
Step 3: Assess Each Dimension Independently
The three individual Z-Score rows reveal which dimension is driving the composite. A high composite driven entirely by volume Z-Score is a different setup than one driven by price Z-Score. Understanding which dimension is extreme helps filter entries: a price Z-Score extreme without supporting momentum or volume Z-Score extremes may be a lower-conviction reading.
Step 4: React to Divergence Labels
BULL DIV and BEAR DIV labels appear when Z-Score momentum diverges from price direction. These signal that the statistical driver of a move is weakening even as price continues. H.BULL and H.BEAR hidden divergence labels flag potential continuation setups where Z-Score is extreme but price is not.
Step 5: Combine with Structural Context
Deviation Lens produces the highest value when its extreme readings coincide with a structural confluence point — an order block, session low, or structure level. A 99.7% reversal probability at a tested support zone is a higher-conviction setup than the same reading in open air.
Indicator Limitations
All Z-Scores are computed relative to the rolling lookback window. The lookback defines what "normal" means. A very short lookback will produce extreme readings frequently; a very long lookback will rarely reach the extreme threshold. Calibration to the instrument and timeframe is required
The reversal probability percentages are derived from the normal distribution assumption. Price change and volume distributions are not perfectly normal — they exhibit fat tails and skew. The probabilities are approximations, not precise statistical guarantees
The composite Z-Score uses equal weights by default. Changing dimension weights significantly alters which market conditions produce extreme readings. Weight adjustments should be based on the specific instrument's characteristics
Divergence detection uses a simple lookback comparison, not a peak-detection algorithm. In choppy markets, divergence labels may appear frequently without providing actionable signals
Originality Statement
Deviation Lens is original in its simultaneous, weighted multi-dimensional Z-Score framework that maps composite statistical extremity directly to a reversal probability percentage. This indicator is published because:
Applying Z-Score analysis to three independent market dimensions simultaneously — price level, momentum (close-to-close change), and volume — rather than a single oscillator provides a richer statistical picture of current market extremity than any single-dimension Z-Score tool
The direct mapping of Z-Score magnitude to reversal probability percentages using normal distribution properties gives traders an immediately interpretable statistic rather than a raw number requiring subjective interpretation
The composite weighted Z-Score system, where each dimension's contribution to the overall reading is configurable, allows the indicator to be tuned toward price-mean-reversion strategies, momentum exhaustion strategies, or volume anomaly detection depending on the trader's methodology
The combined detection of standard divergence and hidden divergence between the Z-Score and price direction provides trend continuation and reversal signals from the same framework
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Z-Score readings and reversal probability percentages are statistical tools based on historical distributions and do not guarantee any future price behavior. The normal distribution assumption applied to price and volume data is an approximation. Always use proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
Indicator

SuperTrend Take-Profit Dimensions [AlgoAlpha]🟠 OVERVIEW
A multi-dimensional take-profit aid that scores how typical the current bar looks compared to past SuperTrend pivots, so you can tell when a trend has reached favorable exit conditions.
The indicator runs a standard SuperTrend and records every confirmed zigzag pivot that occurs during a matching-direction run. Tops go into a bull pool , bottoms into a bear pool . Each pivot is stored as a set of readings across several independent axes, such as relative volume , time of day , and price position inside the recent range .
On every bar, the current reading on each axis is compared to that historical pool. A blended score from 0 to 100 tells you how closely the current conditions resemble where past pivots in the same direction have clustered. The idea is to give trend followers a data-backed sense of when to start tightening up, rather than guessing an exit or using a fixed R-multiple.
The three built-in axes were chosen deliberately to be as uncorrelated as possible , each describing a different dimension of market context: volume (relative volume percentile), time (time of day), and price (position in recent range). Correlated inputs would double-count the same information and distort the blended score; picking axes that describe genuinely different aspects of the market means each one contributes independent evidence, and the score reflects how many distinct dimensions are currently in agreement.
🟠 CONCEPTS
SuperTrend — An ATR-based trailing stop that flips between bullish and bearish states. Controls which pool of historical pivots the script reads from.
Pivot pool — A rolling store of confirmed zigzag pivots, split by direction. Bull pool holds pivot highs that printed during bullish SuperTrend runs; bear pool holds pivot lows from bearish runs. Capped at 2000 entries per side .
Context axis — A 0–100 value measured at the pivot bar. The script ships with three built-ins ( relative volume percentile , time of day , position in recent range ) and one optional user-plugged signal.
Axis independence — The three built-in axes cover volume , time , and price respectively, chosen so each describes a structurally different part of the market. Low correlation between axes keeps the blended score from being dominated by any single factor.
Conditional histogram — For each active axis, the script walks its pool and keeps only pivots whose bins on every other active axis match the current bar. The survivors are binned to form a histogram.
Axis score — For one axis, the count of pivots in the current bar's bin divided by the count in the histogram's tallest bin, scaled to 0–100 . 100 means the current context sits in the densest part of past pivots.
Blended favourability score — Arithmetic mean of the active per-axis scores. This is what the gauge and table display.
Density-match scoring — The score measures how common the current context is among past pivots. It is not a forward probability and makes no claim about what happens next.
🟠 FEATURES
Right-side context profiles — Stacked mini histograms render to the right of price, one per active axis.
• Bar heights show how pivots in each axis's conditional pool distribute across bins.
• A dashed vertical line marks the current bar's bin on that axis, so you can see at a glance where today sits against history.
• Bar hue tracks the active SuperTrend direction.
Favourability gauge — A vertical gradient table in the bottom-right showing the blended score, with a chevron marking the current level. Green at the top, red at the bottom.
Favourability breakdown table — A two-column readout of each active axis's individual score out of 100, plus a final row that classifies the blended score as Good , Neutral , or Bad . Position and text size are configurable.
Bar coloring — Bars fade from neutral grey toward the opposing trend colour as the blended score rises toward 100, so the chart itself signals when the context is stretched.
Take-profit markers — Small orange markers print above or below the bar when the blended score hits 100 for the active SuperTrend direction.
Timeframe guard — The time-of-day axis disables automatically on daily and higher timeframes, where the reading has no meaning, and a banner explains this so the blended score stays honest.
Multi-dimensional scoring engine — Four independent axes feed into a single score, each conditioned on all the others.
• Three built-in axes can be toggled on or off individually.
• A fourth axis accepts any plot via source input , provided the series stays within 0–100 on all loaded bars.
• An on-chart warning prints if the custom signal leaves that range, and the axis is ignored until it is corrected.
Deliberately uncorrelated built-in axes — Volume ( relative volume percentile ), time ( time of day ), and price ( position in recent range ) cover three structurally different facets of market context. Keeping the axes independent means each one adds new information to the blend rather than reinforcing the others.
Alert conditions — Six alerts are included: SuperTrend bullish flip, SuperTrend bearish flip, score peak match, and crossovers into the Good , Neutral , and Bad bands.
🟠 HOW TO USE
Add the script to an intraday chart on a liquid instrument and let it run long enough to populate the pools. More history means more stable conditional histograms.
Let SuperTrend define the active regime. The script only scores in the direction of the current trend; bar coloring and take-profit markers respect that regime.
Read the gauge and breakdown table together. The gauge shows the blended level; the table shows which individual axes are pulling it up or down.
Use the right-side profiles as a sanity check. If the dashed current-bin marker is sitting on or near the tallest bar across most axes, the current context closely resembles past pivot contexts in that direction.
Treat high scores as a cue to tighten management, not as reversal signals. A reading of 100 means conditions match where pivots have historically clustered, not that the trend is guaranteed to end.
Adjust the zigzag pivot length to control how strict the pool is. Lower values admit more pivots ( bigger, noisier sample ); higher values keep only firmer pivots ( smaller, cleaner sample ).
Plug your own signal into the custom axis to test whether an existing 0–100 oscillator adds useful conditioning, such as an RSI or a normalised momentum reading. For best results, pick a signal that is not strongly correlated with the three built-ins, so the custom axis adds a new dimension rather than re-stating an existing one.
Enable only the alerts that fit your workflow. The band-crossover alerts fire once per transition , not on every bar inside a band.
🟠 LIMITATIONS
The pool holds every confirmed pivot during a matching-direction run, not only pivots that ended the trend. Intermediate pullbacks sit alongside genuine terminal pivots. Raising the zigzag pivot length filters the pool further if you want a cleaner sample.
On strongly trending symbols the pool is dominated by pullback pivots rather than true terminal exits, because strong trends have many small pullbacks and only one final top or bottom. On choppy symbols the ratio is more balanced. Read the score with this in mind.
The blended score is a density-match measure, not a forward probability . A high reading means today's context is common among past pivots of this direction. It does not predict that the trend is about to end.
The time-of-day axis has no meaning on daily and higher timeframes and is disabled automatically on those timeframes. A warning banner confirms when this is active.
The custom axis requires a source already scaled to 0–100 on every loaded bar. Values outside that range disable the axis and surface a warning. Toggling the custom axis on a live chart starts the range check from the current bar; reload the chart to validate against full loaded history .
Pools are capped at 2000 entries per direction , with the oldest entries dropped first. On very long intraday histories the effective lookback is symbol- and timeframe-dependent.
All scoring uses data up to and including the confirmation bar of each pivot; pivots themselves are detected with the standard zigzag confirmation lag, meaning the scoring population on any given bar reflects pivots confirmed at least zzLen bars earlier.
🟠 CONCLUSION
SuperTrend Take-Profit Dimensions combines a standard SuperTrend with a rolling pool of historical pivot contexts and scores the current bar against that pool across up to four independent axes spanning volume, time, and price. The output is a blended 0–100 favourability reading , a per-axis breakdown, and a set of context profiles that show where past pivots have clustered. It gives trend followers a structured, data-backed way to judge when the current context matches where trends have historically given back profit, without pretending to predict the next bar. Indicator

Statistical Zone Engine [JOAT]Statistical Zone Engine
Introduction
Statistical Zone Engine is an open-source overlay indicator that builds pivot-cluster support and resistance zones with walk-forward statistical scoring. Each zone is backed by a full expected value computation: the indicator counts historical touches and bounces from the zone's price range over a configurable lookback, computes a win rate, and derives an EV score in units of R. Zones are tiered into four strength categories — Weak, Moderate, Strong, and Institutional — based on their live touch count, with border thickness and fill opacity scaling proportionally to the EV and tier. Labels display R:R, win rate, EV, and touch count, all updated live each bar.
The core problem this indicator solves is that conventional support and resistance drawing tools are entirely qualitative — the trader decides what is significant by eye. The SZE replaces that subjective judgment with a quantitative framework: zone strength is computed from actual price behavior over the lookback window, not from the visual prominence of the swing. A zone that has been tested eight times with seven bounces carries an objectively different statistical weight from one that was tested twice with one bounce, and the SZE communicates that difference through its tier system, border rendering, and live EV label. Cluster merging prevents adjacent pivots at nearly the same price from spawning overlapping zones that would misrepresent true strength.
Core Concepts
1. Pivot Cluster Zones
The indicator uses ta.pivothigh and ta.pivotlow with a configurable swing length. When a new pivot high is confirmed and no existing resistance zone is within ATR * clusterTol of the pivot price, a new zone is created. The cluster merge check prevents nearby pivots from generating duplicate zones at the same structural level — if a zone already exists within the tolerance radius, no new zone is spawned. This means zones represent genuinely distinct price levels, not just the most recent pivot above an existing zone.
2. Walk-Forward Expected Value Computation
For each new zone, the indicator scans the prior lookback bars and counts every bar where the high-low range overlapped with the zone. For each touch, it checks whether the close exited the far side of the zone — if so, it counts as a bounce. Win rate = bounces / touches. EV = winRate * tpRR - (1 - winRate) * slRR. A positive EV means the zone has historically resolved in the bounce direction more often than not, weighted by the configured R:R ratio.
3. Four-Tier Strength System
Zone tier is determined by live touch count:
Weak: 1-2 touches — thin border (width 1), low opacity fill
Moderate: 3 touches — medium border (width 1), moderate opacity fill
Strong: 4-5 touches — thicker border (width 2), more opaque fill
Institutional: 6+ touches — widest border (width 3), most opaque fill
Both the border width and the border transparency scale with tier, producing a visual system where the most historically significant zones dominate the chart. The fill opacity also scales with EV — zones with positive EV are more opaque, zones with negative EV are more transparent.
4. Live Label Updates
Each zone carries a label at its right edge displaying: type (RES/SUP), tier name, touch count, win rate percentage, and EV in R units. The label is recalculated and updated every bar when price is inside the zone, ensuring the statistics reflect current behavior. The label text color also scales with tier — more significant zones use brighter text.
5. Sweep Detection
When price closes fully through a zone boundary — above the top for resistance, below the bottom for support — the zone is marked as mitigated. If volume exceeds 1.4x the SMA(20) at the mitigation bar, a BREAK label fires above or below the zone. The total sweep count accumulates in the dashboard. After a break, zone fill fades to near-transparent, clearly communicating that the level has been closed through.
Features
Pivot-Cluster Zone Detection: Swing-pivot based zone creation with ATR-cluster merge deduplication — nearby pivots do not spawn overlapping zones
Walk-Forward EV Computation: Historical touch/bounce counting over configurable lookback produces win rate and R-unit EV scores for each zone
Four-Tier Strength System: Weak / Moderate / Strong / Institutional tiers based on touch count — border width and opacity scale with tier
EV-Scaled Fill Opacity: Positive EV zones are more opaque, negative EV zones are more transparent — fill intensity communicates statistical quality
Live Label Updates: Type, tier, touch count, win rate %, and EV in R units update every bar when price is inside the zone
Sweep Detection with Volume Filter: BREAK label fires on zone close-through when volume exceeds 1.4x SMA(20)
Post-Break Zone Fade: Broken zones fade visually, clearly delineating active versus mitigated levels
Proximity Markers: Diamond plotchar fires when price first enters a zone neighborhood
Min Touches Filter: Only zones with at least the configured minimum historical touches are displayed, eliminating freshly-formed single-touch zones
Zone Trim Management: Oldest zones are removed when arrays exceed the maximum zone count, keeping memory bounded
9-Row Dashboard: Active resistance and support zone counts, near-zone states, total sweep count, TP and SL R:R ratios, ATR
4 Alertconditions: Zone entry for resistance and support, new zone creation for both sides
Input Parameters
Zone Detection:
Swing Length: Pivot confirmation lookback period — higher values detect fewer, more significant pivots (default 10)
Cluster ATR Tolerance: Pivots within ATR * this of an existing zone are merged rather than spawning a new zone (default 0.4)
Zone ATR Width: Half the zone height as an ATR multiple — controls vertical thickness (default 0.35)
Max Active Zones: Maximum concurrent zones per direction before oldest are trimmed (default 12)
Min Touches To Show: Minimum historical touches required to display a zone (default 2)
Statistics:
EV Lookback (bars): Historical bar window for touch/bounce counting (default 200)
TP R:R Ratio: Take-profit distance in R units used for EV calculation (default 2.0)
SL R:R Ratio: Stop-loss distance in R units used for EV calculation (default 1.0)
Visuals:
Toggles for zone labels, sweep labels, and dashboard
Resistance Color (default orange #f97316), Support Color (default sky blue #38bdf8)
How to Use This Indicator
Primary Setup — Statistical Zone Entry:
Look for Institutional or Strong zones with positive EV — these are the levels with the longest bounce history weighted by your R:R parameters. When price enters a zone, the live label shows the current win rate. Enter at the zone edge with a stop beyond the far edge and a target at your TP R:R ratio from entry.
EV as a Selection Filter:
Multiple zones may be on the chart simultaneously. Prioritize zones with positive EV labels (e.g., EV: 1.25R) over zones with negative EV. A zone with 4 touches and 75% win rate at 2R:1R produces an EV of +1.25R per trade — objectively worth trading. A zone with 3 touches and 33% win rate at the same R:R produces EV of -0.33R — not worth trading regardless of how prominent it looks.
Using the Sweep Count:
The total sweep count on the dashboard accumulates every time a zone break is detected with high-volume momentum. Rising sweep counts in one direction indicate the market is consistently breaking through levels on that side — a sign of trending pressure rather than range behavior. Adjust bias accordingly.
Cluster Merge and Fresh Zones:
When a new pivot forms near an existing zone and is merged rather than spawning a new zone, the existing zone's historical statistics remain unchanged. A fresh zone with no historical data will show EV close to 0 — treat these as unproven until more touches accumulate.
Indicator Limitations
EV computation scans up to the full lookback on every qualifying pivot — on very long lookback settings and active pivot instruments, this can increase calculation time
The walk-forward EV uses the same zone size (ATR * width at creation time) for historical counting. If ATR changes significantly between creation time and the historical scan, the touch count may include bars where the equivalent zone boundaries would have been different
Cluster merging uses the current ATR at detection time. In periods of sharply rising or falling ATR, two zones that appear to merge at one ATR level may have been distinct at a different level, potentially underrepresenting zone density
The touch count displayed on the label is the live count updated each bar. The historical bounce count used for EV is computed at creation time and is not re-scanned dynamically — the label win rate reflects creation-time statistics
The minimum touches filter removes zones with fewer historical touches than the threshold. On fresh instruments or small lookbacks, most zones may be filtered out, especially on less-traded timeframes
Originality Statement
This indicator is original in its walk-forward EV scoring framework, four-tier visual strength system driven by live touch counts, and the cluster merging deduplication approach. The publication is justified because:
Walk-forward EV computation in R units provides a quantitative quality signal not found in standard support/resistance tools — each zone is backed by a historically derived expected value, enabling objective zone selection
The four-tier visual system (border width and opacity scaling with tier and EV) embeds the statistical quality directly into the zone appearance, eliminating the need to read labels to gauge significance
ATR-cluster merge deduplication prevents pivot-dense markets from generating overlapping zones at the same structural level, producing a cleaner, more meaningful map than raw pivot-based zone tools
Live label updates during zone interaction show the evolving win rate and EV as each new touch is counted, providing real-time statistical feedback not present in static zone indicators
The post-break fade combined with the total sweep count dashboard provides a structural memory of how many levels have been invalidated, enabling a directional bias gauge derived from zone lifecycle data
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any financial instrument. Past performance of any pattern or signal does not guarantee future results. All trading involves substantial risk. Always use proper risk management and conduct your own independent analysis.
— Made with passion by officialjackofalltrades
Indicator

Crucible Convergence Engine [JOAT]Crucible Convergence Engine
Introduction
The Crucible Convergence Engine is an open-source multi-module convergence strategy that requires alignment across five independent analytical engines before entering a trade. It fuses a Regime Arbiter (market state classification), Directional Helix (trend direction), Pressure Reactor (volume-weighted momentum), Deviation Lattice (statistical band filter), and Fortress Grid (dynamic S/R levels) into a unified convergence scoring system. Entries only fire when all required modules agree — regime confirms a trending state, trend direction aligns, momentum confirms, price is not at a statistical extreme, and volume exceeds its gate threshold. Exits are managed through ATR-based stops and targets, an optional trailing shield, regime flip detection, lattice extreme reversal, and rail interaction exits.
This strategy exists because most trading systems rely on one or two confirmation layers. A moving average crossover with an RSI filter, for example, still enters trades in ranging markets, against macro trends, or at statistical extremes. CCE addresses this by requiring convergence across five fundamentally different analytical dimensions before committing capital. The trade-off is fewer trades — but each trade has multi-dimensional confirmation behind it.
Module Architecture
Module 1: Regime Arbiter
The Regime Arbiter classifies the market into four states using ATR percentile ranking, custom directional movement scoring, and EMA trend alignment:
Kinetic Ascent: ATR percentile above the kinetic threshold, positive directional bias, fast EMA above slow EMA
Kinetic Descent: Same volatility conditions but with negative directional bias
Turbulence: ATR percentile above the turbulence threshold — high volatility without clear direction
Equilibrium: Low volatility, no strong directional bias — ranging market
A two-bar confirmation filter prevents single-bar regime flicker. When the Regime Gate is active (default), the strategy only enters trades during Kinetic Ascent or Kinetic Descent — it sits out during Turbulence and Equilibrium, avoiding the choppy conditions that destroy most trend-following systems.
Module 2: Directional Helix
A fast and slow moving average (EMA or SMA, configurable) determine trend direction. The strategy requires the helix to agree with the regime — a long entry needs both the regime in Kinetic Ascent AND the fast MA above the slow MA.
Module 3: Pressure Reactor
Volume-weighted momentum is calculated using the same logarithmic volume impact function found in the Ferrum Pressure Gauge indicator:
float vwM = pChg * math.log(1 + vR * momVolSens)
float mF = ta.ema(vwM, momFast)
float mS = ta.ema(vwM, momSlow)
float mIdx = ta.ema(mF - mS, 5)
The Pressure Reactor must confirm the trade direction — bullish momentum for longs, bearish momentum for shorts. This ensures that volume-weighted price action supports the entry, not just trend direction.
Module 4: Deviation Lattice
A statistical band system (mean +/- standard deviation * multiplier) acts as an extreme filter. The strategy will NOT enter a long if price is already at or above the upper band (overbought), and will NOT enter a short if price is at or below the lower band (oversold). This prevents chasing extended moves that are statistically likely to revert.
Module 5: Volume Gate
A simple but effective filter requiring short-term volume to exceed a configurable multiple of average volume (default 1.1x). This ensures entries occur during periods of meaningful market participation, not during thin, unreliable conditions.
Convergence Scoring
Each module contributes a weighted score to the overall convergence percentage:
Regime Arbiter: 25 points (trending state confirmed)
Directional Helix: 25 points (trend direction aligned)
Pressure Reactor: 25 points (momentum confirmed)
Deviation Lattice: 15 points (not at statistical extreme)
Volume Gate: 10 points (sufficient market participation)
The convergence score is classified as FULL LOCK (90%+), STRONG (70%+), PARTIAL (50%+), or WEAK (below 50%). The dashboard displays this score in real-time so you can see how close the market is to triggering an entry even before it fires.
Entry conditions require ALL modules to align simultaneously. Entries are edge-triggered — they fire only on the transition from non-convergent to convergent, preventing re-entry on the same signal.
Risk Architecture
ATR Shield (Stop Loss): Initial stop placed at entry price minus ATR * Shield Multiple (default 2.0x ATR). This adapts stop distance to current volatility.
ATR Objective (Take Profit): Target placed at entry price plus ATR * Objective Multiple (default 3.0x ATR). The default 1:1.5 risk-reward ratio (2.0 stop vs 3.0 target) provides positive expectancy even with moderate win rates.
Trailing Shield: When enabled, an ATR-based trailing stop ratchets in the direction of the trade. For longs, the trail is set at close minus ATR * Trail Multiple, and it only moves up, never down. This locks in profits during extended moves.
Regime Flip Exit: If the Regime Arbiter flips to the opposite state (e.g., from Kinetic Ascent to Kinetic Descent while in a long), the position is closed immediately. This is a structural exit — the market environment that justified the entry no longer exists.
Lattice Extreme Exit: If price reaches the opposite statistical extreme (upper band for longs, lower band for shorts), the position is closed. This captures profits at statistically extended levels.
Rail Interaction Exit: If price enters the proximity zone of the opposing Fortress Grid rail (ceiling for longs, floor for shorts), the position is closed. This respects dynamic support/resistance levels.
Strategy Default Properties
These are the default settings used in the strategy's Properties dialog:
Initial Capital: PulseWire default
Order Size: 10% of equity per trade (percent_of_equity)
Pyramiding: 0 (no stacking — one position at a time)
Commission: Not set by default — users should configure realistic commission for their instrument
Slippage: Not set by default — users should add realistic slippage for their instrument
Margin: margin_long=0, margin_short=0 (v5-equivalent behavior)
Calc on Every Tick: false (confirmed bars only)
Process Orders on Close: true
Important: Users should set realistic commission AND slippage values in the strategy Properties before evaluating backtest results. The default results without commission/slippage will overstate performance. A commission of 0.04-0.1% per side and 1-3 ticks of slippage is reasonable for most liquid instruments.
Command Panel (Dashboard)
A 13-row monospace dashboard displays the complete strategy state:
SCORE: Convergence classification with percentage (FULL LOCK / STRONG / PARTIAL / WEAK)
REGIME: Current market state (Kinetic Ascent, Kinetic Descent, Turbulence, Equilibrium)
HELIX: Trend direction (Ascent / Descent)
PRESSURE: Momentum direction (Ascent / Descent)
LATTICE: Band filter state (Clear / Ceiling Hit / Floor Hit)
Z-SCORE: Current statistical deviation from mean
VOL GATE: Volume gate status with current ratio (Open / Closed)
POSITION: Current trade status (Long / Short / Flat)
AGE: Bars since entry
SHIELD: Current ATR-based stop distance
TRAIL: Current trailing stop price (if active)
DIR BIAS: Raw directional movement bias score
Input Parameters
Regime Arbiter:
Dispersion Epoch / Rank Horizon / Kinetic Threshold / Turbulence Threshold / Regime Gate Active
Directional Helix:
Lead Filament / Anchor Filament / Filament Type (EMA or SMA)
Pressure Reactor:
Ignition Cycle / Sustain Cycle / Flux Epoch / Flux Amplifier
Deviation Lattice:
Lattice Depth / Sigma Aperture / Lattice Extreme Exit toggle
Fortress Grid:
Grid Anchor / Grid Increment / Proximity Radius / Rail Interaction Exit toggle
Risk Architecture:
Shield Multiple (stop) / Objective Multiple (target) / Risk Epoch (ATR period) / Trailing Shield toggle / Trail Multiple
Volume Gate:
Require Volume Confirmation / Volume Gate Threshold
How to Use This Strategy
Start by setting realistic commission and slippage in the strategy Properties before evaluating any backtest results.
Adjust the Grid Increment in the Fortress Grid module to match your instrument (500-1000 for BTC, 50-100 for stocks, etc.).
Monitor the Convergence Score in the dashboard — it shows how close the market is to triggering an entry. STRONG readings (70%+) that haven't yet reached FULL LOCK often precede entries by a few bars.
The Regime Gate is the most impactful filter. Disabling it will produce more trades but in lower-quality market conditions. Keep it enabled unless you have a specific reason to trade ranging/volatile markets.
Experiment with the Shield and Objective multiples to find the risk-reward ratio that matches your trading style. Higher Objective multiples produce fewer but larger winners; lower multiples produce more frequent but smaller wins.
The Trailing Shield is most valuable in trending markets where moves extend beyond the initial target. In choppy markets, it may give back profits. Consider disabling it if the instrument tends to mean-revert quickly.
Limitations and Honest Assessment
Multi-module convergence produces fewer trades. On some instruments and timeframes, the strategy may go extended periods without a signal. This is by design — it prioritizes quality over quantity.
Backtest results are hypothetical and do not account for real-world execution challenges including partial fills, requotes, and market impact.
The strategy uses process_orders_on_close=true, which means orders execute at the close of the signal bar. In live trading, you would need to enter at the open of the next bar, which introduces slippage.
Past performance shown in backtests does not guarantee future results. Market conditions change, and strategies that worked historically may underperform in different regimes.
The default settings are not optimized for any specific instrument or timeframe. Users should test across multiple datasets and adjust parameters to their specific use case.
The Regime Arbiter and all other modules use lagging indicators. Entries will always occur after a trend has begun, not at the exact bottom or top.
No strategy works in all market conditions. CCE is designed for trending markets and will underperform during extended ranging or highly volatile periods.
Originality Statement
This strategy is original in its five-module convergence architecture. While individual components (ATR regime classification, MA crossovers, volume-weighted momentum, statistical bands, EMA-derived levels) are established concepts, CCE is justified because:
The five-module convergence scoring system requires alignment across fundamentally different analytical dimensions (volatility regime, trend, momentum, statistics, structure) before entering — a more rigorous entry filter than typical dual-confirmation systems.
The weighted convergence score provides a quantified readiness metric that communicates how close the market is to a valid entry, even when not all conditions are met.
Four distinct exit mechanisms (ATR stop/target, trailing shield, regime flip, lattice extreme, rail interaction) provide layered risk management that adapts to different exit scenarios.
The Regime Arbiter gate prevents trading during Turbulence and Equilibrium states, addressing the primary failure mode of trend-following strategies.
Edge-triggered entries with two-bar regime confirmation prevent re-entry on the same signal and eliminate single-bar flicker.
The comprehensive 13-row dashboard provides full transparency into every module's state, the convergence score, and the current risk parameters.
Disclaimer
This strategy is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors. Backtest results are hypothetical, do not represent actual trading, and do not guarantee future performance. Past results in no way guarantee future results. Commission, slippage, and other real-world costs will reduce actual performance below what backtests show. Always use proper risk management, including position sizing appropriate for your account and risk tolerance. Never risk more than you can afford to lose. The author is not responsible for any losses incurred from using this strategy.
-Made with passion by officialjackofalltrades
Strategy

Caldera Deviation Cloud [JOAT]Caldera Deviation Cloud
Introduction
The Caldera Deviation Cloud is an open-source statistical deviation band system that fuses anchored VWAP with Z-score adaptive band widths, Keltner ATR blending, and higher-timeframe volatility expansion into a unified probability envelope overlay. Instead of using a single method to calculate band width, CDC triple-blends VWAP standard deviation, statistical standard deviation, and ATR-based Keltner width — whichever produces the widest reading dominates, ensuring the bands never underestimate true market dispersion. The result is a layered cloud with inner (1-sigma, ~68% probability) and outer (2-sigma, ~95% probability) envelopes that adapt to both local and macro volatility conditions.
What makes this indicator distinct from standard Bollinger Bands or VWAP bands is the fusion approach: it does not rely on a single deviation method. It also reverse-engineers historical Z-score reversal points into dynamic "fossil" support and resistance levels — price zones where statistical extremes have historically triggered reversals.
Core Engine: Adaptive Deviation Fusion
The band width calculation blends three independent deviation measurements:
float baseAdapt = na(vwapStdev) or vwapStdev <= 0 ? statDev : math.max(vwapStdev, statDev * 0.5)
float keltBlend = useKelt ? math.max(baseAdapt, keltW * 0.6) : baseAdapt
float adaptDev = keltBlend * macroMult
VWAP Standard Deviation: Derived from the anchored VWAP calculation (session, weekly, monthly, or quarterly reset). This captures volume-weighted price dispersion around the institutional fair value line.
Statistical Standard Deviation: Classic standard deviation of closing prices over a configurable lookback (default 100 bars). This provides a pure statistical measure of price dispersion.
Keltner Thermal Envelope: ATR-based width (EMA of close with ATR multiplier) that captures range-based volatility. When enabled, this prevents the bands from being too narrow during periods where price moves are large but close-to-close deviation is small.
The wider of these three measurements is used as the base deviation, then multiplied by a macro volatility factor derived from the higher timeframe.
Probability Lattice (Z-Score Engine)
The Z-score engine computes how many standard deviations price is from its statistical mean, then smooths the result with VWMA for visual clarity:
Z-Score: (close - SMA) / StdDev, smoothed with VWMA
Mean Reversion Velocity: The rate of change of the Z-score, classified as EXPANDING (moving away from mean), CONTRACTING (returning toward mean), or STALLED
Dynamic State: SHELL BREACH OB/OS (beyond historical reversal averages), ELEVATED/DEPRESSED (beyond 1 sigma), or EQUILIBRIUM (near mean)
Reversal Archaeology (Fossil Levels)
This is one of CDC's most distinctive features. The indicator detects Z-score pivot highs and pivot lows, filters them by a minimum threshold (default 1.5 sigma), and accumulates them into rolling arrays. The average of these historical reversal Z-scores is then reverse-engineered back into price levels:
Fossil Resistance = VWMA(Mean + AvgTopReversalZ * StdDev)
Fossil Support = VWMA(Mean + AvgBotReversalZ * StdDev)
These "fossil levels" represent the price zones where, on average, the market has historically found statistical extremes significant enough to trigger reversals. They shift dynamically as new reversal data accumulates and old data rolls off.
Macro Volatility Lens (HTF Expansion)
When enabled, the indicator fetches standard deviation data from a higher timeframe (default 60-minute) and compares it to its own EMA. When macro volatility exceeds its average, the bands widen proportionally:
macroMult = 1 + htfFactor * max(0, (htfStdev - htfAvgDev) / htfAvgDev)
This prevents the bands from being too tight during periods of elevated macro uncertainty, even if the local timeframe appears calm. The security calls use lookahead=off to prevent repainting.
Visual Elements
Equilibrium Spine: The VWMA-smoothed center line (VWAP or statistical mean), plotted as a prominent purple line representing fair value.
Core Envelope (Inner Bands): 1-sigma bands representing the ~68% probability zone. Color shifts dynamically based on price position within the cloud using color.from_gradient.
Shell Envelope (Outer Bands): 2-sigma bands representing the ~95% probability zone. Price beyond these levels is statistically extreme.
Nebula Gradient: A 10-layer gradient fill system creates a smooth visual transition from the spine outward through the core and shell envelopes. Upper layers use distribution (bearish) tones, lower layers use accumulation (bullish) tones.
Fossil Levels: Cross-style plots marking the reverse-engineered support and resistance from Z-score reversal history.
Signal Architecture
CDC generates four signal types, all confirmed-bar only:
SHELL BREACH: Price exceeds the outer (2-sigma) envelope — a statistically extreme event. Upper breach suggests distribution extreme, lower breach suggests accumulation extreme. Tooltip includes the sigma multiplier and current Z-score.
CORE DRIFT: Price enters the zone between the inner and outer envelopes — elevated deviation but not yet extreme. This serves as an early warning before a potential shell breach.
Command Panel (Dashboard)
A 10-row monospace dashboard displays:
LATTICE: Current smoothed Z-score value
STATE: Statistical classification (Shell Breach OB/OS, Elevated, Depressed, Equilibrium)
REV VEL: Mean reversion velocity direction (Expanding, Contracting, Stalled)
SPINE: Current center line (VWAP/mean) price
APERTURE: Current adaptive deviation width
MACRO: HTF volatility multiplier (1.0x = normal, >1.1x = elevated macro vol)
POSITION: Price location within the cloud (Upper Shell, Upper Core, Neutral, Lower Core, Lower Shell)
FOSSIL R / FOSSIL S: Average Z-score at which historical reversals have occurred (resistance and support)
Input Parameters
Probability Lattice:
Lattice Depth: Z-score lookback window (default 100)
Lattice Damper: VWMA smoothing on raw Z-score (default 14)
Sigma Core: Inner band multiplier, ~68% probability (default 1.0)
Sigma Shell: Outer band multiplier, ~95% probability (default 2.0)
Anchor Nexus:
Volume Epoch: VWAP reset period — Session, Weekly, Monthly, or Quarterly
Keltner Fusion:
Enable Thermal Envelope: Toggle ATR-based width blending (default on)
Thermal EMA / ATR Scale: Keltner channel parameters
Macro Volatility Lens:
Enable Horizon Expansion: Toggle HTF volatility widening (default on)
Horizon Timeframe / Blend Factor: HTF parameters
Reversal Archaeology:
Fossil Depth: Rolling array size for reversal history (default 25)
Fossil Threshold: Minimum Z-score magnitude for valid reversal (default 1.5)
How to Use This Indicator
Use the cloud as a probability envelope — price spending time near the outer shell is statistically unusual and often precedes mean reversion.
Watch SHELL BREACH signals at the outer bands for potential reversal setups, especially when the Reversion Velocity shows CONTRACTING (Z-score returning toward mean).
Fossil levels provide dynamic support/resistance derived from statistical history — they shift as new reversal data accumulates, making them adaptive rather than static.
The MACRO multiplier in the dashboard warns when higher-timeframe volatility is elevated — wider bands during these periods reflect genuine uncertainty, not just noise.
CORE DRIFT signals serve as early warnings — price entering the core-to-shell zone may continue to the shell or reverse. Use them as alerts to pay attention, not as standalone trade signals.
The Equilibrium Spine (center line) acts as a dynamic fair value reference — extended moves away from it tend to revert over time.
Limitations
Statistical bands assume roughly normal price distributions, which markets frequently violate. Fat tails and gap events can exceed even the outer shell without warning.
Z-score mean reversion is a tendency, not a guarantee — price can remain at statistical extremes for extended periods, especially during strong trends.
Fossil levels are based on historical reversal averages and may not predict future reversal points accurately. They provide context, not certainty.
The VWAP anchor resets at each period boundary (session, week, etc.), which can cause discontinuities in the center line and bands.
Higher-timeframe volatility expansion depends on the selected HTF — different choices produce different macro multipliers.
The indicator does not generate directional buy/sell signals — it provides statistical context for your own decision-making.
Originality Statement
This indicator is original in its triple-blend adaptive deviation approach. While VWAP bands, Bollinger Bands, and Keltner Channels are established concepts individually, CDC is justified because:
The triple-blend deviation fusion (VWAP stdev + statistical stdev + Keltner ATR) ensures bands never underestimate dispersion regardless of which volatility measure is dominant.
Reversal Archaeology reverse-engineers Z-score pivot history into dynamic price levels — a technique not found in standard deviation band indicators.
The Macro Volatility Lens integrates higher-timeframe volatility directly into band width calculation, providing macro-aware probability envelopes.
The 10-layer nebula gradient fill creates a visual probability density that communicates statistical significance through color intensity.
Mean Reversion Velocity tracking provides directional context for Z-score movement, helping distinguish between expanding extremes and contracting reversals.
The comprehensive dashboard presents statistical state, reversion dynamics, and fossil levels simultaneously.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Statistical deviation bands describe historical price distribution patterns but do not predict future price movement. Extreme Z-scores do not guarantee reversals. Always use proper risk management and conduct your own analysis before making trading decisions. The author is not responsible for any losses incurred from using this tool.
-Made with passion by officialjackofalltrades
Indicator

Indicator

Linear Regression Channel With Pearson's R (Multi Sigma & MTF)This indicator applies multi‑sigma linear regression across multiple institutional time horizons to quantify the line of best fit in equities and index markets. By combining multi‑timeframe presets with statistically derived deviation bands, it highlights trend structure, volatility expansion, and regime transitions with clarity.
What’s New in This Update
The original version of the indicator produced a linear regression channel with multiple deviation bands. However, the statistical values it displayed were not mathematically valid. The value labeled “r” was not Pearson’s correlation coefficient and could not be used to derive R² or any formal regression diagnostics.
This update introduces a fully correct statistical engine based on ordinary least squares (OLS).
NEW STATISTICAL OUTPUTS
• True Pearson’s r
• True R² (coefficient of determination)
• RSS (Residual Sum of Squares)
• TSS (Total Sum of Squares)
These values are mathematically valid, bounded, and directly tied to the regression line.
KEY IMPROVEMENTS
• Correct OLS intercept (removes the erroneous +slope term)
• Proper predicted values using ŷ = b₀ + b₁x
• Correct centering around the actual mean of the data
• Removal of correlation logic from the deviation engine
• Clean separation between statistical computation and volatility computation
• Regression channel visuals remain identical, but the underlying math is now fully accurate
These changes ensure that r and R² reflect true trend strength and model fit, enabling more reliable interpretation of long‑term and short‑term trend regimes.
CORE FEATURES (UNCHANGED)
• Auto‑Multi‑Timeframe presets aligned with institutional trend horizons
• Multi‑Sigma bands (+/‑1σ, +/‑2σ, +/‑3σ) for volatility structure and statistical extremes
• True least‑squares regression recalculated each bar
• Deviation mode toggle (Standard Deviation vs. Max Deviation)
• Full documentation and institutional use‑case examples available on GitHub
More information can be found here:
github.com Indicator

Linear Regression Channel with Multi Sigma and Multi Time FrameThis indicator applies multi-sigma linear regression across multiple institutional time horizons to quantify the line of best fit in equities and index markets. By combining multi-timeframe presets with statistically derived deviation bands, it highlights trend structure, volatility expansion, and regime transitions with clarity.
Features
Auto-Multi-Timeframe presets map directly to institutional trend horizons (daily, weekly, monthly) for accurate regime detection.
Multi-Sigma bands (+/-1, +/-2, +/-3) reveal volatility structure, trend strength, and statistical extremes.
The regression line uses a true least-squares calculation, recalculated each bar for precise trend alignment.
Deviation mode allows switching between standard deviation and max deviation to support different volatility models.
A linked PDF on GitHub provides full documentation, derivations, and institutional use-case examples.
More Information Can Be Found Here:
github.com Indicator

Indicator

Indicator

Central Limit Theorem Reversion IndicatorDear TV community, let me introduce you to the first-ever Central Limit Theorem indicator on PulseWire.
The Central Limit Theorem is used in statistics and it can be quite useful in quant trading and understanding market behaviors.
In short, the CLT states: "When you take repeated samples from any population and calculate their averages, those averages will form a normal (bell curve) distribution—no matter what the original data looks like."
In this CLT indicator, I use statistical theory to identify high-probability mean reversion opportunities in the markets. It calculates statistical confidence bands and z-scores to identify when price movements deviate significantly from their expected distribution, signaling potential reversion opportunities with quantifiable probability levels.
Mathematical Foundation
The Central Limit Theorem (CLT) says that when you average many data points together, those averages will form a predictable bell-curve pattern, even if the original data is completely random and unpredictable (which often is in the markets). This works no matter what you're measuring, and it gets more reliable as you use more data points.
Why using it for trading?
Individual price movements seem random and chaotic, but when we look at the average of many price movements, we can actually predict how they should behave statistically. This lets us spot when prices have moved "too far" from what's normal—and those extreme moves tend to snap back (mean reversion).
Key Formula:
Z = (X̄ - μ) / (σ / √n)
Where:
- X̄ = Sample mean (average return over n periods)
- μ = Population mean (long-term expected return)
- σ = Population standard deviation (volatility)
- n = Sample size
- σ/√n = Standard error of the mean
How I Apply CLT
Step 1: Calculate Returns
Measures how much price changed from one bar to the next (using logarithms for better statistical properties)
Step 2: Average Recent Returns
Takes the average of the last n returns (e.g., last 100 bars). This is your "sample mean."
Step 3: Find What's "Normal"
Looks at historical data to determine: a) What the typical average return should be (the long-term mean) and b) How volatile the market usually is (standard deviation)
Step 4: Calculate Standard Error
Determines how much sample averages naturally vary. Larger samples = smaller expected variation.
Step 5: Calculate Z-Score
Measures how unusual the current situation is.
Step 6: Draw Confidence Bands
Converts these statistical boundaries into actual price levels on your chart, showing where price is statistically expected to stay 95% and 99% of the time.
Interpretation & Usage
The Z-Score:
The z-score tells you how statistically unusual the current price deviation is:
|Z| < 1.0 → Normal behavior, no action
|Z| = 1.0 to 1.96 → Moderate deviation, watch closely
|Z| = 1.96 to 2.58 → Significant deviation (95%+), consider entry
|Z| > 2.58 → Extreme deviation (99%+), high probability setup
The Confidence Bands
- Upper Red Bands: 95% and 99% overbought zones → Expect mean reversion downward as the price is not likely to cross these lines.
- Center Gray Line: Statistical expectation (fair value)
- Lower Blue Bands: 95% and 99% oversold zones → Expect mean reversion upward
Trading Logic:
- When price exceeds the upper 95% band (z-score > +1.96), there's only a 5% probability this is random noise → Strong sell/short signal
- When price falls below the lower 95% band (z-score < -1.96), there's a 95% statistical expectation of upward reversion → Strong buy/long signal
Background Gradient
The background color provides real-time visual feedback:
- Blue shades: Oversold conditions, expect upward reversion
- Red shades: Overbought conditions, expect downward reversion
- Intensity: Darker colors indicate stronger statistical significance
Trading Strategy Examples
Hypothetically, this is how the indicator could be used:
- Long: Z-score < -1.96 (below 95% confidence band)
- Short: Z-score > +1.96 (above 95% confidence band)
- Take profit when price returns to center line (Z ≈ 0)
Input Parameters
Sample Size (n) - Default: 100
Lookback Period (m) - Default: 100
You can also create alerts based on the indicator.
Final notes:
- The indicator uses logarithmic returns for better statistical properties
- Converts statistical bands back to price space for practical use
- Adaptive volatility: Bands automatically widen in high volatility, narrow in low volatility
- No repainting: yay! All calculations use historical data only
Feedback is more than welcome!
Henri Indicator

Indicator

Markov 3D Trend AnalyzerMarkov 3D Trend Analyzer
🔹 What Is a Markov State?
A Markov chain models systems as states with probabilities of transitioning from one state to another. The key property is memorylessness: the next state depends only on the current state, not the full past history. In financial markets, this allows us to study how conditions tend to persist or flip — for example, whether a green candle is more likely to be followed by another green or by a red.
🔹 How This Indicator Uses It
The Markov 3D Trend Analyzer tracks three independent Markov chains:
Direction Chain (short-term): Probability that a green/red candle continues or reverses.
Volatility Chain (mid-term): Probability of volatility staying Low/Medium/High or transitioning between them.
Momentum Chain (structural): Probability of momentum (Bullish, Neutral, Bearish) persisting or flipping.
Each chain is updated dynamically using exponentially weighted probabilities (EMA), which balance the law of large numbers (stability) with adaptivity to new market conditions.
The indicator then classifies each chain’s dominant state and combines them into an actionable summary at the bottom of the table (e.g. “📈 Bullish breakout,” “⚠️ Choppy bearish fakeouts,” “⏳ Trend squeeze / possible reversal”).
🔹 Settings
Direction Lookback / Volatility Lookback / Momentum Lookback
Control the rolling window length (sample size) for each chain. Larger = smoother but slower to adapt.
EMA Weight
Adjusts how much weight is given to recent transitions vs. older history. Lower values adapt faster, higher values stabilize.
Table Position
Choose where the table is displayed on your chart.
Table Size
Adjust the font size for readability.
🔹 How To Consider Using
Contextual tool: Use the summary row to understand the current market condition (trending, mean-reverting, expanding, compressing, continuation, fakeout risk).
Complementary filter: Combine with your existing strategies to confirm or filter signals. For example:
📈 If your breakout strategy fires and the summary says Bullish breakout, that’s confirmation.
⚠️ If it says Choppy fakeouts, be cautious of traps.
Visualization aid: The table lets you see how probabilities shift across direction, volatility, and momentum simultaneously.
⚠️ This indicator is not a signal generator. It is designed to help interpret market states probabilistically. Always use in conjunction with broader analysis and risk management.
🔹 Disclaimer
This script is for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any security, cryptocurrency, or instrument. Trading involves risk, and past probabilities or behaviors do not guarantee future outcomes. Always conduct your own research and use proper risk management. Indicator

HTF Current/Average RangeThe "HTF(Higher Timeframe) Current/Average Range" indicator calculates and displays the current and average price ranges across multiple timeframes, including daily, weekly, monthly, 4 hour, and user-defined custom timeframes.
Users can customize the lookback period, table size, timeframe, and font color; with the indicator efficiently updating on the final bar to optimize performance.
When the current range surpasses the average range for a given timeframe, the corresponding table cell is highlighted in green, indicating potential maximum price expansion and signaling the possibility of an impending retracement or consolidation.
For day trading strategies, the daily average range can serve as a guide, allowing traders to hold positions until the current daily range approaches or meets the average range, at which point exiting the trade may be considered.
For scalping strategies, the 15min and 5min average range can be utilized to determine optimal holding periods for fast trades.
Other strategies:
Intraday Trading - 1h and 4h Average Range
Swing Trading - Monthly Average Range
Short-term Trading - Weekly Average Range
Also using these statistics in accordance with Power 3 ICT concepts, will assist in holding trades to their statistical average range of the chosen HTF candle.
CODE
The core functionality lies in the data retrieval and table population sections.
The request.security function (e.g., = request.security(syminfo.tickerid, "D", , lookahead = barmerge.lookahead_off)) retrieves high and low prices from specified timeframes without lookahead bias, ensuring accurate historical data.
These values are used to compute current ranges and average ranges (ta.sma(high - low, avgLength)), which are then displayed in a dynamically generated table starting at (if barstate.islast) using table.new, with conditional green highlighting when the current range is greater than average range, providing a clear visual cue for volatility analysis.
Indicator

Price Statistical Strategy-Z Score V 1.01
Price Statistical Strategy – Z Score V 1.01
Overview
A technical breakdown of the logic and components of the “Price Statistical Strategy – Z Score V 1.01”.
This script implements a smoothed Z-Score crossover mechanism applied to the closing price to detect potential statistical deviations from local price mean. The strategy operates solely on price data (close) and includes signal spacing control and momentum-based candle filters. No volume-based or trend-detection components are included.
Core Methodology
The strategy is built on the statistical concept of Z-Score, which quantifies how far a value (closing price) is from its recent average, normalized by standard deviation. Two moving averages of the raw Z-Score are calculated: a short-term and a long-term smoothed version. The crossover between them generates long entries and exits.
Signal Conditions
Entry Condition:
A long position is opened when the short-term smoothed Z-Score crosses above the long-term smoothed Z-Score, and additional entry conditions are met.
Exit Condition:
The position is closed when the short-term Z-Score crosses below the long-term Z-Score, provided the exit conditions allow.
Signal Gapping:
A minimum number of bars (Bars gap between identical signals) must pass between repeated entry or exit signals to reduce noise.
Momentum Filter:
Entries are prevented during sequences of three or more consecutively bullish candles, and exits are prevented during three or more consecutively bearish candles.
Z-Score Function
The Z-Score is calculated as:
Z = (Close - SMA(Close, N)) / STDEV(Close, N)
Where N is the base period selected by the user.
Input Parameters
Enable Smoothed Z-Score Strategy
Enables or disables the Z-Score strategy logic. When disabled, no trades are executed.
Z-Score Base Period
Defines the number of bars used to calculate the simple moving average and standard deviation for the Z-Score. This value affects how responsive the raw Z-Score is to price changes.
Short-Term Smoothing
Sets the smoothing window for the short-term Z-Score. Higher values produce smoother short-term signals, reducing sensitivity to short-term volatility.
Long-Term Smoothing
Sets the smoothing window for the long-term Z-Score, which acts as the reference line in the crossover logic.
Bars gap between identical signals
Minimum number of bars that must pass before another signal of the same type (entry or exit) is allowed. This helps reduce redundant or overly frequent signals.
Trade Visualization Table
A table positioned at the bottom-right displays live PnL for open trades:
Entry Price
Unrealized PnL %
Text colors adapt based on whether unrealized profit is positive, negative, or neutral.
Technical Notes
This strategy uses only close prices — no trend indicators or volume components are applied.
All calculations are based on simple moving averages and standard deviation over user-defined windows.
Designed as a minimal, isolated Z-Score engine without confirmation filters or multi-factor triggers.
Strategy
