CCI Divergence Volume Breakout [josseliani]CCI Divergence Volume Breakout combines confirmed CCI divergence with a relative-volume candle level. It waits for a confirmed close beyond that candle's high or low before displaying a BUY or SELL signal, and it can optionally map Entry, a volume-candle-based stop, 1R, and historical R-reach statistics.
The default settings are tuned for XAUUSD on the 7-minute chart, but the indicator can be adapted to other instruments and timeframes. The statistics dashboard updates for the current symbol, timeframe, loaded chart history, and selected inputs, making it easy to see how different settings affect the sample size and historical R-reach rates.
→ HOW I USE IT
The default settings are the configuration I currently use for XAUUSD on the 7-minute chart.
Seven minutes is the favorite timeframe of my wonderful wave-analysis teacher. I built this version around the way he studies the market: first CCI divergence, then a meaningful volume spike. After that, he moves on to his own wave-analysis methods, including trendlines, wave count, structure, and broader market context. This indicator does not reproduce or replace his complete method. I use it as a supporting tool within my own wave analysis.
With the default settings, the script first searches for a confirmed CCI divergence. It then selects a qualifying volume candle connected to that divergence. The first search covers the divergence span; if necessary, it checks the area around the second pivot and then watches the post-confirmation candidate window. A qualifying candle must have volume of at least 1.5 times its 20-bar average.
For a bullish divergence, the high of the selected volume candle becomes the confirmation level. A BUY signal appears only after a candle closes above that high within the permitted breakout window.
For a bearish divergence, the low of the selected volume candle becomes the confirmation level. A SELL signal appears only after a candle closes below that low within the permitted breakout window.
The optional trade map starts from the open of the candle after the signal. It displays an Entry line, a stop behind the opposite edge of the exact volume candle plus the selected ATR delta, and a 1R reference target.
I use the dashboard to compare configurations rather than to treat one historical percentage as a promise. For example, changing the minimum volume multiple, pivot-matching radius, maximum distance between pivots, candidate-search window, or breakout window changes how often historical observations reached 0.5R, 1R, 2R, and 3R. This helps me see the trade-off between signal selectivity and historical excursion.
→ HOW THE INDICATOR WORKS
→ 1. Automatic CCI pivot scan
The script evaluates confirmed CCI pivots using strengths 3, 5, 7, and 9. The first pivot must be beyond the selected extreme threshold. The second pivot may form closer to the center of the oscillator.
A bullish divergence requires price to form a lower low while CCI forms a higher low. A bearish divergence requires price to form a higher high while CCI forms a lower high.
CCI pivots require bars on the right to become confirmed. For that reason, divergence lines are anchored to their historical pivot candles only after confirmation. They do not represent information that was available on the original pivot candle. BUY and SELL signals are evaluated only on confirmed closes after the divergence has been confirmed.
→ 2. Price-pivot matching
CCI and price do not always turn on exactly the same candle. Price Pivot Match Radius searches on both sides of each CCI endpoint for the corresponding price high or low.
Maximum Price/CCI Span Difference then checks that the two price pivots and the two CCI pivots describe approximately the same market swing. Lower values require tighter alignment; higher values allow more flexibility.
→ 3. Relative-volume candle selection
When a divergence becomes confirmed, the script first searches its pivot-to-pivot span for qualifying volume candles and selects the qualifying candle with the greatest reported volume. If that search finds none, it also checks the area around the second pivot. Search After Divergence then defines how many new bars after confirmation may supply a qualifying candidate. Volume is measured relative to its moving average:
Relative volume = candle volume / average volume
The default requirement is 1.5 times the 20-bar average. Candle direction is not used. For a bullish setup, the selected candle's high becomes the level. For a bearish setup, its low becomes the level.
Maximum Candidates controls how many qualifying volume levels one divergence may create. You can use up to three qualifying volume-candle candidates for each confirmed divergence. The default is one to keep the chart and signal source unambiguous. With this default, an already selected historical candidate fills the single slot; otherwise, the first qualifying post-confirmation candidate can fill it.
→ 4. Breakout confirmation and signal window
The volume level begins as gray. It changes to the bullish or bearish color only when price closes beyond it on a confirmed candle:
Bullish divergence: confirmed close above the selected volume candle's high.
Bearish divergence: confirmed close below the selected volume candle's low.
Breakout Signal Window defines how many bars that exact volume level is permitted to produce a BUY or SELL signal. The count begins when the level is created. Once the window expires, the level cannot trigger a late signal and cannot add a late observation to the statistics.
→ 5. Expired levels
Keep Expired Levels Visible separates signal validity from visual analysis.
When it is enabled, an unbroken level continues as a gray reference after its signal window expires. The expired line is visual only: it cannot produce a BUY or SELL signal and is not reactivated by a new calendar day, exchange day, or session. It remains visible until a newer qualifying volume level replaces it.
When Keep Expired Levels Visible is disabled, the gray line ends when its breakout signal window expires.
This indicator does not carry or re-arm levels according to a calendar boundary or timezone.
→ OPTIONAL TRADE MAP
The trade map is a visual measurement tool, not an automated order-placement system.
Entry: open of the candle following the confirmed BUY or SELL signal.
Stop: opposite edge of the exact volume candle that produced the signal, plus the selected ATR delta.
1R: one initial-risk unit from Entry.
The map helps compare the signal with the user's own execution, market structure, and risk plan. It is not financial advice and does not account for spread, slippage, commissions, or individual position sizing.
→ STATISTICS DASHBOARD
The dashboard reports historical reach rates for the current symbol, timeframe, loaded chart history, and selected inputs. It is designed for configuration comparison.
Completed: observations that reached the stop, reached 3R, or reached the maximum evaluation window.
Reached >=0.5R: completed observations whose maximum favorable excursion reached at least half of the initial risk.
Win Rate >=1R: completed observations that reached at least 1R before the stop.
Reached >=2R / >=3R: completed observations that reached those excursion levels before the stop.
Average MFE: average maximum favorable excursion, expressed in R, across completed observations.
Active / Invalid: observations still being evaluated and observations rejected because a valid positive risk distance could not be constructed.
Only breakouts confirmed while their volume level is inside its active signal window create statistical observations. An expired gray reference does not create a trade in the dashboard.
If the stop and a target fall inside the same historical candle, the script gives the stop priority because OHLC data cannot reveal the intrabar sequence. This is intentionally conservative.
These figures are descriptive historical measurements, not a backtest equity curve, not a profit factor, and not a forecast of future results. They can change with the data provider, symbol, timeframe, available history, and settings.
→ DEFAULT XAUUSD 7-MINUTE PRESET
CCI Length: 20
CCI Source: Typical Price (HLC3)
First Pivot Extreme Level: +/-150
Maximum Bars Between Pivots: 60
Price Pivot Match Radius: 7
Maximum Price/CCI Span Difference: 35%
Volume Average Length: 20
Minimum Volume x Average: 1.5
Search After Divergence: 15 bars
Maximum Candidates per Divergence: 1
Breakout Signal Window: 40 bars
Keep Expired Levels Visible: On
Show Entry / SL / 1R Markup: On
→ ALERTS
Bullish CCI Divergence: fires when a bullish divergence becomes confirmed.
Bearish CCI Divergence: fires when a bearish divergence becomes confirmed.
CCI Volume Long Signal: fires after a confirmed close above an active bullish volume level.
CCI Volume Short Signal: fires after a confirmed close below an active bearish volume level.
→ ORIGINALITY
This script is not a standard CCI divergence plot and not a generic volume-spike marker. Its purpose is to connect four separate stages in one workflow: multi-strength confirmed CCI divergence, price-pivot alignment, relative-volume candle mapping, and close-confirmed breakout authorization.
Candidate search, signal lifetime, visual reference lifetime, trade measurement, and historical R-reach analysis are kept separate. This makes it possible to change one part of the workflow and see how it affects signal frequency and the historical statistics without confusing an expired visual level with an active signal source.
→ LIMITATIONS
CCI, volume, and divergence are analytical tools, not guarantees of reversal or continuation. Pivot confirmation introduces an intentional delay. Historical volume and results can differ between data providers. Signals should be evaluated with market structure, liquidity, volatility, wave context, and personal risk management. The default preset was developed for how I analyze XAUUSD on 7 minutes; other markets and timeframes require independent testing.
Indicateur

IPDA Year Map (M1D)IPDA Year Map draws the window the Interbank Price Delivery Algorithm is said to reference — the 20, 40 and 60 day look-back highs and lows — and puts it on a year of quarterly dividers rather than on a rolling snapshot. Every level carries how many sessions it has left before the candle that set it ages out of that window and stops being a reference at all.
The idea it implements is simple and it is the reason for every design decision below. The algorithm does not see a chart. It references days as data points inside a fixed look-back, and once a level falls outside 60 trading days it is purged. So the useful questions are which levels are still inside the window, where in the window they sit, and when each one leaves. Most range tools answer the first. This one answers all three.
The data range
Three nested look-backs, computed on daily closes: 20 days for the near-term read, 40 for the intermediate, 60 as the outer edge of what is still referenced. Each contributes its high and its low, drawn from the candle that actually set it and running forward to the current bar. Six extremes, and that is the whole object — the script does not go hunting for additional pools, order blocks or gaps to decorate it with.
The levels come from the daily timeframe regardless of what the chart is showing, so a 60-day window exists on a 1 minute chart where only a fortnight of chart candles is loaded.
Each level's origin is found from the offset back to the extreme candle, not from watching the value change. Those are different things and the difference is visible. A rolling minimum moves for two reasons: a lower low prints, or an older and deeper low ages out of the window and the minimum steps up to whatever is left. Only the first is a candle forming a level. Anchoring on "the value changed" attaches the line to the day the old low expired, which can be months after the candle that actually set the price.
One price is one line
A high made inside the last 20 sessions is simultaneously the 20, 40 and 60 day high. Drawn as three separate levels that is three lines and three captions stacked on a single row of pixels, and the top of the chart reads as one anonymous level while the lows — which genuinely differ — read as three.
Levels at the same price are drawn once, captioned with every window that shares them, as in 20·40·60d high. Each side of the range then shows exactly as many lines as it has distinct prices. The caption also tells you when a level stops being the tightest one: a shared high loses the 20 from the front of its name the day the 20-day window moves on without it.
Levels that are merely close rather than identical still collide on screen, so each caption steps out to its own lane along the right of the chart until it is clear of the ones above it. No two captions share a row at any zoom.
Equilibrium
Each window can carry the midpoint of its own high and low — the premium and discount divide of that range. Three switches, one per window.
They are drawn dotted and neutral. Dotted because an equilibrium is a calculated reference and not a price that traded, and neutral because a midpoint is neither bullish nor bearish. Each runs from its own window's left edge rather than from a candle, since no single candle sets a midpoint.
The roll-out countdown
Every level and every equilibrium carries the sessions it has left inside its window, printed on its caption as out 12d. When the count reaches its last session the caption reads out next instead.
The arithmetic is the window length less the level's age, both in trading days. A high set yesterday sits in the 20-day window for 19 more sessions; one set 19 sessions ago leaves at the next close. This is also why a 60-day level can date back around 83 calendar days — 60 trading days is twelve weeks, and 24 of those days are weekend.
Two things it states rather than glosses over. The count is measured from the last completed daily close, so today's session is one of them. And it is the origin candle leaving that is counted — the printed level only actually moves if nothing else still inside the window matches that price.
For a level shared by several windows the countdown belongs to the widest one, because that is when it stops being referenced at all. An equilibrium's countdown is the sooner of its two extremes, since it moves the moment either side of it ages out.
The shift, and the sixty day budget
A market structure shift here is a liquidity raid: a day taking out the highest high, or the lowest low, of the days before it. The look-back is an input. Raise it to ignore the smaller shifts inside a range and find only the major one — in ICT's framing the real shift can sit two or three months back, so a reading of no shift found is an instruction to widen the search before concluding there isn't one.
A confirmed shift stands for its full 60-day budget. A later raid in the same direction inside that budget is a mini shift within the range and does not restart the clock; only a raid in the opposite direction, or one arriving after the budget is spent, places a new anchor. Without that rule a trending market would reset the count every few sessions and the budget would never be seen counting down.
The raid is marked with a vertical, and three more are projected forward from it at 20, 40 and 60 trading days, weekends skipped. The last is the point at which the 60-day budget from that shift is spent. The projection counts weekdays; the panel counts sessions the symbol actually traded, so a weekday the exchange was closed puts the chart marker one session ahead of the panel's count, and the panel says so.
The panel reports the same thing in numbers: when the shift happened, sessions elapsed, and sessions left of the 60. Its header reads IN BUDGET while the count runs, DUE SOON at five or fewer sessions left, and BUDGET SPENT past 60 — at which point the projections come off the chart rather than being extended into a window that no longer exists.
There is only one forward boundary and the arithmetic is worth seeing, because it looks like two:
today + (60 − elapsed) = (shift + elapsed) + (60 − elapsed) = shift + 60
The cast-forward target and the budget expiry are the same date. Drawing both would be drawing one fact twice.
Anchored to the minute
A raid found on chart candles lands on the chart's own grid, so on a 1 hour chart the shift marker can sit up to 59 minutes away from where the level was actually taken. The raid candle is re-read at 1 minute resolution and the marker placed at the first minute the prior extreme was genuinely exceeded.
TradingView only serves intrabar data for recent history. Where it is not available the marker falls back to chart-candle resolution, the tag carries a ~ mark, and the panel says which of the two it used. It never claims a precision it did not get.
Open interest
Where the instrument publishes an open interest series, the panel reports its change over a set window — 20 trading days by default, matching the innermost look-back — against price over the same window, and states a reading only where the arithmetic supports one: a fall of 15% or more on flat price, both falling together, both rising together, or no clear read. Open interest is a daily series whatever the chart shows, so the reading is the same on a 1 minute chart and a daily one.
The two sign readings compare only the direction of two changes, so they sit behind a floor: the open interest change must be abnormal and price must not be flat. The default floor of 10% was measured rather than chosen. Over 400 sessions with the quarterly roll weeks removed, the 90th percentile of the 20-day open interest change was about 14% on NQ and about 7% on ES; 10% sits between them. NQ's open interest runs roughly twice as noisy as ES's, so a chart dedicated to one instrument may want the floor moved.
The contract roll is refused outright. A continuous contract's open interest collapses by a third to a half in a session as the front month is abandoned, then rebuilds over the following week, and a window that spans one cannot be read for positioning. The panel fetches the largest one-day jump inside the window and, above 12%, reads contract roll instead of a signal until the window has cleared it.
Most instruments publish nothing. On those the panel names the symbol it looked for and says the reading is unavailable. It does not print a zero, and it does not infer open interest from volume or anything else.
The year map
Quarterly dividers run across the loaded history and project forward, so the year reads as quadrants rather than as one rolling window. Two spacings are offered — three month and four month — because ICT's IPDA material carries both as worked examples anchored at different points. They are the same rule applied from different places, not rival calendars, which is why this is a choice of grid rather than a claim about which one is correct. The 60-day look-back and look-forward is measured from wherever a shift actually sits, independently of the grid.
Keeping it readable
The vertical tags ride two rails outside the range — budget markers on the inner rail, the calendar on the outer — offset by a fraction of the 60-day range rather than by ATR. On a chart spanning a year an ATR cushion is a rounding error, which puts the tags inside the candles and on the same row as the level captions.
Because the range is the unit of measurement throughout, the spacing holds on any instrument and any timeframe without tuning.
By default every extreme is drawn black. The six levels are liquidity, and liquidity is neither bullish nor bearish — a level tinted by the direction of the last shift would be a bias call the script has no basis for. Which window a level belongs to is in its caption.
Each line family carries its own colour and width: the 60, 40 and 20 day levels, the equilibriums, the shift verticals and the calendar dividers. The defaults are set for a grey chart, where the usual light-grey neutral is the background itself and vanishes, so the secondary families use a dark slate instead. A level shared by several windows takes the colour and width of its tightest one. The panel header field has its own colour.
Non-repainting
Every daily figure is read from confirmed candles. Nothing is revised once its candle has closed, and no level, count or projection moves in hindsight. The lines extend rightward to the current bar while they are live — that is the drawing tracking the present, not its history changing.
Alerts
Three: a new shift confirmed and the 60-day budget restarted, fired on the close of the bar that placed the anchor; five or fewer sessions left of the budget; and the budget spent. The last two are evaluated once per day.
What it will not do
It places no entries, exits, stops or targets, and it does not size a position. It draws no bias, no trend and no projection of where price is going. A shift marker says a level was taken on that day; it does not say what happens next.
It does not rank the levels against each other or tell you which one price is drawn to. Whether a level inside the window is worth trading is a judgement about context this script does not have — session, higher timeframe draw, and what the day has already done.
It has no opinion on open interest where none is published, and no opinion on direction where the arithmetic does not support one. Both are stated as unavailable rather than filled in.
Settings
Quarterly dividers with their spacing and how far forward they project; the 20, 40 and 60 day bands each on their own switch; equilibrium on its own switch per window; the shift clock panel with its raid look-back and its minute-anchoring toggle; open interest with its comparison window and abnormal-move floor; and label size, tag rail offset, whether tags sit above or below the candles, right offset, the panel header colour, and a colour and width for each line family.
Attribution
IPDA, the 20/40/60 day look-back and the market structure shift are concepts from ICT's public teaching material. This is an original implementation of them. No third-party code is used.
Disclaimer
This is a decision-support tool for discretionary ICT trading. It is not financial advice, and no market's past behaviour is indicative of future results. Indicateur

Liquidity Sweep Detector Liquidity Sweep Detector is a price-action based indicator designed to identify potential liquidity sweeps around recent highs and lows and highlight subsequent directional confirmation.
The indicator focuses on a simple market behavior: price may temporarily move beyond a recent high or low, take available liquidity, and then return inside the previous range. After detecting this event, the indicator monitors the following candles for confirmation of a potential directional move.
## How It Works
The indicator calculates recent highs and lows using a configurable lookback period.
A bullish liquidity sweep is identified when price moves below a recent low and then closes back above that level.
A bearish liquidity sweep is identified when price moves above a recent high and then closes back below that level.
After a sweep occurs, the indicator monitors a configurable number of candles for directional confirmation. A bullish confirmation requires price to move above the previous candle's high, while a bearish confirmation requires price to move below the previous candle's low.
## Main Features
• Recent liquidity high and low levels
• Bullish liquidity sweep detection
• Bearish liquidity sweep detection
• Sweep zones for visual reference
• Directional confirmation signals
• Configurable confirmation window
• Optional candle-body confirmation
• BUY and SELL markers
• Alert conditions for sweep and confirmation events
• Adjustable visual settings
## Settings
Liquidity Lookback controls how many previous candles are used to identify recent highs and lows.
Confirmation Window controls how many candles the indicator monitors after a liquidity sweep.
Minimum Sweep Wick controls the minimum relative wick size required for a sweep to qualify.
Strong Candle Body can be enabled to require stronger directional candle confirmation.
Visual settings allow users to display or hide liquidity levels, sweep labels, sweep zones, and confirmation markers.
## How to Use
The indicator is intended to help traders study price behavior around recent liquidity levels.
A typical bullish sequence is:
Recent Low → Liquidity Sweep → Reclaim → Bullish Confirmation
A typical bearish sequence is:
Recent High → Liquidity Sweep → Rejection → Bearish Confirmation
Users can combine these observations with their own market analysis, timeframe context, and risk-management approach.
## Limitations
Liquidity sweeps can occur without producing a sustained directional move. A confirmed signal does not guarantee a particular market outcome.
The indicator is based on historical price data and should be treated as an analytical tool rather than a prediction system. Market conditions can change rapidly, and users should independently evaluate each setup.
This script does not guarantee profits, accuracy, or future performance.
## Originality
The indicator combines recent liquidity-level detection, sweep recognition, configurable confirmation logic, and visual sweep zones into a focused price-action tool. Its purpose is to provide a clear framework for observing liquidity events and subsequent price behavior without relying on excessive chart elements.
This publication is intended for educational and analytical purposes and is not financial advice.
Indicateur

Confirmed Swing Ledger [BSL]Confirmed Swing Ledger is a confirmation-aware market-structure ledger
for studying how swings become known in real time.
WHAT IT DOES
- Detects pivot highs and lows only after the configured right-side
confirmation window has closed.
- Separates the pivot's historical origin bar from the later confirmation bar.
Confirmation markers are the default; optional hollow origin dots are
retrospective and clearly labelled.
- Maintains an alternating ledger of accepted highs and lows, classifying them
as HH/LH and HL/LL.
- Applies an optional ATR-distance filter to reduce near-duplicate swings.
Same-side candidates may replace an existing extreme without inventing a new
alternating swing.
- Tracks the latest confirmed upper and lower levels.
- Distinguishes strict close breaks from wick rejections. A break requires the
close to cross a known confirmed level; a wick through the level that closes
back inside is counted separately.
- Freezes state on non-standard chart types instead of presenting synthetic
bars as ordinary OHLC evidence.
- Exposes hidden numeric streams for confirmed swings, level updates, breaks,
rejections, dual rejections and bias. These are selectable sources in Signal
Audit Lab .
- Includes alert conditions for accepted swings, confirmed-level close breaks
and confirmed-level wick rejections.
TIMING MODEL
With the default 3/3 left/right settings, a candidate that originates at bar
`t` can only become a usable event at `t + 3`. The script never relocates a
tradeable event back to the origin bar. Optional origin dots are visual
context, not realtime signals.
DEFAULTS
- Pivot left/right: 3 / 3
- ATR length: 14
- Minimum alternating swing distance: 0.5 ATR
- Panel: Compact
DESIGNED FOR AUDITABILITY
The panel reports current confirmed levels, classification, structural bias,
accepted/replaced/filter/ambiguity counts, break/rejection totals, chart-type
guard status and open-bar hold state. Historical state changes occur only on
confirmed bars.
This tool describes confirmed structure; it does not predict future price,
guarantee performance or provide trading advice. Validate behavior on your own
symbols, timeframes and execution assumptions before making decisions.
Open-source Pine Script® v6. Educational use only.
Indicateur

Execution-Aware Trend [BSL]Execution-Aware Trend is a deliberately ordinary trend-and-breakout strategy
whose main product is visible testing discipline. It answers “what did this
exact ruleset simulate after declared costs, next-tick execution and a fixed
sample split?” It does not predict the next move and does not claim an edge.
This is an original BarState Labs implementation created from an independent
written specification. It does not reproduce another publication’s source,
defaults, interface, chart grammar or report.
HOW IT WORKS
Trend qualification uses a fast and slow EMA. A long setup requires the fast
EMA above the slow EMA and the slow EMA above its value at the configured slope
lookback. The short rule is symmetric. Equality qualifies neither side.
Entry and exit channels always exclude the current bar:
`entryHigh = highest(high , entry length)`
`entryLow = lowest(low , entry length)`
`exitHigh = highest(high , exit length)`
`exitLow = lowest(low , exit length)`
A confirmed close beyond the prior entry channel creates a market-entry
intent only when the matching trend filter qualifies. There is no pyramiding
and no same-calculation reversal.
The close-risk line uses ATR and confirmed closes. For a long position, the
highest observed close is tracked and the line is the greater of its previous
value and `peak close - ATR multiple × ATR`. It therefore never loosens. The
short rule is symmetric and never rises. A channel breach or a confirmed close
through the risk line creates a market-close intent.
EXECUTION MODEL AND COSTS
Orders are not processed on the signal bar’s close. The strategy keeps
TradingView’s normal next-tick behavior, which on historical bars normally
means a fill at the following bar’s open. The declaration includes:
- 0.10% commission per filled order;
- 2 ticks of slippage per market fill;
- 10% of equity order size;
- no pyramiding and no simulated leverage;
- no calculation on every tick or on order fills.
These are generic examples, not estimates for a particular broker or market.
Users must replace them in Properties. The panel cannot detect a manual
Properties override, so it labels them declaration defaults. Simulated fills
do not model liquidity, spread variation, queue position, rejected orders or
market impact.
SAMPLE WINDOWS
The same signal parameters can be viewed as Full history, In-sample or
Out-of-sample. The default split is 2024-01-01 UTC. In-sample ends immediately
before the split; out-of-sample begins at the split. No entry is allowed
outside the selected window, and an open position is closed by a normal delayed
market intent when the window ends.
One visible split does not prove that a user avoided tuning after seeing the
result. The script exposes the boundary; it cannot enforce research behavior.
A visible 100-closed-trade gate is a sample-size warning, not statistical
proof.
CONFIRMED AND STANDARD-CHART BOUNDARIES
New orders require a confirmed bar and `chart.is_standard`. On Heikin Ashi,
Renko, Kagi, Line Break, Range, Point & Figure and other non-standard charts,
the script displays `NON-STANDARD — NO ORDERS` and creates no trades.
The script uses only the current chart symbol and timeframe. It makes no
external requests, uses no lookahead and does not force same-bar-close fills.
Exchange or broker feed corrections can still rebuild historical standard
OHLC after reload.
OUTPUTS
The chart shows fast and slow EMAs, optional prior-bar entry and exit channels,
the active close-risk line, optional sample background and confirmed intent
markers. Compact and Full panels expose state, sample, split, fill model,
declaration costs, closed trades, the 100-trade gate, net result, average closed
trade and maximum drawdown.
Hidden machine-readable plots expose:
- Confirmed entry intent: +1, -1 or 0;
- Confirmed exit intent: +1, -1 or 0;
- Selected sample: 1 or 0;
- OOS flag: 1 or 0.
Order calls contain explicit alert messages, so TradingView order-fill alerts
can identify the simulated action, size, ticker and resulting strategy
position. They are diagnostics, not recommendations.
LIMITATIONS
- Positive net profit is not a design requirement or evidence of robustness.
- Results depend on symbol, feed, timeframe, loaded history, Properties and
inputs.
- Close-confirmed risk exits can gap on the next simulated fill.
- Commission and slippage defaults are not a complete transaction-cost model.
- One in-sample/out-of-sample split is not walk-forward validation.
- The 100-trade gate does not establish significance or future performance.
- Backtests are simulations and are not trading advice or expected returns.
VALIDATION
The candidate passed 16 deterministic Python fixtures and a 16/16 live Pine
harness. Manual TradingView checks covered BTCUSDT and AAPL on daily and
intraday charts, 187 BTCUSDT 30-minute and 103 AAPL hourly trades, unchanged
parameters across IS/OOS, higher costs, reload parity, realtime confirmation,
daily Bar Replay, zero orders on Heikin Ashi, the order-fill alert dialog,
390 × 844 rendering and Pine Profiler. The profiler observed 32,614 executions
on DJI daily history with 0.6 seconds total runtime.
The validation intentionally retains unfavorable evidence: BTCUSDT 30-minute
Full history returned about -3.70%, AAPL hourly Full history about -2.63%, and
AAPL daily OOS about -1.83%. No parameter was retuned after these observations.
ORIGINALITY AND SOURCE
Category demand was selected from dated popularity metadata. No protected,
invite-only or closed source was accessed, and no compared script’s source was
imported. EMA, ATR, prior-bar channels and sample splitting are standard,
transparent building blocks. The implementation is released under MPL 2.0.
CHANGELOG
v1.0.0
- Initial open-source release candidate.
- Symmetric confirmed-close trend and prior-channel entries.
- Non-loosening ATR close-risk line with delayed market exits.
- Explicit commission, slippage, sample split and standard-chart guard.
- Compact/Full evidence panels, signed intent exports and order-fill messages.
Stratégie

Stretch z distance from session VWAPStretch z — distance from session VWAP, normalised
Ten dollars from VWAP means something completely different on a dead Tuesday than it does thirty seconds after a number drops. Most "distance from VWAP" tools don't know that — they plot the raw dollar gap and leave you to eyeball whether it looks big today. This pane won't plot a number until it's been made to mean the same thing on any day, in any volatility regime, on any instrument.
The problem with a dollar amount
Raw distance from VWAP isn't comparable across sessions, let alone across symbols. A given point distance on gold during a quiet Asian session and the same point distance thirty seconds after a data release aren't the same event, even though the ruler says they are. The fix is standardisation: divide the raw distance by a measure of how far price normally sits from VWAP right now, and the number stops being "$10" and starts being "how unusual is this, given what unusual looks like today." Do that consistently and the reading also becomes portable — the same z = 2 means roughly the same thing on GC and on NQ, without retuning a single input between them.
Two normalisers, two different claims
You get an explicit choice, because the two options aren't interchangeable and I didn't want to hide that. Dividing by the rolling standard deviation of the spread produces an actual z-score — a statement about how many typical deviations price currently sits from VWAP, with the probabilistic interpretation that implies. Dividing by daily ATR instead produces a distance expressed in units of a familiar, point-based measure — easier to reason about at a glance, portable across timeframes you already think in ATR terms, but it is not a z-score, and the same band thresholds mean something different depending on which one you picked. The tool doesn't pretend these are the same thing wearing different clothes.
Don't trust a variance estimate you just started counting
There are two ways to estimate "normal" dispersion, and each has a real cost. A rolling window (60 bars by default) gives a stable estimate built on a real sample size, but it can straddle a session boundary — at 09:35 that window is still mostly measuring yesterday's regime, not today's. A session-anchored estimate restarts at the open and builds its variance forward, bar by bar, from a running sum and sum-of-squares (with Bessel's correction applied for a proper sample variance) — statistically cleaner, because it only ever describes the session you're actually in, but noisy and untrustworthy for the first handful of bars, when "normal dispersion" is being estimated off three or four data points. Rather than plot a confident-looking number built on a sample too small to support it, the pane suppresses the reading — and the alerts — until the estimate has enough bars behind it to mean something.
A parametric score deserves a non-parametric gut check
A z-score's "how unusual is this" framing leans on the reading behaving roughly like a normal distribution, and a futures spread doesn't always cooperate with that assumption. So alongside the z-score itself, the readout reports where the current |z| ranks against its own trailing 500-bar history — the same question, asked empirically, without needing the distribution to be well-behaved. If the two ever disagree meaningfully, that disagreement is informative on its own.
The bands aren't decorative — they're calibrated
Distance from VWAP isn't universally good or bad; what it means depends entirely on what you're trying to do with it. The readout scores the same z-band differently for three separate trade setups, and the weighting isn't monotonic in the same direction for all three — one setup scores highest when price sits close to VWAP and falls off as stretch increases, while another actually peaks in the 2–3σ band rather than near zero, which lines up with what earlier backtesting on that setup already found. Treating "how stretched is price" as a conditioning variable that different setups respond to differently, rather than a single filter everyone reads the same way, is the actual point of the table — a live, at-a-glance version of a relationship that was originally found by looking backward, not a number invented for the chart.
How I actually use it
Before taking any of the three setups this table tracks, I check the band and the points column, not just the raw z-score — a "big" z-score isn't automatically good or bad news, and the table already tells me which setup it favors and which it doesn't. The percentile column is my sanity check against the regime itself: a 2–3σ reading on a slow, thin session is a genuinely rare event; the same reading thirty seconds into a volatile one might barely be top-quartile, and the percentile is what tells the two apart when the z-score alone can't. The two band-cross alerts do the actual watching — I don't need to sit on the pane all session waiting for the reading to become interesting; it tells me when it has.
(Default window length and weights are set to match a scoring workbook I built earlier in this framework — you don't need that workbook to use this pane, but if the defaults look oddly specific, that's why.)
No time travel
Session VWAP is a standard, non-repainting session-anchored calculation. Daily ATR is retrieved through a security request with lookahead explicitly disabled and offset by one bar before the request, the documented non-repainting pattern for higher-timeframe data. Nothing on the pane, and no alert it fires, depends on information that wasn't available at the time.
What's proven, and what isn't yet
The normalisation logic and the small-sample discipline are sound on their own statistical merits — that part doesn't need a backtest to justify it. The per-setup weights are a different matter: they encode a relationship I'd already found in earlier research on this framework's setups, not a fresh statistical test run by this indicator itself, and the three band edges (1σ, 2σ, 3σ) are conventional defaults rather than something optimised inside this script. A companion scoring workbook in the same framework carries Monte-Carlo-validated adaptive thresholds; this pane trades that adaptivity for a lighter, always-on read, and it's worth knowing which tool you're looking at if the two ever disagree.
Limitations
Runs on any TradingView plan — unlike footprint-based tools, this only needs price and volume, not order-by-order data.
Built for standard candlestick charts; since it emits alertconditions, treat it like any signal-generating script and avoid Heikin Ashi, Renko, or other synthetic chart types.
Session-anchored mode needs roughly 20 bars into the session before its reading is trustworthy; the pane stays blank until then rather than show a number that isn't earned yet.
Default bands and setup weights are tuned for the framework and instrument I built this on; treat them as a starting point, not a universal constant, on a different symbol or session. Indicateur

Squeeze Regime Map [BSL]Squeeze Regime Map classifies volatility contraction, confirmed release and
directional expansion as explicit states. It answers “what volatility regime
is the current chart in?”, not “what trade should I take?”
This is an original BarState Labs implementation built from an independent
written specification. It does not reproduce another publication's formula,
defaults, interface, chart grammar or source code.
HOW IT WORKS
Normalized volatility is Wilder ATR divided by close and expressed as a
percentage:
`nATR = RMA(True Range, ATR length) / close × 100`
The current nATR is ranked inside the latest complete rolling window using an
inclusive percentile:
`VOL PCTL = 100 × count(window values <= current nATR) / window size`
Inclusive ties are deliberate. The implementation uses this explicit bounded
definition rather than relying on an opaque rank function.
Directional impulse is displacement over the selected momentum length,
normalized by current ATR and then EMA-smoothed:
`impulse = EMA((close - close ) / ATR, smoothing)`
Impulse labels the direction of a confirmed release only when its magnitude is
at least the configured minimum. A weak release is recorded as unresolved
instead of being forced up or down.
STATE MACHINE
- Compression begins when VOL PCTL is at or below the compression-entry level.
- Compression persists until the separate release threshold is reached. This
hysteresis prevents repeated threshold chatter.
- The first qualified exit is a one-bar Release Up or Release Down state and a
one-bar +1 or -1 machine-readable pulse.
- A weak exit returns to Neutral and increments the unresolved ledger.
- On the next bar, a directional release becomes Expansion only when volatility
reaches the expansion threshold and impulse keeps the same qualified
direction.
- Expansion persists while volatility remains above the release threshold and
direction agrees. Otherwise the state returns to Neutral.
- A new compression always takes transition precedence.
The default thresholds are 20 / 40 / 70 percentile. They must satisfy
`compression < release <= expansion`; an invalid order renders `CONFIG ERROR`
and freezes committed output until corrected.
CONFIRMED-BAR BEHAVIOR
State, duration, release plots, diagnostics and alert pulses commit only on
confirmed bars. On an open realtime bar, the panel says `OPEN BAR — HELD` and
retains the previous confirmed values. Historical, elapsed realtime and Bar
Replay bars use the same transition order.
This does not prevent upstream exchange or broker feed corrections from
changing rebuilt history after reload. The script makes no external data
requests and uses only the current chart symbol and timeframe.
OUTPUTS
The pane contains:
- volatility percentile and declared threshold guides;
- a visually clipped impulse histogram;
- optional confirmed regime backgrounds;
- optional confirmed release markers;
- Compact and Full evidence panels with state, duration, normalized metrics,
release counts, unresolved events and readiness.
Hidden machine-readable plots expose:
- Regime code: -3, -2, 0, 1, 2 or 3;
- Compression score: 100 minus VOL PCTL;
- Confirmed release: +1, -1 or 0.
The Confirmed release plot can be selected directly as Signal Audit Lab's
Event source with the Signed pulse decoder. In the validation run, BSL-002's
18 up and 19 down releases matched BSL-001's 18 long and 19 short accepted
events exactly.
ALERTS
Four alert conditions are provided:
- Confirmed volatility release up;
- Confirmed volatility release down;
- Confirmed directional expansion up;
- Confirmed directional expansion down.
Release alerts use the same one-bar booleans as the exported pulse. Expansion
alerts fire only on entry into expansion.
LIMITATIONS
- This is a regime classifier, not a forecast, entry/exit system or strategy.
- A release direction is a normalized momentum label, not evidence of future
return.
- Percentile and state depend on the loaded symbol, timeframe, feed, history
and settings.
- Warm-up requires a complete percentile window and valid momentum history.
- The maximum 500-value percentile window is bounded but intentionally more
expensive than the default 126-value window.
- No optimization, multi-symbol scan, multi-timeframe request, order model,
position sizing or profitability claim is included.
VALIDATION
The release candidate passed 14 deterministic reference tests, a 14/14 live
Pine harness, BTCUSDT/AAPL × 1D/1H runtime checks, exact reload parity,
realtime and replay gates, valid/invalid threshold boundaries, four alert
conditions, 390 px rendering, BSL-001 signed-source integration and a 32,137
execution Profiler run at the maximum 500-bar window.
ORIGINALITY AND SOURCE
Category demand was selected from a dated metadata corpus. No protected,
invite-only or closed source was accessed, and no source from a compared open
publication was imported. The script uses standard true-range, Wilder RMA,
percentile-count and EMA calculations and is released under MPL 2.0.
CHANGELOG
v1.0.0
- Initial open-source release candidate.
- Explicit compression, release and expansion state machine with hysteresis.
- Inclusive rolling volatility percentile and normalized directional impulse.
- Confirmed +1 / -1 release export for Signal Audit Lab.
- Compact/Full evidence panels, four alerts and visible limitations.
Indicateur

Failed Auction Detector Failed Auction Detector — footprint-confirmed rejection at swept reference levels
Every push through a level is the market asking a question: is there real business up here, or was that just noise wearing conviction's clothes? Most of the time nobody answers the question properly. A wick forms, the candle closes back inside the level, and every "stop hunt" or "liquidity sweep" indicator on the platform declares victory — because that's all they ever look at: the shape left behind, not what actually traded while it was being made.
That's the gap this script was built to close. A market is a two-sided auction. When price extends beyond a reference level — a swing extreme, a session high or low, the prior day's high or low — the auction is testing whether new business exists at the new price. It either finds acceptance and the range expands, or it finds nothing and snaps back. The candle can't tell you which one happened; the volume that traded during the extension can.
The problem with wicks
A wick past a level that closes back inside is a necessary condition for a failed auction. It is nowhere near sufficient. Thin resting liquidity, a single oversized print, plain noise — all of these can leave the exact same shadow on a chart with no real shift in who was willing to transact at the new price. Build a rule on candle shape alone and you're building a rule that mostly detects candle shapes, not auctions failing.
How a signal earns its place
I decomposed "failed auction" into three conditions, checked in order, not one threshold:
Sweep — price trades through a reference level you've enabled (a confirmed swing pivot, the developing session high/low, and/or the prior day's high/low; run any combination at once).
Rejection in the footprint — the part that actually does the work. "Rejection" isn't one observable event; it's a state that several distinct microstructure mechanisms can each produce on their own, so instead of one blanket volume-and-range test, the script checks four independent ways an auction can lose its nerve: an aggressive imbalance stepping in against the move, exhaustion of the side that pushed the extreme (its own volume thinning out relative to the session's point of control), absorption (heavy volume at the extreme that produced no further ground given), or an outright reversal in net delta at the extreme itself. A signal needs the sweep and reclaim plus any one of these four — alternative evidence for the same event, not four boxes that all have to tick, because real failures don't always announce themselves the same way twice.
Reclaim — the bar closes back inside the level. The extension didn't hold.
Conviction, not a coin flip
Two failed auctions can carry very different weight, and collapsing that to a plain yes/no throws away exactly the information that separates them. Every confirmed signal earns a 0–6 score from reclaim distance in ATR, rejection-wick size, whether the footprint imbalance fired, whether any rejection mechanism was present at all, volume significance against its recent average, and confluence with the prior day's level. That resolution is what lets a score bucket be tested against forward outcomes later, instead of trusted on faith because it's printed on the chart. Score ≥ 5 gets marked separately as high conviction.
You choose which levels are worth defending
Not every reference level deserves the same attention on every instrument. Rather than hardcoding one definition, the level itself is a checkbox input — swing pivot, session extreme, prior-day high/low, any combination. That turns "which level construction actually produces the more reliable signal" into something you get to test on your own market, not an assumption baked into the code before you ever loaded it. A freshness filter keeps the script from re-flagging a level the market is only drifting through, and each level fires once until it's freshly swept again, so the chart doesn't fill with the same tired flag on a level nobody's testing anymore.
Where the real work is: levels that hold, and levels that give way
The script reads buy and sell volume off each traded price row directly from TradingView's footprint engine — not the bar's high or low, the actual rows underneath it. That's the difference between a level that's genuinely protected (swept, then rejected by real opposing size) and one that was merely visited on the way through. The script signals only the protected case, on purpose: when a level is swept and the footprint shows the opposite picture — the aggressing side still winning at the extreme, no imbalance, no exhaustion, no absorption — that's the auction finding real business at the new price, and it isn't a separate detector, it's the same evidence read the other way. I use that same row-level data, sitting in the on-chart table and the data window, to make that read myself.
From evidence to a trade
The shaded zone on each signal and the dotted reclaim line aren't decoration — their edges are built from the same executed volume the detection ran on, so they sit exactly where the auction actually failed, not where a candle makes it look like it failed. That gives two of the three numbers a trade needs, for free:
Invalidation sits beyond the genuine sweep extreme — the specific high or low the market actually rejected — instead of a generic ATR multiple bolted on afterward with no connection to the real event.
Entry is typically the reclaim itself, or a retest of the reclaimed level, because that's the exact price where the failure got confirmed.
The same table reporting the signal also reports the trade data behind it — bar delta, delta at the extreme, top or bottom-zone volume against the point-of-control row, whether the imbalance flag fired — so a given entry's conviction is graded from real orderflow, not taken on the label's word alone. "Precise" here means anchored to where actual buying and selling happened. It isn't a claim about win rate, and the next section is exactly what would earn the right to make one.
No time travel
Swing levels use a confirmed pivot lag, never the current unconfirmed bar. Session levels reference only bars before the current one. Prior-day levels come through with lookahead explicitly switched off. Every plotted value and every signal only ever sees what was actually knowable at the time it fired.
What's proven, and what isn't yet
This is a rule-based detector, not a validated statistical signal — an honest hypothesis about how orderflow behaves at rejected levels, not a claim that it has forward-return content. That claim gets earned with a conditional event study: forward returns at several horizons for every fired signal, split by score bucket, testing whether score actually rank-orders the outcome instead of just looking like it should — plus a placebo run of the same logic against price levels that were never real reference points, to make sure the signature isn't just "high volume happened here" dressed up in more specific language. Until that's done, treat this as what it is: a discretionary confirmation tool that flags a failed auction with a graded conviction score, not a system that manages your entries, stops, targets, or size. A level's past reaction is not a promise about its next one.
Limitations
Requires a TradingView Premium or Ultimate plan — the footprint API is gated to those plans.
Built for standard candlestick charts. Sweep and reclaim logic will misread the market on Heikin Ashi, Renko, or other synthetic chart types.
Default thresholds for imbalance, exhaustion, absorption, and volume significance are tuned for a liquid futures instrument; thinner symbols or very low timeframes may need the detection inputs adjusted.
Indicateur

Signal Audit Lab [BSL]Signal Audit Lab measures what happens after numeric events emitted by another
indicator. Connect one external plot, define how its values become long and
short events, and inspect the resulting sample on the current symbol and
timeframe.
This is a measurement tool. It does not generate signals, simulate orders, or
claim that an observed event has a trading edge.
HOW IT WORKS
The script reads one numeric `input.source()` series. Four decoders are
available:
- Signed pulse: positive and negative event pulses such as +1 / 0 / -1.
- Threshold cross: crossings above the long level or below the short level.
- Long-only edge: the first qualifying long value after a non-qualifying value.
- Short-only edge: the equivalent short-only rule.
Events are committed only on confirmed bars. Held values are deduplicated into
one edge. Optional cooldown and conflict rules make rejected events explicit.
An `na` transition cannot create an accidental first event without a prior
valid observation.
MEASUREMENT
The event-bar close is the anchor. Direction-adjusted forward returns are
measured after 1, 3, 5, 10 and 20 bars by default. Each horizon has its own
completed and pending sample count, so unfinished observations never enter the
denominator.
The round-trip cost input subtracts a user-defined basis-point amount from each
completed return. It is a sensitivity adjustment, not a fill, spread, slippage,
or execution model.
The panel reports:
- completed and pending observations;
- mean raw and cost-adjusted directional return;
- hit rate, return dispersion, and a Wilson 95% interval;
- separate aggregate, long, and short results;
- mean favorable and adverse excursion at the longest horizon;
- a payoff proxy based on mean positive versus mean negative net outcomes;
- longest-horizon session and normalized-ATR volatility splits;
- accepted long/short counts, cooldown rejects, conflicts, `na` skips, and
configuration status.
Samples below 30 observations are highlighted. Compact mode keeps aggregate
horizons, excursion/payoff, and diagnostics readable on narrow charts. Full
mode adds directional detail, raw-to-net values, Wilson intervals, dispersion,
and the split tables.
SESSION AND VOLATILITY SPLITS
The session split classifies the event bar using the selected session and
timezone. The defaults are 09:30–16:00, Monday–Friday, America/New_York.
Volatility is normalized ATR (`ATR / close`) compared with its moving-average
baseline. Defaults are ATR 14 and baseline 100. LOW is below 0.8 times the
baseline, HIGH is above 1.2 times the baseline, and values between those
boundaries are MID. Events before the baseline is available are UNCLASSIFIED.
The exact settings remain visible in Full mode.
SETUP
1. Add an indicator that exposes a numeric plot. TradingView strategies cannot
provide an external source plot.
2. Add Signal Audit Lab and select that plot under Event source.
3. Choose the decoder and levels that match the producer's numeric contract.
4. Enter a clear source label, then set horizons, cost sensitivity, session,
and volatility boundaries.
5. Read the sample count and diagnostics before interpreting percentages.
For a continuous oscillator such as RSI, Threshold cross is the natural
decoder. For a producer that exposes +1 / 0 / -1 pulses, use Signed pulse.
OUTPUTS AND ALERTS
Optional chart markers show accepted confirmed events. A hidden +1 / 0 / -1
plot is available for inspection or data export. Alert conditions are provided
for “Accepted long event” and “Accepted short event”; they use the same
confirmed booleans as the statistics.
REPAINT AND DATA BOUNDARY
Signal Audit Lab does not commit its own events before bar close. Historical
and realtime tests confirm that an unconfirmed source flicker is excluded from
the statistics until confirmation.
This boundary cannot certify the upstream source. A connected indicator may
still repaint, use future-looking data, revise history, or change behavior after
an update. Reload and Bar Replay should be repeated for the specific producer
before relying on a result. The panel therefore labels source stability as
unverified.
LIMITATIONS
- Results describe the loaded chart history, symbol, timeframe, settings, and
upstream plot. They are not universal and can change when any of these change.
- Close-to-close forward measurement is not an order-fill simulation or a
strategy backtest.
- The cost input does not model spread, slippage, liquidity, partial fills,
position sizing, pyramiding, or portfolio interaction.
- MFE and MAE use chart OHLC values inside the forward window; they do not prove
an executable path through intrabar prices.
- Session and volatility splits are descriptive. Small or imbalanced buckets
should not be treated as stable regimes.
- The script does not optimize settings, predict prices, or validate the logic
of the connected producer.
Use the Lab to form a better question, then verify that question with a proper
execution model and out-of-sample process.
ORIGINALITY AND SOURCE
This is an original BarState Labs implementation built from an independent
written specification and deterministic acceptance fixtures. No protected,
invite-only, or closed-source implementation was used. The script uses standard
forward-return, variance, Wilson interval, excursion, and ATR calculations and
is published under the Mozilla Public License 2.0.
CHANGELOG
v1.0.0
- Initial open-source release.
- Four explicit event decoders with confirmed-bar commitment.
- Five configurable forward horizons and cost sensitivity.
- Aggregate, directional, excursion, session, and volatility evidence.
- Compact and Full panels, accepted-event markers, and two alert conditions. Indicateur

Indicateur

Kamote v1.0Kamote v1.0 gives traders a clear, color-coded decision system that tells them the current market regime and the single highest-probability strategy to use—or when to stay out—across Intraday, Day, and Swing horizons.
It does this by combining five independent, hysteresis-protected filters into one coherent recommendation engine, displayed in a clean status matrix with fully configurable alerts. The result is fewer forced trades in dead or chaotic conditions and higher-confidence entries when the conditions actually align.
### Core Value: One Dashboard That Replaces Guesswork ###
Most indicators show isolated signals. Kamote synthesizes volatility regime, higher-timeframe trend direction, trend efficiency, volume behavior, and horizon-specific strategy scoring into a single, actionable output. Traders see at a glance:
Whether volatility is Dead, Healthy, or Extreme
Whether the higher-timeframe linear-regression slope is Bullish, Bearish, or Flat
Whether multi-timeframe Kaufman Efficiency Ratio confirms real trend strength
Whether volume is Expanding, Contracting, or Flat
The optimal strategy (Trend Long/Short, Pullback Long/Short, Momentum Long/Short, Breakout, Mean Reversion) or “Stay Out / None”
Color coding makes the matrix instantly readable. Green supports action, red signals caution or exit, yellow flags transitional states.
### How the Engine Works ###
Kamote runs a single higher-timeframe data request (automatically set by the chosen trading mode) and blends it with chart-timeframe calculations. All regime classifications use percentile ranks plus hysteresis bands so the status does not flicker on every minor bar.
Volatility Regime (ATR Percentile + Hysteresis)
ATR is ranked over a lookback window. Dead (< low percentile), Extreme (> high percentile), or Healthy. Hysteresis prevents rapid oscillation between states. Extreme + contracting volume + weak efficiency is treated as structural noise and forces a “Stay Out” recommendation.
Higher-Timeframe Trend Filter (ATR-Scaled Linear Regression Slope)
Slope is calculated on the higher timeframe, normalized by ATR, and classified Bullish / Bearish / Flat. The threshold itself scales with volatility so the filter stays relevant in both quiet and explosive markets.
Multi-Timeframe Efficiency Ratio
Kaufman’s Efficiency Ratio is computed on both chart and higher timeframes, then blended with user-adjustable weights. A minimum threshold gates whether the move is efficient enough to support trend or momentum strategies.
Volume Regime (Percentile + Hysteresis)
Volume is ranked and classified Expanding / Contracting / Flat. Expanding volume supports breakouts and trend continuation; contracting volume favors mean-reversion or short-side setups depending on direction.
Horizon-Aware Strategy Scoring
The script first checks for hard invalid states (extreme volatility + contracting volume + weak efficiency, flat slope + weak efficiency + flat volume, or swing-mode + flat slope + extreme ATR). If any invalid condition is true, the recommendation is “Stay Out.”
Otherwise it scores eight strategy candidates using eligibility gates and horizon-specific weights:
Trend and Pullback strategies are favored on Day and especially Swing horizons.
Momentum strategies are favored on Intraday.
Breakout receives a boost on Intraday and a discount on Swing.
Mean Reversion is favored on Swing and discounted on Intraday.
The highest-scoring eligible strategy is displayed. Confidence modifiers (healthy ATR, volume alignment, weak prior efficiency, etc.) further refine the score so the recommendation is not binary.
### Designed for Real Trading Workflows ###
Three preset modes (Intra / Day / Swing) automatically adjust higher-timeframe, efficiency length, volume lookback, slope threshold, ATR window, and hysteresis. Users can still fine-tune every parameter. Layout can be horizontal or vertical and placed in any corner. Alerts fire only on confirmed state changes for ATR regime, slope direction, efficiency cross, volume regime, and strategy recommendation—keeping notification noise low.
### Why Traders Adopt It ###
Kamote does not claim to predict the future. It enforces discipline by making regime and edge explicit. When the matrix is green and a strategy is named, the conditions that historically support that style of trade are present. When it says “Stay Out,” the market is offering no edge. That single piece of information—knowing when not to trade—is often more valuable than any entry signal.
The script is pure Pine Script v6, overlay=false, and designed to sit alongside price action or other tools without cluttering the chart. It is built for discretionary traders who want a systematic regime filter and for systematic traders who need a clean, multi-factor permission layer.
Install Kamote v1.0, select your trading horizon, and let the status matrix tell you what the market is actually offering right now. Indicateur

STOC - EMA + RSI Pullback TraderThe STOC – EMA RSI Pullback Trader is a long-only trend-following indicator designed to identify potential entries during bullish trends and controlled pullbacks.
Instead of chasing price after a large upward move, the indicator looks for opportunities when price returns toward the faster trend average while the broader trend remains positive.
How it works
The indicator combines:
* 20 EMA for identifying short-term momentum and pullback areas.
* 50 EMA for determining the broader trend.
* RSI for confirming that momentum remains bullish.
An initial Buy signal can appear when the 20 EMA crosses above the 50 EMA and RSI confirms positive momentum.
After the bullish trend is established, a Pullback Buy signal can appear when price revisits the 20 EMA and subsequently confirms strength above it while RSI remains above the selected bullish threshold.
Exit methods
The indicator provides three selectable exit methods:
* 20 EMA crossing below the 50 EMA.
* Price closing below the 50 EMA.
* Either condition, whichever occurs first.
The “Either Condition” setting offers more defensive trade management, while the EMA crossover exit generally gives the trend more room to develop.
Key features
* Initial EMA crossover entries.
* Trend-continuation pullback entries.
* RSI momentum confirmation.
* Adjustable EMA and RSI settings.
* Optional requirement for rising RSI.
* Multiple pullback-confirmation methods.
* Selectable exit logic.
* Buy, Pullback Buy and Exit labels.
* Active-trade background highlighting.
* Trend and trade-status dashboard.
* TradingView alert conditions.
* Dynamic JSON messages for webhook integration.
* Works across equities, indices, futures, forex and cryptocurrencies.
How to use
The indicator is best used on instruments displaying a clear directional trend.
A valid bullish environment generally exists when:
* The 20 EMA is above the 50 EMA.
* Price is trading above the 50 EMA.
* RSI is above 50.
The initial Buy signal identifies a possible new bullish trend. Pullback Buy signals identify potential re-entry opportunities after price returns toward the 20 EMA without invalidating the broader trend.
Avoid treating every signal as an automatic trade. Consider confirming the setup using:
* Higher-timeframe trend direction.
* Support and resistance.
* Breakout structure.
* Volume expansion.
* Relative strength.
* Overall market and sector conditions.
Suggested timeframes
* Daily and weekly charts: positional and swing trading.
* 1-hour and 4-hour charts: shorter-term swing trading.
* 5-minute and 15-minute charts: intraday trading with additional market and volume confirmation.
Alerts
Create a TradingView alert using “Any alert() function call” to receive the indicator’s dynamic Buy and Exit messages. Standard Buy and Exit alert conditions are also available.
Disclaimer
This indicator is provided solely for educational and informational purposes. It does not constitute investment advice, financial advice, trading advice or a recommendation to buy or sell any security or financial instrument.
Trading and investing involve substantial risk, including the possible loss of capital. Historical signals and past performance do not guarantee future results. Always perform your own analysis, apply appropriate position sizing and risk management, and consult a qualified financial professional when necessary. Indicateur

Momentum Candle By SkyroothMomentum Candle By Skyrooth highlights expansion candles — the bars where one
side takes control decisively — and filters out the ordinary bars that only look
big because volatility happened to be high at the time.
WHAT PROBLEM THIS SOLVES
Most price action methods depend on a single instruction: "wait for
displacement". A break of structure only counts if the candle that caused it was
decisive. An order block only counts if the move leaving it was strong.
The problem is that "strong" is usually judged by eye, and the eye is unreliable.
A 40 point candle is large on a quiet morning and unremarkable during a news
release. Traders end up calling the same candle valid or invalid depending on
what they want to see.
This indicator applies one fixed measurement instead.
HOW IT WORKS
A candle is marked when all of the following are true:
1. BODY DOMINANCE — the body is large relative to the total range of the bar, so
the close finishes near the extreme rather than in the middle. This is what
separates a decisive bar from a bar that spent the session being rejected.
2. RANGE VS RECENT VOLATILITY — the range is compared against a rolling average
of recent ranges, not against a fixed point value. This is what makes the
measurement adapt: the same threshold works on a quiet session and a volatile
one, and on gold as well as an index.
3. VOLUME CONFIRMATION — the bar is compared against its own recent volume
average. Expansion on thin volume is usually a liquidity gap rather than
participation.
4. DIRECTIONAL AGREEMENT — the bar's direction is checked against the prevailing
trend, so continuation bars are separated from isolated spikes.
Bars meeting the conditions are coloured and marked on the chart. Everything
else is left alone.
HOW TO USE IT
This is a filter, not an entry signal. It answers one question — "was that move
decisive?" — and nothing else. There is no entry, stop or target here.
Typical use:
- CONFIRMING A STRUCTURE BREAK. When price breaks a swing high or low, check
whether the breaking candle is marked. An unmarked break is more likely to be
a liquidity sweep that reverses.
- VALIDATING AN ORDER BLOCK OR IMBALANCE. The candle that leaves the zone should
be marked. If the departure was weak, the zone is weak.
- AVOIDING CHASING. A marked candle means the move already happened. Wait for a
retracement into the area the candle originated from rather than entering at
the extreme.
SETTINGS
- Body ratio threshold — minimum share of the range the body must occupy.
Raise it for fewer, cleaner signals.
- Volatility lookback — number of bars in the rolling range average.
- Volume multiplier — how far above its own average the bar's volume must be.
Set to zero to disable the volume condition on instruments with unreliable
volume data, such as spot forex.
- Trend filter — enable to keep only bars aligned with the prevailing direction.
NOTES AND LIMITATIONS
- Signals are confirmed on bar close. An intrabar candle can meet the conditions
and then lose them before closing.
- Volume conditions depend on the feed. Centralised futures volume is reliable;
spot forex volume is broker specific and often is not.
- A marked candle describes what already happened. It carries no claim about
what happens next, and no win rate is implied.
- Works on any symbol and timeframe, though the volume condition is most
meaningful on instruments with genuine exchange volume. Indicateur

Variance-Weighted Regression Trend [BackQuant]Variance-Weighted Regression Trend
Overview
Variance-Weighted Regression Trend is a rolling linear-regression trend indicator that adjusts the influence of observations according to the estimated variance of their regression residuals.
The script first calculates a standard ordinary least-squares regression across the selected window. It then measures the squared residuals around that fit and uses those residuals to estimate how variable the regression error has been through the sample.
Those variance estimates are converted into relative weights. Lower estimated residual variance can receive more influence, while higher estimated residual variance can receive less. A second weighted regression is then calculated using those weights.
The indicator also includes:
EMA, RMA or rolling-average residual variance.
Configurable inverse-variance weighting strength.
Weight regularization and upper/lower weight limits.
Weighted R² and slope-quality diagnostics.
Two regression-channel methods.
Optional trend-flip quality confirmation.
OLS comparison.
Linear regression projection.
Trend colouring and alerts.
Calculation
The basic process is:
Fit an ordinary least-squares regression over the Regression Length.
Calculate the squared residual of every observation around that fit.
Smooth those squared residuals to estimate local residual variance.
Add a regularization floor to reduce unstable extreme weights.
Convert variance into relative observation weights.
Clamp weights between the selected minimum and maximum.
Calculate a second weighted regression.
The weighted line is therefore influenced more by observations receiving larger relative weights and less by those receiving smaller ones.
Variance Weighting
The weighting is based on regression residual variance , not ATR, trading volume or raw price volatility.
For each point:
Residual = Source - OLS fitted value
Squared Residual = Residual²
The squared residuals are then processed using the selected Variance Model.
EMA
Uses exponential smoothing and responds more quickly to recent residual changes.
RMA
Uses a slower recursive smoothing process.
Rolling Mean
Uses a finite moving average of squared residuals.
Weight Power
Weight Power controls how strongly estimated variance affects the regression.
The raw weighting relationship is:
Weight ∝ 1 / Variance^Weight Power
0 gives equal weighting, making the final fit behave like the OLS regression.
1 applies standard inverse-variance-style weighting.
Values above 1 increase the difference between low- and high-variance observations.
Higher settings can make the regression more selective, but can also concentrate too much influence in a small part of the sample.
Variance Regularization
Very small variance estimates can otherwise create extremely large inverse weights.
The script therefore adds a fraction of the window's mean squared residual to each local variance estimate.
Higher regularization makes the weights more uniform.
Lower regularization allows stronger differences between observations.
Minimum and Maximum Relative Weight
Raw weights are normalized relative to their average before being clamped.
A relative weight above 1 means the observation has greater-than-average influence.
A value below 1 means it has less.
The Minimum Relative Weight prevents high-variance observations from effectively disappearing from the regression.
The Maximum Relative Weight prevents very low-variance observations from dominating the entire fit.
Weighted Regression
Once the final weights are calculated, the script solves a weighted linear regression:
Y = Intercept + Slope × X
The displayed line is the current endpoint of that rolling weighted regression.
Each new bar shifts the regression window and recalculates:
OLS.
Residuals.
Variance estimates.
Weights.
Weighted slope and intercept.
OLS Comparison
The optional OLS line shows the endpoint of the initial equal-weight regression.
This makes it easy to see how much the variance weighting is actually changing the result.
If Weight Power is set to 0, the weighted regression and OLS should be effectively aligned.
As the weighting becomes more aggressive, the lines may separate depending on the residual structure inside the window.
Trend State
Trend direction comes from the sign of the weighted regression slope.
Positive slope = bullish.
Negative slope = bearish.
A bullish flip occurs when the stored trend changes from bearish to bullish.
A bearish flip occurs when it changes from bullish to bearish.
Quality Confirmation
Quality Confirmation can be enabled to prevent weak slope changes from immediately flipping the trend state.
When enabled, an opposite slope must also satisfy:
Minimum Weighted R².
Minimum Slope / Standard Error.
If those conditions are not met, the existing trend state remains active even if the current slope temporarily changes sign.
Weighted R²
Weighted R² measures how well the weighted straight-line regression describes the current sample.
Higher values indicate that the weighted observations are more closely aligned with a linear fit.
Lower values indicate a less orderly linear relationship.
R² does not determine trend direction and should not be interpreted as a forecast of future performance.
Slope / Standard Error
The script calculates the absolute weighted slope relative to its estimated standard error:
|Slope| / Slope Standard Error
This is used as a practical slope-quality measure.
Higher values indicate that the fitted slope is larger relative to the estimated regression error.
It is used by the optional Quality Confirmation setting and is not presented as a formal significance test.
Regression Channels
Two channel-width methods are available.
Weighted Residual RMS
Uses the weighted root-mean-square distance of observations from the fitted regression.
This reflects the general amount of scatter around the line.
Regression Standard Error
Uses the calculated standard error of the fitted current regression value.
This normally represents a different and often narrower measure than residual RMS.
The Channel Multiplier scales whichever method is selected.
Expand During Poor Fit
When enabled, the channel becomes wider as Weighted R² decreases.
This is intended to visually reflect greater uncertainty when the current window is poorly described by a straight line.
The expansion affects only the channel width.
It does not alter the regression or trend calculation.
Projection
The Projection extends the current regression slope forward by the selected number of bars.
It is simply:
Current fitted line extended using the current slope.
It is not a separate forecasting model.
As the regression changes on new bars, the projection also changes.
Current Relative Weight
The Data Window shows the final relative weight assigned to the newest observation.
A value:
Above 1 = greater-than-average influence.
Below 1 = less-than-average influence.
This can help show how the current observation is being treated by the variance-weighting model.
Effective Sample Size
The indicator also reports:
Effective N = (Sum of Weights)² / Sum of Squared Weights
This provides a simple measure of weight concentration.
If weights are similar, Effective N remains close to the full Regression Length.
If a smaller group of observations receives most of the weight, Effective N falls.
This is useful when experimenting with aggressive Weight Power or wide weight limits.
Trend Strength
Trend Strength is used only for the regression glow.
It combines:
60% Weighted R².
40% normalized Slope / Standard Error.
It does not affect the regression or signals.
ATR(14) is used only to scale the visual width of the glow and flip bloom to the instrument.
Input Guide
Regression Length
Controls the size of the rolling regression sample.
Projection Bars
Controls how far the current fitted slope is extended visually.
Variance Length
Controls how quickly the residual-variance estimate changes.
Variance Model
Selects EMA, RMA or Rolling Mean smoothing of squared residuals.
Weight Power
Controls the strength of inverse-variance weighting.
Variance Regularization
Reduces extreme differences between weights.
Minimum / Maximum Relative Weight
Limits how little or how much influence any one observation can receive.
Channel Width
Selects Weighted Residual RMS or Regression Standard Error.
Channel Multiplier
Scales the regression channel.
Poor Fit Expansion
Optionally widens the channel as R² deteriorates.
Quality Confirmation
Requires minimum regression fit and slope quality before allowing trend flips.
How to use it
The indicator can be used as:
A regression-based trend filter.
A comparison between ordinary and variance-weighted regression.
A way to study how residual-based weighting changes a rolling trend estimate.
A trend-quality filter using R² and slope strength.
A regression channel for visualizing fit dispersion.
The OLS Comparison and Data Window values are particularly useful when testing the weighting settings, because they show whether the extra weighting is materially changing the regression or simply producing a result close to ordinary least squares.
Limitations
The variance estimates are derived from OLS residuals inside the same rolling window.
The model is a custom two-stage weighted regression rather than a full generalized least-squares procedure.
Higher Weight Power can concentrate the fit in a relatively small part of the sample.
Linear regression cannot represent every type of market structure.
High R² does not imply future trend continuation.
The forward projection is only a linear extrapolation of the current fit.
Quality Confirmation can reduce weak flips but can also delay genuine changes in direction.
Data Window
The script exposes:
Weighted Slope.
Weighted R².
Slope / Standard Error.
Weighted Residual RMS.
Regression Standard Error.
Current Relative Weight.
Effective Sample Size.
Trend Strength.
Alerts
The indicator includes:
Variance-Weighted Regression Bullish: trend changes from bearish to bullish.
Variance-Weighted Regression Bearish: trend changes from bullish to bearish.
Variance-Weighted Regression Flip: either transition occurs.
Summary
Variance-Weighted Regression Trend starts with a normal rolling OLS regression, measures the residual variance around that fit, and uses those estimates to assign relative weights to the observations in a second regression.
The weighting strength, variance smoothing, regularization and weight limits are all configurable, making it possible to move from essentially equal-weight OLS to a much more selective fit.
The final weighted slope controls the trend state, while Weighted R² and the Slope / Standard Error score can optionally be used to filter weak reversals.
Regression channels, OLS comparison, forward projection and the visual strength system provide additional context around the core weighted regression without changing the underlying trend logic.
Indicateur

Cross-Asset Session Impulse Engine [PhenLabs]📊 Cross-Asset Session Impulse Engine
Version: PineScript™ v6
⚠️HEADS UP⚠️
Click the three dots on the right of the indicator after adding it to your chart and click pin to scale to make sure it is displaying properly
📌 Description
Cross-Asset Session Impulse Engine waits for the session opening range to lock, then asks a simple question before you take the break: did correlated markets print the same impulse, or is this chart running alone? A k-of-n basket (crypto, dollar, indices — you pick) must confirm in the same direction, with invert flags for assets like DXY that move against risk.
The engine is built for every TradingView plan. There is no footprint feed, no lower-timeframe history wall, and no silent crash when a basket symbol or volume field is missing. If the basket cannot load, the dashboard switches to chart-only and you still see the opening range. Confirmed signals, named alerts, and Pine Screener columns are included.
🚀 Points of Innovation
Opening-range break is gated by live cross-asset breadth instead of a single-chart close
Per-symbol invert flags so DXY-up can confirm a risk-off short without extra scripts
All-plan design: same-timeframe request.security only — no Premium-only data path
Dead basket symbols return na and drop out of the vote instead of aborting the script
Missing volume skips the optional gate and labels Vol N/A instead of refusing to load
Named bullish/bearish confirmed alerts plus Screener plots for breadth, signal, and armed state
🔧 Core Components
Session clock: New York, London, Tokyo, or a custom session/timezone pair
Opening range: first N session bars freeze ORH/ORL; later confirmed closes beyond those rails are impulses
Basket voter: up to four input.symbol contexts, each with its own opening range on the same clock
Confirmation gate: min k live same-direction votes, or chart-only when every basket feed fails
Projection: ATR targets from the broken rail and invalidation at the opposite side of the range
Dashboard: OR state, chart break, breadth, per-symbol arrows, data mode, signal
🔥 Key Features
Preset sessions so you are not locked to US cash hours
Enable/disable and invert each basket symbol; unused inputs stay hidden
Optional relative-volume filter that degrades to off when the symbol has no volume
Unconfirmed chart-break markers are hidden by default to keep price readable
One confirmed signal per session, both directions, with alertconditions
Screener-ready numeric plots (breadth net, signal +1/−1, armed)
🎨 Visualization
Dashed ORH/ORL rails and a translucent opening-range box on the session
Dotted ATR targets and a dashed invalidation line after a confirmed signal
Triangle markers for confirmed impulses; optional faint circles for unconfirmed chart breaks
Top-right dashboard: session, OR lock, chart state, breadth, basket tape, data mode, signal
📖 Usage Guidelines
Session Preset — Default: New York — NY 09:30–16:00, London 08:00–16:30, Tokyo 09:00–15:00. Custom unlocks session and timezone.
Opening Range Bars — Default: 6 — Range: 1-48 — On 5m this is ~30 minutes (classic ORB). Raise it on 1m, lower it on 15m.
Min Basket Confirms — Default: 2 — Range: 0-4 — 0 fires on the chart break alone. Keep this ≤ the number of enabled live symbols.
Enable Symbol 1–4 — Defaults: BTCUSDT on, ETHUSDT on, DXY on (invert on), ES1! off — Use distinct tickers. Invert for inverse assets.
Require Relative Volume — Default: false — When on, confirmed bars need volume ≥ Min Rel Volume × SMA. No volume → gate skipped, dashboard shows N/A.
Show Unconfirmed Chart Breaks — Default: false — Turn on only when you want to see the raw OR break before breadth arrives.
Table Size — Default: Small — Tiny / Small / Normal. Visible only while the dashboard is on.
✅ Best Use Cases
Intraday ORB on indices, FX, and crypto during NY, London, or Tokyo
Filtering fake session breaks that do not show up in BTC, ETH, DXY, or ES
Risk-off reads: DXY invert on so a dollar spike confirms shorts on the chart
Watchlist screening via the XSIE Signal and XSIE Breadth Net columns
⚠️ Limitations
Designed for intraday session charts. Daily bars often sit outside a cash-session window and will show OR as OUT.
Basket symbols that match the chart ticker are skipped so the chart cannot vote twice.
Confirmation can arrive after the chart break (late breadth). That is intended; the armed state stays until session end or confirmation.
One signal per session. Opposite-range invalidation flags the trade; it does not flip and re-fire.
Pine Screener itself is a paid TradingView product. The script only exposes plots — it does not unlock Screener on a free account.
💡 What Makes This Unique
Cross-asset k-of-n is the confirmation, not a decorative correlation table
All-plan data path with an explicit chart-only fallback when the basket is dead
Invert-aware votes treat DXY as a risk switch instead of a same-direction clone
⚙️ Under the Hood
Same-timeframe request.security basket : four unrolled tuple calls fetch OHLC on timeframe.period with lookahead_off and ignore_invalid_symbol=true. Invalid tickers return na and drop out of breadth instead of throwing. This is not lower-timeframe volume and not footprint — every plan sees the same engine.
Opening-range state machine : each context (chart + basket) freezes ORH/ORL after N session bars. A break is the first confirmed close beyond the frozen rail. The lock bar cannot break because its high/low still define the range.
Invert mapping : when Invert is on, an upside OR break on that symbol votes for a downside chart impulse (and vice versa).
Data mode : no plan-gated feed is used. The Data row reports All-plan, live/enabled count, Vol x.xx or N/A, vol gate skipped, or basket failed · chart-only.
Screener and alerts : plot XSIE Breadth Net, XSIE Signal (+1/−1 on the confirmed bar), and XSIE Armed. alertcondition titles are “XSIE Bullish Impulse Confirmed” and “XSIE Bearish Impulse Confirmed” — not a generic “extreme event”.
🔬 How It Works
The session clock marks bars inside the chosen window. A new session resets range, votes, drawings, and the fired flag.
The first N bars build ORH/ORL. After lock, a confirmed close beyond a rail arms bull or bear on the chart.
Each live basket symbol builds its own range on the same clock and casts an up or down vote (optionally inverted).
When armed direction reaches min confirms — or the basket is entirely dead and chart-only mode is on — the engine fires once, projects ATR targets, and sets invalidation at the opposite rail.
A confirmed close through invalidation flags INVALIDATED. The next session starts clean.
💡 Note:
Best on 1–15m charts with the session that actually trades your market. Seed the basket with assets you can actually resolve on your TradingView plan and region; failed symbols simply show ✗ and the rest keep voting. This is an analytical aid, not financial advice.
Indicateur

Streak statisticsAfter four red bars, what actually happens? Your chart already knows.
Description
Counts every run of consecutive up closes and consecutive down closes on the loaded chart and reports, for each exact streak length, how often that streak extended by one more bar. The instrument's own base rate of up and down closes is shown alongside, so every continuation frequency can be read against what an ordinary bar does rather than against an imagined 50%.
How it calculates
Direction is close against prior close. Each time a streak reaches a length, that length's denominator increments; each time it extends by one more bar, the numerator increments. The figure at length three therefore answers exactly: of the streaks that reached three, what share became four. The final row pools every resolved opportunity at or beyond the configured cap.
Right-censoring is handled correctly. A streak enters a denominator only when its next bar is known, so the unfinished streak sitting at the chart edge is never silently counted as a failed continuation. Reset boundaries censor the preceding streak rather than treating the boundary or the overnight gap as a failure. A flat close terminates a streak without extending either side.
The sample is a precise rolling number of observed comparisons rather than an unknown quantity determined only by your chart plan's history allowance, and the date range actually in the window is reported in the header tooltip. The window is rebuilt when the sample changes, once per bar close, not on every price tick.
Each continuation rate carries its sample size and an optional 95% Wilson interval. A separate base-rate-centered stabilized estimate is available and is never substituted for the empirical frequency; both are shown.
How to read it
The first row shows the current streak and, when a resolved sample exists for that state, its historical continuation, opposite, and flat shares plus the lift against base. The base row shows the share of all observed moves that were up, down, and flat. Each length row shows the continuation share, the sample size, the interval, and the stabilized estimate, per direction, with the lift in percentage points beside it.
Emphasis marks a cell that is both materially different from its base rate and interval-separated from it. It marks a departure in either direction; the sign is carried by the lift column, never by colour alone.
Repainting
Closed bars do not repaint. The live bar never enters the sample.
Timeframe requirements
Any intraday timeframe when a reset mode is active. Calendar-day reset and custom-session reset both require an intraday chart, because on daily or higher a calendar-day reset would exclude every bar. Set reset mode to Never to run on daily and above.
Originality and attribution
Run counting is elementary probability. What is original here is the treatment: continuation frequency by exact streak length and direction, conditioned so each length's denominator is the number of streaks that actually reached it, correct right-censoring at the chart edge and at reset boundaries, a bounded rolling sample in observed moves rather than in chart history, and base rate, interval, and sample size shown rather than implied. This is not derived from and does not reuse code from any existing published script.
Honest limitations
Descriptive frequencies are not forecasts, signals, or proof of an edge.
Serial dependence means the Wilson intervals are descriptive uncertainty bands, not a complete market-microstructure hypothesis test.
Looking across many rows creates multiple-comparison risk. Emphasis requires both interval separation and a minimum effect you set, but that does not eliminate data-mining risk.
Rare long streaks stay rare. Stabilization reduces visual overreaction; it cannot manufacture information that is not in the sample.
Close-to-close direction counts overnight gaps unless a reset mode is on.
The rolling window is measured in observed comparisons, not clock time. Indicateur

Level survival trackerEveryone trades PDH. Almost nobody knows their own numbers on it.
Description
Tracks six session reference levels every day: prior day high, prior day low, overnight high, overnight low, opening range high, opening range low. For each, over a rolling window of sessions, it reports the probability the level gets tested, the probability it breaks given a test, how failure probability changes with repeated tests, and the median rejection distance and time from first touch to break.
How it calculates
Prior day levels come from the last completed exchange daily bar via the documented non-repainting request idiom, or optionally from the previous custom chart session. Overnight high and low accumulate outside the session and freeze at the open; the opening range freezes when its window completes, and the bars that built it cannot also test it. A touch is a bar overlapping the level within a tolerance frozen at the session open, counted in episodes. A break is a confirmed close beyond the level plus tolerance, after a touch. A session whose open is already beyond a level, or where price closed through it without any bar ever overlapping it, is recorded as opened-beyond and excluded from every rate, because that level was never fairly testable. Completed sessions are written once, after the session ends.
The tolerance can be defined in ticks, points, a fraction of prior daily ATR, or a fraction of chart ATR. Statistics can be conditioned on the session's opening gap against the prior daily range, or on prior daily volatility versus its own 20-day mean. The break rate can display a 95% Wilson interval so the uncertainty is visible next to the point estimate. Break rates and touch-failure rates require their own minimum number of actual tests before anything is shown.
How to read it
Today's column shows each level's live state: untested, testing with its touch count, broke with the touch it broke on and the time, or opened beyond. P(test) is tests over eligible sessions. P(break | test) is breaks over actual tests, with the interval underneath if enabled. Touch failure answers: of past sessions that reached this many touches on this level, how often did the level eventually break. Reaction and time are the median rejection distance in points and the median minutes from first touch to confirmed break. Every figure carries its sample size, and figures below the minimums show the count instead of a percentage.
Repainting
Closed bars do not repaint. Touches and breaks are decided on confirmed bars only, and a session's outcomes enter history only after the session completes.
Originality and attribution
The levels are common knowledge. What is original is the survival accounting: episode-counted touches, conditional failure by touch number, opened-beyond exclusion, frozen per-session tolerance, regime conditioning, and interval-honest break rates with sample sizes shown. This is not derived from and does not reuse code from any existing published script.
Honest limitations
These are empirical frequencies, not forecasts or trade signals.
Intrabar path is unknowable from OHLC bars. A same-bar touch and break records as a first-touch break with zero measured rejection.
Overnight rows need extended-hours bars on the chart.
The session must not cross midnight in the chosen time zone.
Previous-RTH prior levels need one completed chart session to warm.
The chart timeframe must divide the session start and length exactly, so bars align to the session boundaries. For a 09:30 to 16:00 session that is 1, 2, 3, 5, 6, 10, 15, or 30 minutes. This is not a fixed ceiling: it follows your session. A session starting on the hour, such as 09:00 to 16:00 or 08:00 to 17:00, also accepts 20 and 60 minutes. Misaligned timeframes are refused rather than measured against fuzzy session boundaries, because a bar straddling the open would corrupt the opened-beyond classification, which reads the session-open price.
The opening range is rounded up to a whole number of chart bars, so no bar can straddle its boundary. On a 2-minute chart a 15-minute range becomes 16. The effective value is in the table header tooltip.
Results depend on instrument, session, tolerance, timeframe, and sample. Change any one and the numbers change. Indicateur

SMI Ergodic Oscillator PROSMI Ergodic Oscillator PRO
The SMI Ergodic Oscillator PRO is a momentum indicator designed to help traders identify changes in the strength and direction of price movement.
The indicator displays a histogram, making momentum behavior easy to visualize:
🟢 Green/Lime: momentum is gaining strength or positive slope.
🔴 Red: momentum is weakening or showing negative slope.
Larger bars: indicate stronger momentum.
Smaller bars: may indicate declining momentum and a possible loss of strength.
The main purpose of the indicator is not to generate trades by itself, but to help confirm market direction and identify potential changes in momentum.
How to Use
1. Trend Confirmation
During an uptrend, look for a sequence of consistent positive bars. Sustained momentum can provide additional confirmation that the current move remains strong.
During a downtrend, look for persistent negative bars.
2. Momentum Changes
A change in histogram color can highlight a potential shift in market momentum.
Red → Green
May indicate improving bullish momentum.
Green → Red
May indicate weakening bullish momentum or increasing bearish momentum.
Color changes should be evaluated together with price action, market structure, and the overall trend.
3. Loss of Momentum
When histogram bars begin to decrease in size, even while remaining on the same side, this may indicate that the current movement is losing strength.
This can be used as an alert to:
Reduce exposure
Protect an existing position
Wait for additional confirmation
Monitor for a potential reversal
Parameter Settings
The indicator provides three main parameters:
Parameter Practical Function Effect
Long Length Controls the longer-term sensitivity Higher values = smoother response
Short Length Controls responsiveness to recent price movements Lower values = faster response
Signal Length Controls signal smoothing Higher values = less noise
Suggested Settings
Balanced — 20 / 5 / 5
A good starting configuration for general market analysis and most timeframes.
Fast — 10 / 3 / 3
More responsive to recent momentum changes. Suitable for traders looking for earlier signals, but it may produce more noise.
Conservative — 30 / 7 / 7
Produces a smoother reading and reduces sensitivity to smaller market fluctuations.
Very Conservative — 50 / 10 / 10
Designed for traders who prefer to focus on larger and more sustained market movements.
Choosing the Right Settings
There is no universal "best" configuration. Parameters should be adapted to:
Asset: Crypto, Forex, stocks, indices, etc.
Timeframe: Scalping, day trading, or swing trading.
Volatility: Highly volatile markets may require more conservative settings.
Trading style: Faster settings can be useful for earlier momentum detection, while slower settings can provide stronger confirmation.
Simple Trading Approach
A practical approach is to use the indicator in combination with price structure and market context.
Potential Long Setup:
Favorable market structure + positive momentum + confirmation from the histogram.
Potential Short Setup:
Favorable bearish structure + negative momentum + confirmation from the histogram.
Avoid: entering a trade solely because the histogram changes color. A color change is better treated as a confirmation or warning signal, rather than an independent trading signal.
Important Notice
The SMI Ergodic Oscillator PRO is a technical analysis tool designed to assist with market analysis. It does not guarantee trading results and should not be considered financial advice. Always combine the indicator with proper risk management and independent market analysis. Indicateur

Money Flow Index GlauMoney Flow Index Glau (MFI)
Description
The Money Flow Index (MFI) is a technical analysis oscillator that combines price and volume to evaluate buying and selling pressure in an asset.
This indicator uses the typical price (HLC3 = (High + Low + Close) / 3) and calculates the MFI on a scale from 0 to 100.
In this version, in addition to the traditional MFI line, the line color changes according to its direction:
Green: MFI is rising compared with the previous period, indicating increasing buying pressure.
Red: MFI is falling compared with the previous period, indicating increasing selling pressure.
Yellow: MFI remains unchanged compared with the previous period.
The indicator displays three main levels:
80: Overbought
50: Middle Band
20: Oversold
How to Adjust the Length Parameter
The Length parameter determines the number of periods used to calculate the MFI.
The default value is 14, which is the traditional MFI setting.
Shorter Length
Examples: 5, 7, or 9
A shorter Length makes the MFI more responsive to recent price and volume changes.
It can be useful for:
Short-term trading
Scalping
Identifying faster changes in buying and selling pressure
However, shorter settings can also produce more fluctuations and potentially more false signals, especially in highly volatile markets.
Default Length
14 periods
This is the traditional MFI setting and provides a balanced starting point for different markets and timeframes.
Longer Length
Examples: 21, 30, or 50
A longer Length makes the indicator smoother and less sensitive to short-term price and volume fluctuations.
It can be useful for:
Swing trading
Broader trend analysis
Reducing short-term market noise
Keep in mind that a longer Length can also make the indicator react more slowly to changes.
How to Interpret the Levels
MFI Above 80
When the MFI moves above 80, the asset is traditionally considered to be in an overbought condition.
This does not automatically mean that the price will decline.
The MFI can remain above 80 during a strong uptrend. Therefore, price action and other technical factors should be considered before making a trading decision.
MFI Below 20
When the MFI moves below 20, the asset is traditionally considered to be in an oversold condition.
This does not automatically mean that the price will rise.
During a strong downtrend, the MFI can remain below 20 for an extended period.
MFI Between 20 and 80
When the MFI remains between 20 and 80, it is outside the traditional overbought and oversold zones.
The 50 level can be used as an additional reference to evaluate the relative balance between buying and selling pressure.
How to Use the Color Direction
One of the main visual features of this version is the color change of the MFI line according to its direction.
Green Line
When the MFI line is green, the current MFI value is higher than the previous value.
This indicates that money flow is increasing compared with the previous period.
It can be used as confirmation of increasing bullish momentum.
Red Line
When the MFI line is red, the current MFI value is lower than the previous value.
This indicates that money flow is decreasing compared with the previous period.
It can be used as confirmation of increasing bearish momentum.
Yellow Line
When the MFI line is yellow, the current MFI value is equal to the previous value.
In this situation, there has been no change in the MFI value between the two periods.
Example of a Potential Bullish Scenario
A possible bullish setup can occur when:
The MFI moves near or below 20.
The MFI begins to rise.
The line changes to green.
The MFI recovers above 20.
Price action provides additional confirmation of a potential recovery.
This combination can be used as part of a broader analysis of a potential reversal or recovery.
Example of a Potential Bearish Scenario
A possible bearish setup can occur when:
The MFI moves near or above 80.
The MFI begins to decline.
The line changes to red.
The MFI moves back below 80.
Price action provides additional confirmation of potential weakness.
This combination can be used as part of a broader analysis of a potential correction or reversal.
Failure Swings
The MFI can also be analyzed using patterns commonly known as Failure Swings.
Bullish Failure Swing
A traditional interpretation can occur when:
The MFI falls below 20.
The MFI moves back above 20.
The MFI pulls back again but remains above 20.
The MFI breaks above the previous high.
This behavior may indicate increasing buying pressure.
Bearish Failure Swing
A traditional interpretation can occur when:
The MFI rises above 80.
The MFI moves back below 80.
The MFI rebounds but remains below 80.
The MFI breaks below the previous low.
This behavior may indicate increasing selling pressure.
Suggested Settings
These settings are only general references and should be tested according to the asset and timeframe being used.
Short-Term / Scalping
Length: 5–9
Levels: 20 / 50 / 80
Day Trading
Length: 9–14
Levels: 20 / 50 / 80
Swing Trading
Length: 14–21
Levels: 20 / 50 / 80
Trend Analysis
Length: 21–50
Levels: 20 / 50 / 80
There is no universally optimal setting. MFI behavior depends on the asset, volume, volatility, and timeframe.
Recommended Use
The MFI should be used as a confirmation tool, rather than as a standalone source of buy or sell signals.
It can be combined with:
Market structure
Support and resistance
Trend analysis
Price action
Volume analysis
Moving averages
Divergences
Chart patterns
A touch or cross of the 20 or 80 levels should not automatically be interpreted as a buy or sell signal.
The MFI is generally more useful when combined with other technical analysis methods and price structure.
Limitations
The MFI is calculated from historical price and volume data. Therefore, it does not predict the future and can remain in overbought or oversold conditions during strong trends.
The line color only represents the direction of the MFI compared with the previous period. It does not, by itself, represent a confirmed buy or sell signal.
Parameters should be adapted and tested according to the asset and timeframe being analyzed.
TradingView Publishing Guidelines
This indicator was developed using Pine Script® v6.
For public publication on TradingView, the description should clearly explain the script's purpose, functionality, usage, and limitations.
The script should be presented accurately without misleading performance claims or guarantees of profitability.
Avoid claims such as:
Guaranteed profits
Guaranteed winning signals
Guaranteed accuracy
Unrealistic win rates
Promises of future performance
This indicator is intended as a technical analysis tool and should not be presented as financial advice.
Risk Disclaimer
This indicator is provided for educational and informational purposes only.
It is not financial, investment, or trading advice.
Past market behavior does not guarantee future results. Always conduct your own analysis and consider appropriate risk management before making any trading decision.
Trade responsibly. Indicateur

Intraday Pullback Sniper (BB, Stoch RSI, Liquidity, HTF)An intraday entry-timing indicator.
It looks for pullbacks into a Bollinger band in the direction of the higher-timeframe bias — buying dips in an up regime, selling rallies in a down one — and marks the candle where the pullback has run far enough and the lower-timeframe structure has turned back.
It marks conditions. It does not place stops, targets or position sizes, and it does not tell you to buy. That decision stays with you.
TWO DOTS, AND THE DIFFERENCE BETWEEN THEM IS THE WHOLE IDEA
A small dot means a setup is armed. Four conditions on the same candle: the wick touched a band, the candle closed back inside and in the half that faces that band, the Stoch RSI was at its extreme within the last few candles, and the bias allows that direction. Read it as "price bounced off the band, I am watching."
A large dot means every enabled condition is met. On top of a setup still running from an earlier candle it needs the structure of the entry timeframe to have confirmed the turn, a second band touch with a rejection on this very candle, the bias, the liquidity sweep if you require one, an open session, and the cooldown after the last signal to have passed. Read it as "price did it a second time, and the structure turned in between."
The decisive part is the time gap. The band has to be touched twice, and the structure has to confirm between the two. A large dot can therefore never appear on the same candle as its own small dot — the following one at the earliest. A new small dot on a signal candle is normal: that candle meets the setup conditions as well, so it arms the next setup while the current one fires.
WHAT IT DRAWS
On the price chart: Bollinger Bands, the bias EMA, setup and signal dots with the price they occurred at, swing labels (HH / HL / LH / LL), market structure (BOS / CHOCH / MSB) for several timeframes, liquidity levels named by side and rank, and session boxes sized to the high and low each session made.
In its own pane: the Stoch RSI the logic actually runs on, its levels, dots at the extremes, the bias as a background tint, and a strip along the bottom that runs for as long as a setup is still waiting for its signal.
HOW SWINGS ARE FOUND
Everything structural — swing labels, market structure and liquidity — comes from one single engine using the classical definition of a turning point. A swing high is the highest candle of a window with the same number of candles on its left and on its right, so it is a local extreme in the literal sense. It is confirmed and never repainted, at the cost of a delay equal to that window.
Highs and lows strictly alternate. A second point of the same kind before the opposite one does not open a new leg; it replaces the current one if it is more extreme, otherwise it is discarded. Two degrees are calculated: a short one with a lookback of 2, the classic fractal, and a longer one for the larger move.
Structure breaks are judged on the close, never on wicks. A break with the prevailing direction is a BOS, one against it a CHOCH; both are MSB events.
Liquidity levels are swing points price has not closed beyond. Once a candle of that timeframe closes through a level, the orders resting there have been filled and the level is dropped. A wick through it with a close back on the old side is a sweep, not a break, so the level survives and is marked as swept.
HOW TO USE IT
Put the chart on the setup timeframe, 5 minutes by default. The entry timeframe must be lower than the chart; its candles are read from inside each chart candle. All higher-timeframe data comes from closed candles only, and signals are evaluated at the close of a chart candle, never intrabar.
The 5-minute default describes the preset, not a limit. Every timeframe is adjustable — a 15m chart with a 1H bias and 5m entry structure works the same way. The status table tells you if the chart and the setup timeframe do not match.
For alerts, pick "Any alert() function call" with the trigger "Once Per Bar Close". One alert then covers both directions, and the message carries symbol, direction, price, bias, setup direction, structure state, sweep and session. Separate SNIPER LONG and SNIPER SHORT conditions exist as well.
Every setting has a tooltip. Group 0 holds a glossary of the labels and a short guide to the alerts.
ON THE DEFAULTS
The defaults are deliberately on the safe side and the strict bias is on. If you get too few signals, switch conditions off one at a time and watch what changes — that is far more instructive than loosening several at once. The liquidity sweep is the one filter that is off by default; switch it on for the stricter variant.
LIMITATIONS, HONESTLY
Lower-timeframe data on TradingView is limited to a few months of intrabar history depending on your plan. Further back the entry structure and the signals that depend on it are missing, while everything else keeps drawing normally.
A swing is only confirmed after its window has passed, so the most recent candles cannot carry a label yet. That delay is the price of never repainting, and it is not a bug.
The indicator needs no volume, so it works on CFDs, forex and futures alike. It assumes continuous trading without large gaps — on instruments that gap overnight a band touch can come from the opening gap rather than from a rejection, and the logic is of little use there.
Suited to liquid, continuously traded instruments: index CFDs, major crypto, major forex pairs, liquid futures. On crypto the sessions carry no meaning; either switch all three off or trade the overlapping hours deliberately.
This is a tool for your own analysis, not financial advice. Past behaviour of any setup says nothing about future results. Indicateur

Mann-Kendall Trend Significance [RC Tools]RC Tools — Mann-Kendall Trend Significance
────────────────────────────────────────────────────────────────────
█ OVERVIEW
Most trend tools answer "which way is price going." This one answers a different question: "how statistically unlikely is it that this trend is just noise." It applies the Mann-Kendall test — a nonparametric hypothesis test from statistics, most commonly used in hydrology and climate-science time-series analysis — to price, turning "trend" into a proper standardised test statistic rather than a slope or a moving-average read.
█ WHAT IT DOES
Computes a standardised Z-statistic for monotonic trend over a rolling window and classifies each confirmed bar as a Significant Uptrend or Significant Downtrend once that statistic crosses a configurable significance threshold. Colours the chart background accordingly, plots both the smoothed and raw Z line in a dedicated pane against static threshold lines, and shows a table with the current state, how long price has been in it, and historical base rates (average forward return and win rate) for each state.
█ THE THEORY BEHIND IT
The Mann-Kendall test was developed to detect a monotonic trend in a time series without assuming any particular distribution or that the trend is linear — it only asks whether values tend to rise (or fall) more often than chance would predict. It does this by comparing every pair of points in a window and tallying how often the later point is higher versus lower than the earlier one. Under the null hypothesis of no trend, that tally has a known variance, which lets the raw count be converted into a Z-score — the same logic behind any standard statistical significance test. A Z-score of 1.645, for example, corresponds to the classic 90% one-tailed critical value: at that level, the observed pattern would be expected by pure chance less than 10% of the time.
This is a meaningfully different question from "has price been going up." A choppy market can have more up-days than down-days without ever producing a statistically significant Z-score; a genuinely persistent trend will.
█ HOW IT IS CALCULATED
1. Over a rolling window, compute S — the sum, across every pair of points in the window, of the sign of (later value − earlier value). A persistent uptrend pushes S strongly positive; a persistent downtrend pushes it strongly negative; a directionless window keeps it near zero.
2. Under the null hypothesis of no trend, S has a known variance: Var(S) = n(n−1)(2n+5) / 18, where n is the window length (this assumes no tied values, a reasonable approximation for continuous price data).
3. Standardise S into a Z-score, with the standard continuity correction applied.
4. Optionally smooth the Z-statistic (it is naturally "steppy," since individual pairs enter and exit the window discretely as new bars form).
5. When smoothed Z rises above the long threshold, the state flips to Significant Uptrend. When it falls below the (negative) short threshold, it flips to Significant Downtrend. Otherwise the state holds — this is hysteresis, not noise.
Classification occurs ONLY on confirmed bar close — the plotted Z, the background colour and the table all update together, so nothing here can disagree mid-bar or flip back and forth as the current bar forms.
█ SETTINGS & CONFIGURATION
• Source (default close)
• Window Length (default 20, capped at 50 to keep the pairwise comparison fast)
• Long / Short Significance Thresholds (default 1.645 each, the classic 90% one-tailed critical value) — set independently so long and short conviction can be tuned separately rather than assuming symmetric behaviour
• Smoothing Length and Type (default 3-period EMA) — reduces the raw statistic's step-like behaviour
• Forward Return Window (default 20 bars) — the horizon used for the base-rate table
• Table visibility, position and colours are fully configurable; the main-chart background painting can be toggled off if you only want the statistics pane
█ HOW TO USE IT
Use it as a trend-confirmation filter, not a standalone entry trigger. Because it requires the statistic to clear a significance threshold rather than simply cross zero, it tends to flag fewer, more deliberate trend changes than a typical oscillator — useful for filtering out other tools' false starts in choppy conditions. Check the base-rate table's sample count before treating any single state as meaningfully predictive.
Works on any asset and timeframe with sufficient history for the Window Length.
█ LIMITATIONS
• Mann-Kendall tests for a MONOTONIC trend within the window. It says nothing about the trend's magnitude, and any use of it as a precision entry/exit signal is a misuse.
• The variance formula assumes no tied values, which is reasonable for continuous price data but can be mildly optimistic on assets with heavy price discretisation (e.g. very low-priced or thinly-traded instruments).
• The window length is capped at 50 to keep the pairwise comparison fast — larger structural trends spanning more bars are not captured directly.
• The raw Z statistic is discrete and "steppy" by construction; smoothing trades responsiveness for a cleaner state transition.
• Historical base-rate stats need a meaningful sample count (check N) before being trusted, especially in a low-frequency-flip regime or on a short history.
• This script does NOT repaint. All classification updates on confirmed bar close only.
█ DISCLAIMER
For educational and informational purposes only. Nothing here is financial advice. Past behaviour of any trend-significance state does not indicate future results. Trade at your own risk.
Indicateur

HTF BPR (Balanced Price Range)Introduction
Within Inner Circle Trader (ICT) concepts, the Balanced Price Range (BPR) is especially important, as it helps to navigate institutional order flow. It pinpoints price zones where opposing market inefficiencies intersect, leaving pools of resting liquidity and unexecuted orders. This indicator automates the identification of these overlapping structures across any asset class while using data from higher (or current) timeframe.
How is this script different from other similar tools:
- Unique way of presenting BPR zones with focus on clarity and simplicity
- Highly configurable and customizable
- Automatic timeframe selection which always uses next higher timeframe (can be manually overridden)
- It marks BPRs on either higher or current timeframe providing more flexibility
- Uses side box markers which can help to navigate busy charts (can be turned off)
- Option to wait for higher timeframe close before removing BPR from the chart which should eliminate any repainting during mitigation
- Markers are highlighted when price touches BPRs, giving clear indication the price interacts with this BPR
What is BPR
A Balanced Price Range - frequently referred to as a double Fair Value Gap occurs when a bullish FVG and a bearish FVG directly overlap. Because both buyers and sellers created imbalances across the exact same price window, these overlapping zones become high-probability reaction areas. In algorithmic price delivery, BPRs serve as primary rebalancing targets where the market seeks liquidity before expanding or reversing.
What is FVG
FVG or Fair Value Gap is a three-candle formation where the middle candle moves so aggressively creating displacement that it leaves a gap between the wick of the prior candle and the wick of the following candle.
Trading BPR
BPR entries remain one of the most underrated setup models in ICT trading:
- The Setup: Locate overlapping bullish and bearish FVGs, ideally on the 1-hour to 4-hour timeframes.
- Execution: Wait for price to revisit this overlap following a confirmed Market Structure Shift (MSS). The reaction inside this confluence is usually immediate and sharp.
- The Edge: While average retail traders trade single FVGs in isolation, entering at the intersection captures the compound liquidity of both imbalances.
The Underlying Mechanics
- Single Inefficiencies: A standard Fair Value Gap represents one-sided delivery—a rapid displacement where either buyers or sellers were largely absent.
- Dual Inefficiencies: A BPR represents a corridor that price aggressively skipped twice — once going up without sellers, and second time going down without buyers.
- Algorithmic Repricing: When price returns to a BPR, the delivery algorithm is repricing an area of double inefficiency. Because both buy-side and sell-side resting orders line up inside this narrow range, retests typically trigger decisive expansion away from the zone.
SETTINGS:
- Show HTF BPRs - enable displaying of BPR zones on higher (or current) timeframe
- Looback - how many previous bars are used to find BPRs
- Auto Higher timeframe (one step up) - when enabled, the script works using data from the next higher timeframe above the chart's timeframe
- Manual HTF - when the previous option is not enabled, you can select manualy any higher timeframe (or chart TF)
- Wait for HTF Close (no repainting) - BPR is removed from the chart after higher timeframe close (this may take some time on higher timeframes)
- Max BPR Length - max distance between two opposing FVGs which are part of the same BPR
- Stop drawing BPR after X Candles - BPR is removed from the chart after this many bars
- Fill & Border - BPR decorations settings
- Side Marker & Border - apart from displaying factual BPRs as they are created, the script can also display box side markers
- Marker Position - define where the markers should be displayed (and their width)
- Mitigated BPR Boxes - select what happens when BPR is fully mitigated (the price closes through it). When "Remove" is selected, the corresponding Marker is removed as well. "Highlight" and "Display" options don't apply to the Markers.
-----------------
Disclaimer
The content provided in this script is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs. Indicateur

Sweep Reversal Map+ [Herman]Sweep Reversal Map
Sweep Reversal Map is an open-source price-action indicator designed to identify potential reversal areas that develop after price sweeps previously confirmed swing liquidity.
The concept is inspired by liquidity-sweep and reversal principles taught within ICT methodology, including the idea that price can trade beyond a prior swing high or swing low, reclaim that liquidity level, and subsequently confirm a reversal through a break of nearby market structure.
This script provides an independent Pine Script implementation of that general concept with configurable swing detection, sweep penetration, structure confirmation, displacement filtering, developing zones, and historical reversal mapping.
HOW IT WORKS
The indicator follows a multi-stage process rather than marking every wick through a previous high or low.
1. Confirmed Swing Liquidity
The script first identifies confirmed swing highs and swing lows using the selected Swing Length.
These levels represent previously established areas of liquidity that price may later sweep.
2. Liquidity Sweep
A bearish reversal candidate begins when price trades above a confirmed swing high.
A bullish reversal candidate begins when price trades below a confirmed swing low.
The Minimum Sweep Penetration setting can optionally require price to move a specified ATR-based distance beyond the liquidity level before the event qualifies as a sweep.
3. Reclaim
After the sweep occurs, the script tracks whether price closes back through the swept liquidity level.
For a bearish setup, price must reclaim below the swept swing high.
For a bullish setup, price must reclaim above the swept swing low.
4. Local Structure Confirmation
A sweep alone does not create a confirmed reversal.
The script records nearby structure preceding the sweep and waits for price to break that structure in the opposite direction.
A bearish reversal requires a close below the relevant local structure level.
A bullish reversal requires a close above the relevant local structure level.
5. Displacement Filter
The confirmation candle can also be required to show a minimum body size relative to ATR.
This provides an optional displacement requirement and helps distinguish stronger confirmation candles from very small structure breaks.
Setting Minimum Displacement Body to 0 disables this filter.
REVERSAL ZONES
When Show Developing Reversals is enabled, a faint zone represents a sweep that has occurred but has not yet completed the full confirmation process.
The zone expands if price creates a more extreme price during the developing setup.
Once all confirmation conditions are satisfied, the zone becomes visually stronger and is retained as a historical confirmed sweep-reversal area.
If confirmation does not occur within the selected Maximum Confirmation Bars, the developing setup expires and is removed.
HOW TO INTERPRET THE MAP
A zone above price represents a confirmed bearish sweep-reversal event originating from liquidity above a previous swing high.
A zone below price represents a confirmed bullish sweep-reversal event originating from liquidity below a previous swing low.
The horizontal line identifies the liquidity level associated with the sweep.
The marker identifies the original confirmed swing from which that liquidity level was derived.
These areas are intended to provide additional price-action context. They are not automatic long or short entries and should not be interpreted as guaranteed reversal points.
SETTINGS
Swing Length
Controls how many bars on each side are required to confirm a swing. Higher values generally identify less frequent but more significant swing points.
ATR Length
Defines the ATR period used by the penetration and displacement filters.
Minimum Sweep Penetration
Determines how far beyond the swing level price must trade for the event to qualify as a sweep. A value of 0 accepts any breach.
Local Structure Length
Controls the number of preceding bars used to determine the local structure level required for reversal confirmation.
Maximum Confirmation Bars
Defines how long a developing sweep can remain active while waiting for confirmation.
Minimum Displacement Body
Requires the confirmation candle body to reach a selected fraction of ATR. A value of 0 disables the displacement requirement.
Show Developing Reversals
Displays or hides unconfirmed sweep zones while they are developing.
Confirmed Box Extension
Controls how far confirmed reversal zones extend to the right.
Historical Setups
Controls the maximum number of confirmed historical setups retained on the chart.
IMPORTANT BEHAVIOR OF SWING DETECTION
Swing highs and swing lows are confirmed only after the required number of bars has formed to the right of the potential pivot.
For example, with a Swing Length of 5, a potential swing requires five subsequent bars before it can become a confirmed liquidity level.
Once confirmed, the level is visually anchored to the bar where the swing originally occurred. This historical placement should not be interpreted as the indicator having known the swing in real time on that original bar.
A sweep can only be detected after the corresponding swing has already been confirmed.
Signals and confirmation logic are evaluated on confirmed bars.
LIMITATIONS
Liquidity sweeps and structure breaks are price-action events, not guarantees that price will continue reversing.
Different markets and timeframes can produce very different amounts of noise and therefore may require different Swing Length, structure, penetration, and displacement settings.
A developing reversal can disappear if the required confirmation does not occur before the confirmation window expires.
The indicator does not calculate expected returns, win rates, profit targets, stop-loss levels, or strategy performance.
It should therefore be used as a market-structure visualization and research tool rather than as a standalone trading system.
ORIGINAL IMPLEMENTATION
The underlying liquidity-sweep/reversal concept is an established price-action concept and is associated here with ICT educational methodology.
The original contribution of this script is its programmatic implementation and visualization workflow: confirmed swing-liquidity tracking, optional ATR-normalized sweep penetration, reclaim state tracking, local-structure confirmation, ATR-normalized displacement confirmation, developing setup management, expiration logic, configurable historical reversal zones, and confirmation alerts.
The source code is published openly so users can inspect how each condition is calculated and modify the implementation for their own research. Indicateur
