Stock Breakout Momentum StrategyDescription
A breakout entry alone isn't a system, it's the first third of one. What happens after the breakout fires is what usually decides whether the equity curve goes up or down: does every close beyond a lookback high get traded, or only the ones with real trend and participation behind them? Does a winning trade get room to develop, or does it get cut off by an exit window built for a losing trade? This strategy answers both questions directly: breakout entries are screened by a trend filter and a volume filter before they're taken, and once in a trade, a fixed ATR profit target works alongside a trailing stop and a materially longer time-based exit — instead of the time exit doing double duty as the only thing standing between a trade and an open-ended hold.
The Breakout Trigger, Now Screened by Trend and Volume
The core signal is unchanged from a classic breakout: a long triggers when a bar closes above the highest high of a lookback window (20 bars by default); a short triggers on a close below the lowest low. The signal only evaluates on barstate.isconfirmed, so it reacts to a bar's final, settled value rather than an intrabar tick, a non-repainting design where the order is submitted on the confirmed signal bar and fills at the next bar's open. What's new is what has to be true alongside that close: an optional trend filter requires price to be above a 50-period SMA for longs (below it for shorts), and an optional volume filter requires the breakout bar's volume to exceed 1.2× its 20-period average. Both are on by default and both can be switched off independently: turning them off reproduces the original unfiltered breakout-only version, which is a useful baseline to compare against.
Why Two Confirmation Filters Instead of One
A breakout on a stock trading below its own trend line, or on below-average volume, is a weaker signal than a breakout with the reverse conditions, a common cause of a low win rate is a system taking every technically-valid breakout regardless of context. The trend filter keeps the strategy from fighting its own directional bias; the volume filter is a basic conviction check against thin, low-participation moves that are more likely to be noise than the start of a real trend.
A Trailing Stop That Only Moves in Your Favor
Once in a position, the stop is recalculated every bar as entry ATR × a multiplier (2.0 by default) behind price, but it only ever ratchets in the trade's favor, a long's stop can rise as price rises but can't be pulled back down on a pullback, and a short's stop mirrors that in reverse.
An Explicit Profit Target, Not Just a Trailing Stop
Earlier versions of this approach relied on the trailing stop as the only way to close a trade in profit, which meant a short exit window could cut a winning trade off before the stop had room to ratchet up. This version adds a fixed ATR profit target (3.0× ATR by default, set once at entry and left in place; it doesn't trail the way the stop does) placed alongside the stop as a bracket order. Paired with the default 2.0× ATR stop, that's a built-in 1.5:1 reward-to-risk skew: the strategy doesn't need a high win rate to be net positive, it needs winners to average meaningfully more than losers, which is what the target is there to enforce. This can be turned off entirely if you'd rather rely on the trailing stop alone.
A Longer Time-Based Exit
Trades that haven't been stopped out or hit target within a set number of bars are closed as a housekeeping measure, a fixed exit window is there to purge trades that have stopped developing rather than to signal a directional call. That window is now 20 bars by default rather than a handful, giving the trailing stop and profit target actual room to do their jobs before the clock forces a decision. Whichever of the three exit conditions: stop, target, or time is met first is what closes the trade.
Position Sizing Tied to Equity, Not a Fixed Share Count
Instead of trading a static number of shares, the strategy calculates how many shares fit within a configurable percentage of current account equity (100% by default) divided by the current share price, floored to a whole share count with a floor of one. Sizing compounds with account equity rather than staying fixed at the starting balance. A dedicated "Allow Short Entries" toggle exists because not every account can short every stock; turn it off to backtest and trade long-only.
A Note on Shorting and Margin
Short positions on equities require margin, and margin requirements for shorting are not the same as the cash-equivalent share count this script computes for sizing; real brokers generally require posting more buying power to hold a short than to hold an equivalent long. Sizing at 100% of equity while shorting is enabled can produce trades a real margin account would reject or forcibly liquidate before the strategy's own exit logic gets to close them on its own terms. If you intend to trade this live with shorting on, size conservatively (well under 100%) and confirm your broker's actual margin requirements rather than relying on this script's sizing as a margin calculation.
Backtest Realism Settings
The strategy ships with commission modeled at 0.05% and 2 ticks of slippage baked into every fill, pyramiding disabled, and no same-bar order fills: defaults chosen so Strategy Tester numbers reflect something closer to live execution rather than an idealized fill.
Timeframes and Instruments
Built for equities, and tested across multiple timeframes and symbols with meaningfully different results depending on the instrument's underlying trend regime during the test window — a stock that trended cleanly produced a very different outcome than one that chopped sideways over the same period, even with identical settings. Because the exit logic is bar-count based, results will also vary by timeframe: retest breakoutLength, trendLength, atrMultiplier, profitTargetATRMult, and barsInTrade together whenever you change timeframe rather than assuming the defaults transfer.
What to Examine in Backtesting
Because of the built-in 1.5:1 reward-to-risk skew, a win rate meaningfully below 50% can still be net profitable: check the Strategy Tester's average win versus average loss alongside the raw win rate rather than judging on hit rate alone.
Watch trade count relative to your test window: a strategy that only fires a handful of times over several months (which the trend and volume filters will produce, by design) needs a longer test period or a broader set of symbols before a positive or negative result says much about a real edge versus a lucky or unlucky stretch. Also check the Margin Usage tab specifically if shorting is enabled, and compare max drawdown against total return, a strategy that gives back most of an open gain before ending marginally positive is a different risk profile than one that climbs more steadily, even if the final number looks the same.
Shared for educational purposes. This is not investment advice. Backtest results, including any shown in this listing's chart or comments, reflect a specific historical period and instrument and are not a representation of future performance. Trading involves substantial risk of loss and is not suitable for all investors. Strategy

Market Structure Flow Map [BOSWaves]Market Structure Flow Map - Strength-Scored Curved Ribbon Visualization of Break of Structure and Change of Character Events
Overview
Market Structure Flow Map is a market structure event visualization system that renders each Break of Structure and Change of Character as a curved three-layer ribbon connecting the broken swing pivot to the bar where the break occurred, where ribbon thickness, glow intensity, and arc curvature are driven by a composite strength score derived from the displacement beyond the broken level and the relative volume at the break bar rather than applying uniform visual treatment regardless of the conviction behind each structural event.
Instead of marking BOS and CHoCH events with simple horizontal lines or static labels, this system renders each structural break as a curved polyline ribbon that physically connects the origin swing point to the breakout bar, with the ribbon's visual weight scaling continuously from the configured minimum to maximum width based on how far price moved beyond the broken level and how significantly above average volume was at the moment of the break. Wider, brighter ribbons represent high-conviction structural breaks with strong displacement and volume evidence. Thinner, more subtle ribbons represent marginal breaks that barely cleared the structural level with below-average participation.
This creates a market structure visualization where the visual record of structural history is encoded with conviction information rather than presenting all breaks as visually equivalent events. The curved arc geometry provides an immediate spatial reading of the distance between the origin swing and the break bar, with longer arcs indicating structural breaks that developed over more bars. The three-layer glow, body, and core rendering gives each ribbon depth and visual prominence scaled to its structural significance. And the circular node markers at each broken swing pivot anchor the ribbon origins to the precise structural prices that were violated.
Price structure is therefore presented not just as a sequence of labeled events but as a visually weighted conviction map where the strongest structural breaks are immediately identifiable by their visual dominance over weaker ones.
Conceptual Framework
Market Structure Flow Map is founded on the principle that not all structural breaks carry equal significance, and that a visualization system which presents every BOS and CHoCH with identical visual weight fails to communicate the most important information available at the moment of each break: how convincingly price moved through the structural level and whether that move was supported by meaningful participation.
Traditional market structure tools mark every qualifying break with the same line, label, or zone regardless of whether the break was a decisive high-volume displacement or a marginal low-volume close that barely cleared the level. This framework replaces uniform visual treatment with strength-scaled ribbon geometry where every visual property of the ribbon reflects the composite conviction of the underlying structural event, creating a chart where the structural history reads as a visual conviction hierarchy rather than a flat sequence of identical events.
Three core principles guide the design:
Each structural break should be rendered as a physical curved connection between its origin swing and its break bar, preserving the spatial and temporal relationship between the structural level that was violated and the moment of violation rather than abstracting the event to a horizontal line.
Ribbon visual weight should scale continuously with a composite strength score that combines displacement magnitude and volume significance, ensuring that the chart's visual hierarchy reflects the structural conviction hierarchy rather than being independent of it.
BOS and CHoCH events should be visually distinguished not only through color but through the arc geometry, with the ribbon curvature and length encoding the temporal distance between the swing origin and the break completion.
This shifts market structure visualization from event marking into conviction-weighted structural flow mapping where the cumulative visual record encodes the relative significance of every structural event in the chart history.
Theoretical Foundation
The indicator combines pivot high and low detection for swing origin identification, configurable close or wick break confirmation for structural break detection, displacement-based and volume-ratio-based strength scoring with configurable weighting, structural state tracking for BOS versus CHoCH classification, three-layer curved polyline ribbon construction with strength-scaled width and distance-adaptive arc height, and circular node markers at broken swing pivot prices.
Displacement strength is calculated as the distance from the broken level to the break bar's source price, normalized against an ATR multiple and capped at the configured maximum. Volume strength is calculated as the excess of the break bar's volume above average relative to the configured maximum ratio, with below-average volume bars receiving zero volume strength. These two components are combined using the configured dispWeight and volWeight parameters, normalized by their sum so the total always produces a 0-1 strength score regardless of the weight distribution chosen. The arc height scales with both ATR and the temporal distance between the swing origin and break bar, so ribbons connecting distant origin-break pairs curve more dramatically than ribbons connecting adjacent ones.
Four internal systems operate in tandem:
Swing Detection and State Engine : Identifies confirmed pivot highs and lows using the configurable lookback, tracks the most recent unbroken high and low with their bar indices and prices, classifies each qualifying break as BOS or CHoCH based on the current structural state, and updates the structural state on each confirmed break.
Strength Scoring System : Calculates displacement from the broken level normalized against ATR, calculates volume ratio normalized against the configured maximum, combines both components with configurable weights, and maps the result to a 0-1 composite strength score that drives all ribbon visual properties.
Curved Ribbon Rendering Engine : Constructs three-point curved polyline paths from origin to arc midpoint to break bar for each of the three ribbon layers, applying strength-derived width to the body layer, additive width to the glow layer, and subtractive width to the core layer, with arc height scaling by both ATR and temporal distance.
Label and Node System : Places circular node markers at each broken pivot price to anchor ribbon origins visually, places directional event labels at each break bar offset by a small ATR fraction, and enforces maximum event count limits across all object arrays independently.
This design ensures every structural event produces a visually complete conviction-weighted representation while the object management system maintains a clean configurable historical event window.
How It Works
Market Structure Flow Map evaluates price through a sequence of structure-aware and strength-scored processes:
Pivot Detection : Confirmed swing highs and lows are identified using the configured left-right bar symmetry requirement, updating the tracked last high and last low prices and bar indices on each new confirmation.
Break Source Selection : Depending on the break mode setting, either the close price or the bar's high and low extremes are used as the source for testing structural breaks, allowing either confirmed closing breaks or intrabar wick-based breaks to qualify.
Break Detection : On each bar, the bullish break source is tested against the last unbroken high and the bearish break source is tested against the last unbroken low. A qualifying break requires the current bar to have crossed the level while the previous bar had not, and the level must not have been broken previously since its last registration.
Structural State Classification : Bullish breaks during a bearish structural state classify as bullish CHoCH. Bullish breaks during a neutral or bullish state classify as bullish BOS. The same logic applies in reverse for bearish breaks, with structural state updating to the new direction on each confirmed event.
Displacement Strength Calculation : The absolute distance between the break source price and the broken level price is divided by the product of ATR and the configured maximum displacement multiplier, clamped to a 0-1 range.
Volume Strength Calculation : The excess volume above average is normalized by the configured maximum ratio minus one, clamped to a 0-1 range. Bars with below-average volume receive a volume strength of zero.
Composite Strength Derivation : Displacement and volume strengths are combined using the configured weights normalized by their sum, producing a 0-1 composite score that drives all ribbon visual properties.
Ribbon Geometry Construction : Three chart points are derived at the origin swing bar, the temporal midpoint between origin and break, and the break bar. The midpoint arc height is calculated from ATR, the arc ATR multiplier, a distance factor derived from the bar span, and the composite strength. For bullish breaks the arc curves above both endpoints; for bearish breaks below.
Three-Layer Ribbon Drawing : The glow layer renders at the body width plus five with high transparency. The body layer renders at the strength-scaled width with low transparency. The core layer renders at the body width minus two with a near-white color at low transparency, providing depth and brightness.
Node and Label Placement : A circular node is placed at the origin swing price and bar. A directional event label is placed at the break bar offset by a small ATR fraction above for bullish breaks and below for bearish breaks.
Object Count Management : All five object arrays are independently trimmed to the maximum event count by removing the oldest entries, maintaining a clean rolling window of the most recent structural history.
Together, these elements form a continuously updating market structure visualization where every structural event is rendered as a spatially accurate, conviction-weighted curved ribbon that communicates both the structural significance and participation quality of each break.
Interpretation
Market Structure Flow Map should be interpreted as a conviction-weighted structural event history where ribbon visual weight communicates break significance:
Bullish BOS Ribbon (Cyan) : Curved ribbon arcing upward from a broken swing high to the break bar, indicating a continuation structural break in the direction of the prevailing bullish structural state. Ribbon width reflects break strength.
Bearish BOS Ribbon (Red) : Curved ribbon arcing downward from a broken swing low to the break bar, indicating a continuation structural break in the direction of the prevailing bearish structural state. Ribbon width reflects break strength.
Bullish CHoCH Ribbon (Green) : Curved ribbon arcing upward from a broken swing high during a bearish structural state, indicating a potential trend reversal where price has broken bullish structure against the prior downtrend.
Bearish CHoCH Ribbon (Amber) : Curved ribbon arcing downward from a broken swing low during a bullish structural state, indicating a potential trend reversal where price has broken bearish structure against the prior uptrend.
Ribbon Thickness : The primary strength indicator. Thick ribbons represent high composite strength with strong displacement and above-average volume. Thin ribbons represent weak breaks that barely cleared the structural level with low participation.
Ribbon Arc Height : Reflects both ATR-relative volatility and the temporal distance between the swing origin and break bar. Tall arcs indicate breaks that developed over many bars or occurred during high-volatility conditions. Flat arcs indicate quick breaks between adjacent swings.
Glow Layer : The wide transparent outer layer provides visual prominence that scales with ribbon width, making the strongest ribbons immediately identifiable across the full chart view.
Core Layer : The bright near-white inner layer provides a luminous center line that reinforces the direction and curvature of each ribbon while adding visual depth to the three-layer geometry.
Structure Nodes (Circles) : Circular markers at each ribbon origin anchor the structural event to its precise swing price, making it clear which pivot level was broken to produce each ribbon.
Event Labels : BOS and CHoCH text labels at each break bar identify the event type with color coding matching the ribbon, providing a text-based reference that complements the visual ribbon hierarchy.
Colored Candles : Optional bar coloring reflects the current structural state, coloring cyan during bullish structure and red during bearish structure regardless of individual bar direction.
Ribbon width hierarchy, arc geometry, color coding, and node placement collectively communicate more structural conviction information than text labels alone.
Signal Logic & Visual Cues
Market Structure Flow Map presents four distinct event types across two structural break categories:
Bullish BOS : Cyan ribbon connecting a broken swing high to the break bar during an established bullish structural state, confirming continuation of the prevailing upward structural sequence.
Bearish BOS : Red ribbon connecting a broken swing low to the break bar during an established bearish structural state, confirming continuation of the prevailing downward structural sequence.
Bullish CHoCH : Green ribbon connecting a broken swing high to the break bar during a bearish structural state, signaling a potential reversal of the prevailing downward structural sequence.
Bearish CHoCH : Amber ribbon connecting a broken swing low to the break bar during a bullish structural state, signaling a potential reversal of the prevailing upward structural sequence.
Both BOS and CHoCH events can be independently toggled, allowing the chart to focus exclusively on continuation signals, exclusively on reversal signals, or both simultaneously.
Alert generation covers bullish and bearish structural breaks for systematic structural monitoring workflows.
Strategy Integration
Market Structure Flow Map fits within momentum-validated market structure and conviction-weighted structural analysis approaches:
Ribbon Width Prioritization : Assign greater analytical weight to thick, wide ribbons representing high-strength breaks. Thin ribbons from marginal low-volume breaks carry reduced structural significance and warrant more caution before acting on the direction signal.
CHoCH Reversal Framework : Use green and amber CHoCH ribbons as primary reversal identification signals, treating their appearance as the first confirmation that structural direction may be shifting. Subsequent BOS ribbons in the new direction following a CHoCH provide continuation confirmation.
BOS Continuation Framework : Use cyan and red BOS ribbons as trend continuation evidence within established structural regimes, with wider BOS ribbons providing stronger confirmation of sustained directional momentum.
Arc Length Context : Monitor ribbon arc lengths as a temporal context indicator. Short low arcs between adjacent swings indicate rapid structural progression. Tall arcs spanning many bars indicate structural breaks that required extended time to develop, which may reflect different momentum characteristics than immediate breaks.
Ribbon Density Assessment : The density and direction consistency of recent ribbons provides a visual structural momentum reading. A sequence of uniformly wide same-direction ribbons indicates sustained structural conviction. A mix of widths and directions indicates contested structure without clear dominance.
Multi-Timeframe Structure Hierarchy : Apply higher-timeframe structural state as directional bias context, using lower-timeframe BOS ribbons to time continuation entries within the structural direction established on the higher timeframe.
Technical Implementation Details
Structure Detection : Pivot high and low confirmation with configurable lookback and close or wick break mode selection
Strength Scoring : ATR-normalized displacement combined with SMA-normalized volume excess using configurable weights summing to a 0-1 composite score
Ribbon Geometry : Three-point curved polyline construction with distance-adaptive arc height scaling and strength-proportional line width across three layers
Classification Logic : Structural state tracking for BOS versus CHoCH identification with independent visibility toggles per event type
Object Management : Five independent arrays with configurable maximum event count enforced by oldest-first removal
Candle Coloring : Structural state-driven bar color applied to body, wick, and border independently
Performance Profile : Real-time execution on each confirmed bar with polyline and label objects created at event time and managed through independent array trimming
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Intraday structural flow mapping for scalping with shorter swing length for faster structural event detection on smaller swings
15 - 60 min : Session-level structural analysis with balanced swing length and moderate displacement and volume thresholds for meaningful event density across typical session structure
4H - Daily : Swing-level market structure visualization with longer swing detection for broader structural events that reflect significant trend-level breaks
Suggested Baseline Configuration:
Swing Length : 8
Break Confirmation : Close
Volume Average : 20
Displacement Weight : 0.6
Volume Weight : 0.4
Ribbon Arc (ATR×) : 0.7
Maximum Events : 35
Show BOS : Enabled
Show CHoCH : Enabled
Show Structure Nodes : Enabled
Color Candles : Disabled
These suggested parameters should be used as a baseline; their effectiveness depends on the instrument's swing frequency, typical displacement characteristics, and preferred structural event density, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Too many structural events firing : Increase Swing Length to demand more structurally significant pivot confirmation, reducing the frequency of detected breaks, or switch Break Confirmation to Close to filter out wick-based marginal breaks.
Structural events too infrequent : Decrease Swing Length toward 2 for more sensitive pivot detection, or switch to Wick mode to capture structural breaks that close below the level but print a wick through it.
All ribbons appearing similar width : Adjust Max Displacement ATR and Max Volume Ratio to calibrate the scoring thresholds to the instrument's typical break characteristics. If most breaks exceed the maximum thresholds the scoring range collapses and all ribbons appear near maximum width.
Volume scoring not contributing : Decrease Max Volume Ratio to make above-average volume easier to achieve on the scoring scale, or increase Volume Weight to give volume a larger proportion of the composite score.
Ribbons too flat or too curved : Adjust Ribbon Arc ATR to scale the arc height. Lower values produce flatter, more linear ribbons. Higher values produce more pronounced curves, particularly on breaks that span many bars.
Too many ribbons cluttering the chart : Reduce Maximum Events to limit the historical ribbon count, or reduce Swing Length to produce more frequent events that each span shorter temporal distances, resulting in smaller arcs and less visual overlap.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets with clear directional structural sequences where BOS ribbons accumulate in the trend direction and CHoCH ribbons mark definitive reversal points with distinct visual separation from the preceding BOS sequence
Instruments with consistent volume participation where the volume scoring component produces meaningful differentiation between high-conviction and low-conviction breaks rather than uniform low scores
Market structure-based trading approaches where the visual conviction hierarchy of ribbon widths provides immediate differentiation between structural breaks worth acting on and marginal breaks warranting caution
Multi-timeframe structural analysis where the ribbon history provides a visual structural narrative that communicates trend progression, reversal identification, and conviction levels simultaneously
Reduced Effectiveness:
Choppy, range-bound markets where frequent alternating BOS and CHoCH events in both directions produce a dense mixed-color ribbon cluster without a clear structural narrative
Low-liquidity instruments where volume is consistently below average, suppressing volume strength scores and causing most ribbons to render at or near minimum width regardless of structural significance
Markets with very large or small typical ATR ranges where the arc height calculations produce ribbons that are either too flat to read or that arc so dramatically they dominate the visible chart area
Extremely fast-moving markets where structural breaks occur on single large bars that span large price distances, producing short temporal ribbons that offer limited visual differentiation from one another
Consolidation environments where price oscillates between two nearby swing levels without establishing clear directional structural progression, generating frequent opposing CHoCH events without the sustained BOS sequences that define clear structural trends
Integration Guidelines
Confluence : Combine with BOSWaves volume flow tools, order flow analysis, or momentum indicators to validate high-strength CHoCH and BOS ribbons with broader analytical context before committing to structural direction trades
Width Hierarchy Respect : Build a ribbon width filter into your analysis workflow. Thin ribbons from marginal breaks should be treated as weak structural evidence requiring additional confirmation. Thick ribbons from high-displacement high-volume breaks warrant greater directional confidence.
CHoCH Sequencing : A single CHoCH ribbon is not sufficient confirmation of a structural reversal in isolation. Wait for a subsequent BOS ribbon in the new direction to confirm that structural momentum has genuinely shifted before treating the CHoCH as a completed reversal.
Arc Geometry Reading : Use ribbon arc height as a secondary strength indicator. Tall arcs on strong ribbons indicate breaks that developed over many bars with sustained momentum. Short arcs on strong ribbons indicate rapid decisive breaks that required minimal time to complete.
State Discipline : Maintain structural bias aligned with the current state established by the most recent CHoCH until a new CHoCH in the opposing direction confirms a structural shift. Individual BOS ribbons within an established trend do not alter the structural regime and should be interpreted as continuation rather than reversal evidence.
Disclaimer
Market Structure Flow Map is a professional-grade market structure visualization and conviction-weighted structural event analysis tool. It uses pivot-based break detection with composite displacement and volume strength scoring but does not predict future price movements. Results depend on market conditions, instrument structural characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates order flow context, volume analysis, and comprehensive risk management. Indicator

Trend Survival MatrixMost trend tools tell you which way the trend is going, but not how late you are in it. The Trend Survival Matrix answers that directly. It tracks the live trend across three timescales (short, medium, and long EMA regimes) and measures each one's age — the number of bars since it last flipped. Then, from every completed trend in the chart's history, it builds an empirical run-length distribution and estimates a conditional survival probability: the odds the current trend lasts at least 5, 10, or 20 more bars given how long it has already run. Crucially, those odds are conditioned on the volatility regime each historical run was born in (low / normal / high ATR-percentile buckets), so a long, calm trend isn't judged against runs that formed in chaotic conditions.
The panel reads left to right: direction, current age, the typical (median) run length for that regime, survival odds at each horizon, and a maturity state — FRESH, HEALTHY, MATURING, EXTENDED, or EXHAUSTION — driven by an overextension z-score (how many standard deviations the current age sits above the historical mean). On the chart, a ribbon between the primary EMA pair tints by direction and fades as survival decays, so a durable trend looks solid while a fragile, overextended one visibly thins out. Markers flag new trends, and a once-per-run label warns when survival drops below your threshold — useful for deciding whether to add, tighten stops, or prepare to fade.
Everything is empirical and inspectable — the survival figures come straight from the instrument's own history, not a black box or preset numbers. The engine is fully non-repainting (state advances only on confirmed bars, with no higher-timeframe requests), so the readings stay stable when you switch chart timeframes. Where there aren't enough historical samples to condition on, the panel honestly reports LOW DATA and a confidence flag rather than showing a made-up probability. Works on any symbol and timeframe; tune the EMA lengths, horizons, and volatility buckets to your market. Indicator

Range Budget - Anchored Extension and Daily Range Exhaustion============================================================
DESCRIPTION
============================================================
Range Budget measures how much of a typical daily range has
already been delivered, and how far the current directional
leg has travelled, so that a level can be assessed on distance
as well as location.
The problem it addresses is a common one in level-based
trading. A level is identified in advance, price arrives, and
the setup is taken without accounting for how far price
travelled to get there. A level reached after a move that has
already covered a full day's range is a materially different
proposition from the same level reached after a quiet drift,
even though the level itself is identical. This script
quantifies that difference.
WHAT IT CALCULATES
Anchor and extension
The anchor is a chosen session open: the CME open at 18:00,
midnight, 08:30, or the regular session open at 09:30, all in
the selected timezone. The anchor is detected by tracking
minutes elapsed since the anchor time with wraparound across
midnight; a decrease in that value marks a new anchor period.
An optional gap check re-anchors at the Sunday reopen rather
than carrying the prior Friday value through the weekend.
Extension is the signed distance in points from the anchor
open to the current close. Session high and session low are
tracked from the anchor forward.
Leg travel
Up leg is the distance from the session low to the current
close. Down leg is the distance from the session high to the
current close. These are reported separately from extension
because extension understates a move that opened, reversed,
and then ran. A session that opens, falls forty points and
rallies eighty shows an extension of plus forty while the leg
being entered is eighty points old. The two readings answer
different questions: extension describes location relative to
the open, leg travel describes how much of the current move
has already occurred.
Daily range statistic
The denominator is a trailing statistic of daily high minus
low, taken from completed daily bars only. A one-bar offset is
applied inside the higher timeframe request so the forming day
is excluded from its own benchmark. The statistic is constant
intraday by construction.
Three methods are available. The default is the median rather
than the mean. Daily range distributions are right skewed and
a single outlier session, or a holiday half-day, shifts a mean
for the entire length of the window while barely moving a
median. Mean and exponential options are provided for users
who prefer them.
Range basis can be set to the full exchange day or to the
regular session only, which changes both the statistic and the
current day measurement consistently.
Budget and projections
Budget is today's realised daily range expressed as a
percentage of the denominator, displayed as a ten segment
gauge. Projections are drawn at the day low plus the
denominator and the day high minus the denominator. Room
reports the distance in points from current price to each
projection. This formulation is used in preference to
projecting symmetrically from the open because it accounts for
what the session has already delivered rather than assuming
the open sits at the centre of the eventual range.
Regime ratio
A rolling median range over a short window is divided by the
same statistic over the long window. Volatility expands far
faster than a fixed lookback adapts, so on the first day of a
changed environment the long window is still describing the
previous one. The ratio detects that condition immediately
rather than after the window has turned over. Values above the
expansion threshold indicate the short window is the more
representative reading.
State
The state row combines budget and regime. Budget beyond one
hundred percent is ambiguous in isolation: it can mean the day
is finished, or it can mean the denominator is stale. When
budget exceeds the exhaustion threshold and the regime ratio
is simultaneously elevated, the state reports expansion rather
than exhaustion, because the appropriate reading in that case
is a trending environment rather than a completed one.
Pullback levels
Optional retracement levels are drawn at configurable
percentages of the leg delivered since the anchor, measured
back from the extreme in the direction of travel.
WHAT IT DRAWS
A vertical line marking the anchor boundary, with a
configurable number of prior boundaries retained as session
separators.
A horizontal line at the anchor open, plus dotted session high
and low lines, each labelled with price and points from the
open. These are drawn for the current anchor period only and
are rebuilt at each new anchor, so historical periods do not
accumulate on the chart.
Three compact daily candles to the right of the last bar
showing the forming day and the two prior days. They are drawn
at true price levels, so they also serve as visual references
for the previous day high, low and close. The forming day
carries a dashed border and updates live.
Optional projection and retracement lines, both off by
default.
A panel reporting anchor open, extension, session range, up
and down leg with their share of the denominator, the budget
gauge, room to each projection, the denominator with its
method and window stated, the regime ratio, and the state.
Leg cells are colour graded against the exhaustion thresholds.
SETTINGS NOTES
Three separate lookback windows are used and they drive
different things. The slow window drives the denominator, the
gauge, the projections and room. The fast window drives only
the regime ratio. The context window drives only the minimum,
maximum and quartile rows, where responsiveness does not
matter.
A manual denominator override is provided. It exists for the
first session after a clear regime break, when the operator
knows the environment has changed and the window has not yet
caught up.
READING IT
The leg readings graded against the denominator are the
primary output. A leg at or beyond one hundred percent means a
full typical day's range has been delivered in one direction.
Room reports whether a target has space remaining even if the
directional read is correct.
The denominator is a range statistic, not a displacement
statistic. It describes the height of the envelope a session
typically builds, not how far price travels within it, and net
close to close movement is normally much smaller. A setup
requiring a large fraction of the typical envelope in a single
directional leg is an expansion day proposition rather than a
normal day proposition.
LIMITATIONS
This is a context readout. It produces no entries, no
directional bias and no filtering output, and it is not
intended to confirm or reject a setup on its own.
Leg readings measure distance, not recency or velocity. A leg
reset occurs whenever a new session extreme is made, so a leg
built slowly overnight and a leg built rapidly in the last
half hour produce identical readings.
No time of day weighting is applied. A given percentage of
range consumed early in a session and the same percentage late
in a session are not equivalent situations, and the script
does not currently distinguish them.
The denominator lags a genuine volatility regime change by at
least one session. The regime ratio shortens that lag but does
not eliminate it.
Compact daily candles are drawn at true price levels, so on a
strongly zoomed intraday chart the prior days may fall outside
the visible price scale. Indicator

Indicator

TradeGuard-v0.5TradeGuard-v0.5 | Complete Options Trading System
⚠️ This is the only active version. All previous versions (v0.1, v0.2, v0.3, TradeGuard Full, TradeFlow Full System) are retired and no longer maintained. Remove old versions from your chart and add this one.
What is TradeGuard?
Built from scratch after losing money with a 72.5% win rate. The problem wasn't entries — it was exits and holding losers too long. TradeGuard is designed around one core idea: stop the trader from destroying their own edge. It reads market structure, institutional footprints and multi-timeframe alignment automatically so you can focus on executing, not analysing.
CORE SIGNALS
Trend Detection — fully automatic
Triple EMA system 13/48/200 in yellow/purple/red. Automatically reads UPTREND, DOWNTREND or CHOPPY. No manual input required.
BUY CALL / BUY PUT
Six entry types fire automatically — 13 EMA pullback, EMA reclaim, PMH/PML retest, PDH/PDL retest, ORB retest, liquidity sweep. All require trend + volume confirmation. Labels fire once on state change only — not every bar.
CUT CALL / CUT PUT
Fires the moment the EMA breaks. 0DTE mode uses 3-bar no-bounce rule — doesn't wait for candle close because theta doesn't wait. Weekly mode waits for candle close confirmation.
CONFLUENCE SCORING 0-10
Counts how many of 10 factors align before firing. 7+ = ★★★ label on chart, size up. 5-6 = ★★, normal size. Below 5 = silent. Stops you from entering weak setups that only have 2-3 things going for them.
LIQUIDITY SWEEP DETECTION
SW diamond fires when stops have been taken and institutions have entered. Four sweep types: PDH/PDL sweeps, PWH/PWL sweeps, EMA sweeps, equal highs/lows. The reversal after a sweep is sharper because weak hands are cleared out. Combining a sweep with 7/10 confluence is the highest probability setup in the system.
ORDER FLOW APPROXIMATION
Four signals reading the institutional footprint on price and volume. No Level 2 or DOM required.
🐟 Big Fish — Large institution filled an order here. High volume, tiny range = someone absorbed all the flow without moving price. That's a large fill.
W Wall — Big money blocking the move. Price keeps hitting same level with above average volume but cannot break through. Wall below = hidden buyer = CALL bias. Wall above = hidden seller = PUT bias.
Hidden — Iceberg order sitting at this level. Same price tested multiple times with volume, each time bouncing back. The order never runs out because it keeps refreshing.
F Flip — Big money changed direction. High volume reversal candle after a trending move. Institutional size switched sides.
The full sequence: Hidden → Wall → Big Fish at same level = institution finished accumulating or distributing. Label fires: "CALL SETUP BUILDING" or "PUT SETUP BUILDING". Add a sweep and 7/10 confluence = highest probability trade in the system.
REGIME QUALITY SCORE 0-6
Structural score before any entry fires: 2m trend, 5m aligned, 15m aligned, VWAP position, no squeeze, clean session time. LOW regime blocks all entries and tells you exactly what's missing.
KEY LEVELS — all automatic
PMH/PML — premarket high/low (orange)
PDH/PDL — previous day high/low (yellow)
PWH/PWL — previous week high/low (bright yellow, thick) ← most important for weekly options
ORB — opening range with 50%, 1.5x, 2x extensions (aqua)
Intraday fibonacci 0.5 and 0.618
Today's high/low
MTF Key Levels
Previous day/week/month OHLC + equilibrium levels (pdEQ, pwEQ)
Current week/month/year high/low
Y-VWAP (red, thick) — yearly institutional bias line
GEX Proxy Levels
~Flip — gamma flip proxy. Above = pinned/mean-reverting. Below = volatile/trending
~CW / ~PW — nearest $5 round number call wall / put wall proxy
Orange background when negative gamma (trending environment)
ASIA + LONDON SESSION BIAS (SPY/QQQ/indices only)
Shaded backgrounds for each session. Bias label at 9:30am open. London sweep detection — when London sweeps Asia lows and reverses, that's the strongest call setup of the session.
CHART PATTERNS
Bull flag, bear flag breakouts detected and shown in Pattern table row.
STATUS TABLE — 26 rows
Updates live every bar. Trend, EMA, VWAP, Volume, Squeeze, PMH/PML, PDH/PDL, Session, Order Flow, ORB, Pattern, 5m trend, 15m trend, Confluence, Signal, Regime, Gamma, Flip, Asia bias, London bias, US bias, Swing bias, Y-VWAP, Expiry suggestion, Stalled.
ALERTS
40+ alerts including: BUY CALL/PUT, CUT CALL/PUT, HIGH/GOOD confluence, all sweep types, all order flow signals, Y-VWAP cross, PWH/PWL break, MTF level touches, pattern breakouts.
ONE TOGGLE ONLY — 0DTE or Weekly mode. Everything else is automatic.
Best on 2-minute chart for entries. Table provides full higher timeframe context.
~ prefix on GEX labels = structural approximations, not live options chain data. Indicator

Macro Risk Sentinel🛡️ Macro Risk Sentinel: Smart Crash Detector & Trend Filter
The Macro Risk Sentinel is a powerful risk management tool built to protect your trading from sudden market dumps. Instead of relying on lagging price indicators, this script looks under the hood of the market—tracking hidden credit health and volatility data—to spot panic before it destroys your chart.
Whether you trade manually or run automated algorithmic swing trading strategies, the Sentinel acts as a safety switch.
⚙️ How It Works: The "Smart Recovery" System
Most crash indicators lock you out of the market for way too long, making you miss the most profitable part of the rebound. We fixed this with our built-in Smart Recovery logic.
🔴 Red Zone (Lockdown): Real market panic detected. The indicator turns your chart background red, signaling a strict "Risk-Off" state. It's time to cut longs or pause your trading bots.
🟡 Yellow Zone (Caution): Early warning signs. The market is getting choppy. This is your cue to tighten stop-losses and reduce position sizes.
🚀 Smart Unlock: The game-changer. While in a lockdown, the Sentinel constantly monitors the market in the background. As soon as volatility drops and a healthy price trend begins, it fires a "Smart Unlock" signal. You get the green light to jump back in exactly as the new uptrend starts, without waiting for a blind timer to run out.
✨ Key Features
Under-the-Hood Data: Driven by real market stress metrics (Volatility and High-Yield Credit ratios), not just simple moving averages.
100% Backtest Safe (No Repaint): Built with strict causal logic and zero lookahead bias. What you see on historical bars is exactly what would have printed live, making it perfectly safe to build automated strategies around.
Clean Live Dashboard: A simple, non-intrusive panel on your chart shows the current market state, the recovery conditions, and the lockdown countdown at a glance.
Visual Clarity: Intuitive background colorings and clear chart markers (Crash ⛔, Smart Recovery 🚀) so you never have to second-guess the market environment.
Fully Customizable: Easily tweak the trigger thresholds and lockdown duration to match your specific trading style and risk tolerance.
🎯 Perfect For:
Algorithmic traders who need a "kill switch" for their automated systems.
Swing traders tired of getting caught and holding bags during sudden market crashes.
Systematic traders looking to automate their risk-on/risk-off rules based on hard data. Indicator

Trend Dashboard - Direction and StrengthTrend Dashboard - Direction and Strength.
A single compact table that reads eleven trend, momentum, volatility, structure and volume-flow indicators on up to four timeframes at once. The directional readings are condensed into a score and a categorical verdict for each timeframe, while trend strength is reported separately by the ADX row and never enters the sum, so direction and strength stay two distinct answers. Built for top-down traders who want the confluence check they normally perform by switching charts to happen in one place, on the chart they are already trading.
How it works:
Every indicator for a given timeframe is computed inside one function and delivered by a single request.security call per timeframe, with lookahead disabled, so the table never reads data that was not available at the time of the bar. The four timeframe slots are user-assigned and default to daily, 4 hours, 1 hour and 5 minutes. Column headers are derived from the assigned timeframe itself, so reassigning a slot relabels the column. Market structure is delivered by a second request per timeframe: it tracks confirmed swing highs and lows over a configurable pivot window, registers the direction of the last break, and counts how many continuation breaks have followed the last change of character.
The table is rebuilt on the last bar only and cells are wiped before each refill, so toggling a timeframe off cannot leave stale values in a column that has shifted. Rows are ordered by the weight of the information they carry: structural context first, then macro regime, then medium-term structure, momentum, strength and the local price position, followed by the three context rows and the score and verdict at the bottom. A marker column carries a coloured dot for rows that must not be read as ordinary trend votes: orange for mandatory context that stays outside the score, white for indicators running on simplified parameters or on an approximation, blue for market structure. The script also detects whether the symbol reports volume. On symbols with no volume feed, cumulative volume delta and OBV divergence print a dash instead of a neutral reading, and the volume delta vote is dropped from the score, which lowers the maximum from eight to seven while the verdict thresholds stay absolute.
What it calculates:
- Market structure — direction of the last swing break, with a phase suffix (C, C+1, C+2 and higher) counting continuation breaks since the last change of character.
- EMA mid/slow — macro regime, the golden and death cross relation.
- EMA fast/mid — medium-term trend structure.
- SuperTrend — ATR trailing direction, computed from a configurable ATR length and factor.
- Ichimoku Kumo — price against the cloud built from the 9, 26 and 52 bar ranges.
- MACD — bullish only when the MACD line leads the signal line and the histogram agrees.
- RSI — directional reading around the midline, with the raw value shown in the cell.
- CVD — cumulative volume delta approximated from the position of the close inside the bar range, read as the agreement between flow slope and price slope.
- Price vs fast EMA — the local position of price, the most sensitive of the trend votes.
- ADX and DMI — trend strength with the raw ADX value shown in the cell, and direction from the DMI pair once the threshold is met.
- OBV divergence — price extreme of the window not confirmed by cumulative volume.
- RSI divergence — price extreme of the window not confirmed by momentum.
- Score — the sum of the eight directional votes per timeframe, shown against the maximum available on the symbol.
- Verdict — STRONG BULL, BULL, MIXED, BEAR or STRONG BEAR, derived from absolute score thresholds.
Key features:
- Four independently assignable timeframe slots, each with its own visibility toggle. Hidden columns shift the remaining ones left and are excluded from the alignment alerts.
- Column headers derived from the assigned timeframe, formatted as 1D, 4H, 1H, 5M rather than fixed labels.
- Separation of directional votes from context. Market structure, ADX and the two divergence rows are displayed but never summed into the score, so trend strength and reversal warnings are not confused with direction.
- Automatic handling of symbols without volume: the affected rows print a dash and the score maximum drops to seven, with verdict thresholds left absolute.
- Per-row tooltips that state what the indicator measures, how to read the three states, its role inside the system and its known failure modes.
- Configurable parameters for every indicator: EMA lengths, RSI length and thresholds, MACD triplet, ADX length and threshold, SuperTrend ATR and factor, CVD lookback, OBV and RSI divergence windows, and the market structure pivot window with a choice between candle close and wick confirmation.
- Ten alert conditions: a bullish and a bearish verdict transition for each of the four timeframes, plus full bullish and bearish alignment across all visible timeframes.
- Table position and text size selectable, with all signal and table colours exposed as colour inputs.
Who it's for:
Trend followers, swing traders and intraday traders who work top-down and want the higher timeframe bias, the execution frame and the entry frame visible at the same time. It suits price-action and SMC or ICT workflows that treat break of structure and change of character as the primary context, and momentum-based approaches that need a strength filter before acting on a directional signal. The outcome is one table that answers whether a trend exists, which way it points on each timeframe, and where the timeframes disagree, without stacking a dozen overlays on the chart. Indicator

Consolidation Ranges [ITA]🟠 OVERVIEW
Consolidation Ranges finds the places where price stopped trending and went sideways, draws the range while it forms, marks the bar that closes outside it, and then keeps watching to see whether that breakout actually held.
Finding a sideways range is the easy half. Every tool in this category draws the box and marks the breakout, and then stops, which is where the trader's real problem starts. The most common complaint about trading ranges is that the breakout fails and price comes straight back in, and almost nothing measures how often that happens.
So this one waits. After a breakout it gives price a set number of bars to stay outside. Close back inside within that window and the breakout is marked Failed. Stay out and it is marked Held. The running count of both sits in the corner.
🟠 CONCEPTS
* Consolidation - A stretch of bars whose full high to low span stays inside a chosen multiple of ATR. Measuring the range in ATR rather than in points means the same setting behaves the same way on a quiet symbol and a volatile one.
* Range Widening - While price stays inside, the box grows to contain each new bar, but only while the result is still narrow enough to count as a range. Without that limit a slow drift never breaks out, it just drags the box along with it.
* Breakout - The first close outside the box. The close matters rather than the wick, because a wick outside a range is the thing that most often reverses.
* Confirmation Window - The number of bars a breakout is given to prove itself.
* Held and Failed - What actually happened. Held means price stayed outside for the whole window. Failed means it closed back inside the range it had just left.
🟠 FEATURES
🔹 Range width measured in ATR, so one setting works across symbols and timeframes rather than needing to be retuned for each
🔹 The box builds live as the range develops and locks on the bar that breaks it
🔹 Breakouts marked in both directions at the price where the close happened
🔹 Every breakout followed to an outcome and labelled Held or Failed
🔹 A running count of held against failed breakouts, with the rate, for the symbol and timeframe on screen
🔹 Separate alerts for a break up, a break down, a failed breakout and a held breakout
🔹 If the settings are strict enough that nothing is found, the chart says so and names the two inputs to change, rather than leaving you looking at an empty chart unable to tell a quiet symbol from a bad setting
🟠 HOW TO USE
Set Range Length first. It decides how significant a consolidation has to be before it is drawn at all. Twenty bars is a reasonable starting point on any timeframe. Raise it for fewer and larger ranges.
Max Width is the second control. If nothing is being found on a volatile symbol, raise it. If the whole chart is boxes, lower it.
Then read the count in the corner before anything else. It is telling you whether breakouts on this symbol and timeframe have been worth taking. A symbol where most breakouts failed is not a symbol to trade breakouts on, and that is worth knowing before the next one rather than after it.
Bars To Confirm decides how patient the measurement is. A short window counts quick reversals as failures. A longer one only counts a breakout as failed if price genuinely came back.
🟠 CONCLUSION
Drawing the range is the part every tool does. The part that decides whether the range was worth trading is what happened after the break, and that is what this one records. Indicator

Global Net Liquidity - (Giovanni Fork)Hello traders. This plots the combined balance sheets of the Fed, ECB, BoJ, PBoC and Bank of England, converted to dollars, with the US Treasury General Account and the Fed's reverse repo facility subtracted.
There are already a lot of global liquidity scripts on here, so I want to be clear about what this one does differently rather than just adding another overlay to the pile. Three things.
First, this is a net measure.
Gross central bank assets tell you how much money has been created. They do not tell you how much of it is actually available, because some of it gets created and then taken straight back out of circulation. Money sitting in the Treasury's account at the Fed is not in the system. Nor is cash parked overnight in the reverse repo facility. Subtracting those gives you what is genuinely out there, and that is what net means here. At the time of writing it is 0.97tn in the TGA coming off a gross of 22.37tn.
It is also worth saying that this is built from central bank balance sheets rather than M2. Those are related but they are not the same measure, so if you are comparing this against something else, check which one you are looking at.
Units are worth paying attention to when you combine feeds like this. The underlying sources do not agree with each other: FRED publishes the Fed balance sheet in millions and the reverse repo facility in billions, and the China balance sheet is reported in hundred millions of yuan. TradingView appears to normalise all of them to absolute units before serving them, which is why every scale factor in this script is 1.
I would still rather you checked than took my word for it. Every series has its own visible scale factor and the table prints each component in USD trillions, so you can compare the numbers against what you know the Fed and the ECB are actually running. If a row looks wrong by orders of magnitude, that series' scale input is wrong and you can correct it in the settings without touching the code.
Second, China is measured properly.
The PBoC balance sheet is a poor gauge of Chinese liquidity and most aggregates include it anyway. Its growth up to 2014 was foreign exchange accumulation rather than stimulus, so the series has meant different things in different decades. More importantly, the PBoC's main easing tool is the reserve requirement ratio, and that is balance sheet neutral. Cutting the RRR reclassifies required reserves as excess reserves, releasing roughly 1 trillion yuan per 50bp, while total assets do not move at all. The biggest thing the PBoC does is invisible to a balance sheet aggregate.
The default here subtracts required reserves, estimated as the reserve ratio applied to M2 as a deposit proxy, so an RRR cut registers as the easing it actually is. You can switch back to the plain balance sheet or to the commercial bank balance sheet in the settings. It is an approximation because China's RRR is tiered across large, small and rural banks and the headline rate only covers the large ones, but it responds to the right events.
Third, and this is the part I think adds most, the currency effect is separated out.
Every aggregate that converts foreign balance sheets at spot has dollar moves baked into it. A stronger dollar shrinks the line even when no central bank has done anything, and that gets reported as tightening.
The purple line is the same aggregate chain linked at constant currency. Each period's balance sheet change is converted at that period's own opening rate and accumulated, so it shows what the balance sheets did without the currency. The shaded gap between the two lines is the currency effect, and the table gives it as a number. Since January 2016 it is 1.56tn, meaning that much of the apparent decline in global liquidity was dollar strength rather than central bank action.
The BoJ is the clearest example. Its assets have grown in yen over recent years while its reported dollar contribution has fallen sharply. A gross liquidity chart reads that as the BoJ tightening. It didn't tighten, the yen moved.
A few things to be aware of before you use it.
The chain start date is January 2016 by default and it matters. The constant currency line is accumulated rather than measured, so it seeds at that date and the two lines are identical there by construction. The currency figure is always cumulative since the start date, so 1.56tn means since January 2016, not in absolute terms. Set the date later if you find a component with no data at the start.
The TGA and RRP are US specific drains applied to a global gross, which is slightly inconsistent. Everybody does it, few say so, so I am saying so.
The underlying data updates weekly at best and the PBoC monthly, so use this on daily or higher. Intraday just repeats the last print.
I built this because I wanted to know how much of the last three years of liquidity contraction was real and how much was the dollar. If it is useful to you, say so, and if you think I have got something wrong let me know. Indicator

Delta Trend Delta Trend is a momentum and directional-trend indicator designed to measure the relative movement of price between the open and close of each candle. It converts the percentage change within each candle into a smoothed Delta Line, allowing traders to identify whether short-term price momentum is strengthening or weakening.
The indicator uses the relationship between the candle's Open and Close to calculate its raw directional movement. This value is then smoothed using a Weighted Moving Average (WMA) and multiplied by an adjustable Delta Adjust factor. The resulting Delta value provides a normalized representation of short-term price momentum.
How the Delta is calculated
The raw calculation is:
(Close − Open) / (Close + Open)
This measures the directional movement of the current candle relative to its overall price level.
The raw value is then smoothed using the selected Delta Smooth period and multiplied by the Delta Adjust setting:
Delta = WMA(Raw, Smooth) × 100 × Adjust
A higher Delta indicates stronger positive price momentum, while a negative Delta indicates bearish price momentum.
Delta Trend
The indicator compares the current Delta value with the previous Delta value.
Rising Delta → momentum is increasing or strengthening.
Falling Delta → momentum is decreasing or weakening.
The Delta Line is displayed in:
White when Delta is rising.
Red when Delta is falling.
This allows the trader to see changes in momentum visually without relying solely on whether price itself is moving up or down.
Zero Line and Thresholds
The indicator includes several reference levels:
0 — the primary bullish/bearish dividing line.
0.3 — an early positive-momentum threshold.
3 — a stronger positive-momentum threshold.
The area behind the indicator is shaded blue whenever Delta is zero or above, providing a quick visual indication that momentum is on the positive side of the zero line.
Delta Table
A table in the upper-right corner displays the current Delta value.
The table changes its background according to the strength of Delta:
Delta ≥ 5 → strong positive momentum.
Delta > 0 → positive momentum.
Delta ≤ 0 → negative momentum.
This gives the trader an immediate numerical reading of current momentum.
Alerts
The indicator contains alerts for both the direction and strength of Delta.
Trend alerts
Buy — Delta Line Rise
Triggered when Delta is rising compared with the previous candle.
Sell — Delta Line Fall
Triggered when Delta is falling compared with the previous candle.
Delta-level alerts
The indicator also provides bullish/bearish conditions around:
10
5
3
0.3
0
These thresholds allow traders to monitor different levels of momentum strength.
For example, a Delta above 5 represents considerably stronger positive momentum than simply being above zero.
Overall Interpretation
The Delta Trend indicator can be viewed as a short-term momentum and momentum-direction tool.
Its readings can be interpreted broadly as:
Positive Delta + Rising Delta
→ Positive momentum is strengthening.
Positive Delta + Falling Delta
→ Momentum remains positive but is weakening.
Negative Delta + Falling Delta
→ Negative momentum is strengthening.
Negative Delta + Rising Delta
→ Bearish momentum is weakening and a potential momentum transition may be developing.
The combination of the Delta level and the direction of the Delta Line is therefore more informative than either one by itself.
Example
If the indicator shows:
Delta = +6.2x
Delta Line = Rising
this suggests that the current smoothed price momentum is strongly positive and is increasing.
If it subsequently changes to:
Delta = +4.1x
Delta Line = Falling
the momentum is still positive, but its strength is declining.
If Delta eventually moves below 0, the indicator has transitioned into negative momentum.
Important Limitation
Delta Trend should not be interpreted as true order-flow or buy/sell volume delta.
Unlike an exchange-provided bid/ask delta, this indicator does not measure actual buyer-initiated versus seller-initiated trades. It derives its value entirely from the relationship between open and close prices.
Therefore, it is more accurately described as a smoothed price-momentum/directional-pressure indicator, rather than a true volume-delta indicator.
In simple terms
Delta Trend answers two questions:
1. Is price momentum positive or negative?
and
2. Is that momentum getting stronger or weaker?
The Delta value tells you the approximate strength of the momentum, while the rising/falling state of the Delta Line tells you whether that momentum is increasing or decreasing.
Indicator

Multi-Timeframe Hull Moving Average (HMA) Candle Projection### Overview
The **Multi-Timeframe Hull Moving Average (HMA) Candle Projection** is a lightweight, clean chart overlay designed for traders utilizing multi-timeframe analysis.
Instead of traditional higher timeframe candlestick data, this tool applies a **Hull Moving Average (HMA)** calculation directly to the Open, High, Low, and Close (OHLC) values of a higher session. This extracts the noise-filtering benefits of a Hull Moving Average while still structuring the resulting data into recognizable candle bodies and wicks.
### Key Features
* **Live Sidebar Projection:** Rather than plotting blocks directly on top of your current price chart, this script cleanly isolates the real-time higher timeframe Hull candle to the right margin of your layout. This keeps your execution window clutter-free.
* **Lag Minimization:** By processing structural candle boundaries through the Hull formula, it smooths out higher timeframe data without introducing the heavy lag associated with standard simple moving averages.
* **Pine Script v6 Compliant:** Rewritten using the strict syntax rules of version 6 to ensure rapid rendering and seamless compatibility with modern TradingView engine performance metrics.
### How to Read & Use
1. **Trend Identification:** When the projected candle body is green, the higher timeframe Hull trend is bullish (Close >= Open). When it is red, the higher timeframe Hull trend is bearish (Close < Open).
2. **Top-Down Coordination:** This is highly effective for filtering micro-execution charts against macro-trends. For example, look for long setups on a 5-minute chart only when the 15-minute or 1-hour projected Hull candle on the right is green.
3. **Settings Controls:** Double-click the indicator to alter the higher timeframe source resolution (e.g., changing it from 15 to 60 or W for Weekly), modify the HMA lookback length (default is 9), or shift the candle further into your right margin screen space.
Indicator

Pressure DeltaPressure Delta is a volume-weighted candle-pressure indicator designed to identify directional participation and unusually strong buying or selling activity. It estimates buy and sell pressure from the candle's closing position and wick structure, distributes the candle's volume according to that estimated pressure, and then normalizes the resulting directional delta against average volume. The indicator combines Pressure, Relative Volume Delta, Relative Volume Percentage, Delta Spike and Relative Volume to distinguish ordinary price movement from high-volume directional events.
The most useful way to think about it is:
Pressure = direction
RVoL = participation
RVoL Δ = directional participation
RVoL % = imbalance
Spike = unusualness
1. The core idea: estimating buy vs. sell pressure
The script first examines the candle:
high
low
open
close
volume
It calculates the candle's range:
candleRange = high - low
Then it asks two questions:
Where did the candle close within its range?
closeRatio = (close - low) / range
A close near the high gives a value close to 1.
A close near the low gives a value close to 0.
It also examines the wicks:
wickBias = (lowerWick - upperWick) / range
A relatively large lower wick contributes bullish pressure, while a relatively large upper wick contributes bearish pressure.
Those two components are then combined:
buyPressureRaw =
60% × close location
+ 40% × wick bias
So the indicator gives 60% weight to where the candle closes and 40% weight to the wick structure.
2. Pressure
This is probably the most intuitive component.
pressureFinal = buyPressureRaw × 100
So it produces a number between approximately:
0% → 100%
Conceptually:
0–20% → very strong selling pressure
20–40% → bearish pressure
40–50% → mildly bearish/neutral
50–60% → mildly bullish
60–70% → bullish
70–85% → strong bullish pressure
85–100% → very strong bullish pressure
Your chart labels the last 7 candles with this value.
The colors reinforce the interpretation:
🟢 >60 = bullish
🟡 40–60 = neutral/mixed
🔴 <40 = bearish
Example
Suppose a candle:
opens at 100
trades to 95
trades to 108
closes at 107
The close is very near the high, and the candle may have a relatively meaningful lower wick.
The algorithm therefore might calculate something like:
Pressure = 82%
That means:
"Based on this candle's structure, the indicator estimates strong buying dominance."
It does not mean that exactly 82% of actual trades were buys.
3. Estimated buy and sell volume
The script takes the estimated pressure and applies it to the candle's volume:
buyVol = buyPressureRaw × volume
sellVol = sellPressureRaw × volume
For example, imagine:
Volume = 1,000,000
and:
Pressure = 70%
The script estimates:
Buy volume ≈ 700,000
Sell volume ≈ 300,000
Then:
netDelta = buyVol - sellVol
giving:
+400,000
Again, this is modelled volume, not exchange-reported buy/sell volume.
4. RVoL — Relative Volume
The script calculates a 20-bar average volume:
avgVol = ta.sma(volume, 20)
Then:
rvol = volume / avgVol
So if:
Current volume = 2,000,000
and:
20-bar average = 1,000,000
then:
RVoL = 2.0x
Meaning:
The current candle traded approximately twice the normal volume.
This is useful because pressure by itself isn't necessarily meaningful.
A candle showing 80% pressure on extremely low volume is very different from an 80% pressure candle occurring on 3× normal volume.
5. RVoL Δ — probably one of the most important readings
The script calculates:
rvolBuy = buyVol / avgVol
rvolSell = sellVol / avgVol
and:
rvDelta = rvolBuy - rvolSell
This combines directional pressure + abnormal volume.
For example:
Scenario A
Pressure = 70%
RVoL = 1×
You might get a relatively modest positive RVoL Delta.
Scenario B
Pressure = 70%
RVoL = 3×
The RVoL Delta becomes much larger.
That's because the second candle has substantially more volume behind the estimated buying pressure.
So conceptually:
RVoL Δ attempts to measure the strength of directional volume pressure relative to normal volume.
Your alerts use thresholds of:
5, 6 and 7
So you're essentially saying:
"Alert me when estimated buying pressure is not only positive, but exceptionally large relative to normal volume."
6. RVoL %
This calculation is:
rvPct = (rvDelta / rvol) × 100
This is interesting because it normalizes the delta by total relative volume.
Mathematically, it effectively brings you back toward the buy/sell imbalance expressed as a percentage of volume.
For example:
+50%
means the estimated buying component is substantially greater than the estimated selling component.
The indicator colors:
>50% = green
0–50% = yellow
<0% = red
Your alerts are focused on 40% and 50%.
7. Spike
This is designed to identify unusually large directional-volume events.
The script calculates:
avgAbsDelta = ta.sma(math.abs(rvDelta), 5)
Then:
spike = rvDelta / avgAbsDelta
In other words:
How large is the current directional volume delta compared with the average magnitude of the last five deltas?
For example:
Spike = 0.5×
Normal-ish / relatively weak.
Spike = 1×
Around the recent average.
Spike = 2×
Approximately twice the recent average magnitude.
Spike = 4×
A potentially significant directional-volume event.
Your table highlights values above 2×.
One subtle point: because the denominator uses abs(rvDelta) but the numerator retains its sign, a large negative event can produce a strongly negative Spike.
Indicator

Indicator

Indicator

MTF Liquidity Stack (Zeiierman)█ Overview
MTF Liquidity Stack (Zeiierman) is a multi-timeframe liquidity mapping indicator designed to identify, combine, and track unmitigated liquidity across higher-timeframe swing points, regional trading sessions, and previous-day extremes.
Instead of displaying every liquidity source independently, the indicator organizes multiple liquidity references into one unified structure:
• MTF Liquidity = confirmed swing highs and lows from up to five timeframes
• Session Liquidity = Asia, London, and New York session highs and lows
• Daily Liquidity = Previous Day High and Previous Day Low
• Liquidity Stack = multiple sources occupying the same price level
When several liquidity sources resolve to the same price, they are merged into a single level.
For example:
• 1h + 4h + 15m + Asia : means the same price is simultaneously recognized as a 1-hour swing liquidity level , a 4-hour swing liquidity level , a 15-minute swing liquidity level , and an Asia session liquidity level .
█ How It Works
⚪ Multi-Timeframe Liquidity
The indicator tracks confirmed 3-candle swing highs and lows across up to five timeframes, together with session highs and lows from Asia, London, and New York , plus PDH / PDL .
Once confirmed, each liquidity level is anchored to its exact price origin and projected forward on the chart until price trades through it.
This creates a unified view of liquidity from multiple timeframes, sessions, and daily reference points without separating them into different systems.
The Levels setting controls how many recent unmitigated MTF swing highs and lows are kept for each active timeframe.
⚪ Auto Higher Timeframes
When Auto is enabled, any configured timeframe that is equal to or below the current chart timeframe is automatically promoted to a meaningful higher timeframe.
Duplicate effective timeframes are removed, with explicitly selected higher timeframes taking priority.
For example:
Chart = 1H
• TF 1 = 1H → promoted to 4H
• TF 2 = 4H → explicit 4H
• TF 3 = 1D
Because 4H already exists explicitly, the promoted duplicate is ignored.
The effective structure becomes:
• 4H
• 1D
⚪ Stacked Liquidity
When multiple liquidity sources share the same price and side, they are combined into a single Stacked Liquidity level.
For example:
• PDH + 1D + Asia : means the same price is recognized as the Previous Day High , a Daily swing level , and an Asia session level .
This makes areas where several independent liquidity references overlap immediately visible.
█ How to Use
You can use MTF Liquidity Stack in four main ways: Liquidity Mapping, Liquidity Stacking, Session Trading, and Sweep Analysis.
⚪ Liquidity Mapping
The most direct use of the indicator is to identify liquidity that has not yet been traded through.
• Active horizontal lines represent unresolved liquidity.
• High-side levels mark confirmed highs that remain unswept.
• Low-side levels mark confirmed lows that remain unswept.
The right-side labels make it possible to immediately identify whether a level originates from:
• a higher timeframe
• a session
• PDH / PDL
• several sources simultaneously
This allows traders to quickly see where unresolved price structure remains above and below the market.
⚪ Liquidity Stacking
Liquidity becomes especially useful when several independent sources align at the same price.
For example:
• 1h + 4h : shows agreement between two timeframe structures.
• 1h + Asia + 4h : shows higher-timeframe liquidity aligned with a regional session extreme.
A larger stack does not guarantee that price will reverse from the level.
Instead, it identifies a price where multiple liquidity references overlap, making the area more important for contextual analysis.
⚪ Session Trading
Session liquidity tracks the completed highs and lows of Asia, London, and New York .
For example, after London closes:
• London High stays active until price trades above it
• London Low stays active until price trades below it
These levels can then be used to monitor later sweeps, reactions, and areas where session liquidity overlaps with higher-timeframe liquidity.
⚪ Liquidity Sweep Analysis
Track liquidity sweeps in real time as price trades through higher-timeframe, session, PDH / PDL, or Stacked Liquidity levels.
A sweep of Stacked Liquidity can carry more significance than a single-source sweep because multiple liquidity references are being taken at the same price.
After a sweep occurs, monitor the following price action for either:
• Rejection / reversal away from the swept level
• Continuation through the level in the direction of the move
The sweep itself is not the signal. It shows where liquidity has been taken and where the next price reaction may become important.
█ Settings
Auto: Automatically promotes enabled sources that are equal to or below the current chart timeframe. Explicit higher-timeframe sources take priority when duplicate effective timeframes occur.
Levels: Controls the number of recent unmitigated swing highs and swing lows retained for each active timeframe source.
TF 1 - TF 5: Enable or disable each MTF liquidity source and select its timeframe. Up to five timeframe sources can operate together.
Mode: Selects the global session structure. Full uses the configured Full windows. AM switches Asia, London, and New York together to their configured AM windows.
UTC: Controls the fixed UTC offset used for session timing and daily calculations. Session windows are defined from UTC+0 and shifted automatically.
Asia: Enables Asia liquidity and controls its name, Full session window, AM session window, and color.
London: Enables London liquidity and controls its name, Full session window, AM session window, and color.
New York: Enables New York liquidity and controls its name, Full session window, AM session window, and color.
Daily Reset: Clears both unmitigated and historical mitigated liquidity when a new calendar day begins.
PDH / PDL: Enables Previous Day High and Previous Day Low liquidity tracking.
Labels: Controls the size of liquidity origin labels and completed mitigation labels.
History: Controls whether historical mitigated liquidity remains visible.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems 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.
Indicator

Key Level Sweep & Breakout█ OVERVIEW
Key Level Sweep & Breakout is a multi-layer tool for analyzing key price levels, designed mainly for intraday traders. The indicator combines levels derived from previous-day, previous-week and previous-month structure with volatility-based levels, the previous-day range, and automatic Sweep and Breakout detection.
The main idea is to gather the most important reference levels in one consistent tool. PDH/PDL, PWH/PWL and PMH/PML make it possible to watch significant historical highs and lows, while ATR levels mark an approximate expected range relative to the day open. In addition, the Day/Session Open and the PDH–PDL range divisions help assess where price currently sits inside the structure of the day.
One of the most important parts of the indicator is automatic Sweep and Breakout signaling. A Sweep identifies a situation in which price violates a key level and then closes back on the opposite side, pointing to a potential rejection of that level. A Breakout identifies a situation in which price breaks the level and holds the close on the breakout side, pointing to a potential continuation.
The indicator is built so that its appearance can be adapted almost completely to a given strategy. Each group of levels can be enabled independently and styled by color, line style, width and transparency. The user can also control how much history is kept on the chart, label placement, the length of extra range-division segments, and how current values are displayed.
As a result, the tool can be used either as a minimal map of key levels or as a richer contextual panel for intraday analysis.
█ CONCEPTS
Key Levels
Key Levels form the foundation of the indicator. They include Previous Day High/Low (PDH/PDL), Previous Week High/Low (PWH/PWL) and Previous Month High/Low (PMH/PML).
These levels represent the previous day, week and month and can act as potential support, resistance and reaction points. The higher the reference timeframe, the broader the context that level provides.
Day / Session Open
Day/Session Open shows the opening price of the current day or session.
This level can be used as a simple reference for judging where price is developing. Price holding above or below the open can add extra context when assessing the direction of the session.
ATR Levels
ATR Levels plot two lines relative to the day open — one above and one below.
Their distance is defined by ATR and a chosen multiplier, so the levels stay linked to current market volatility. They provide an approximate expected range that can be used as an extra reference in intraday analysis.
Previous Day Range
Previous Day Range highlights the area between PDH and PDL as a visually marked zone.
The range can be shown as a two-color split or as a gradient. This makes it easier to see which part of yesterday’s range price is currently in, and how it relates to the upper and lower boundaries of that area.
Range Division Levels
Range Division Levels split the PDH–PDL range at selected percentage values.
The default 25%, 50% and 75% levels create extra reference points inside the previous day’s range, but these values can be changed freely. The levels are drawn as short segments to the right of the last candle, so they do not clutter the main price structure.
Sweep
A Sweep represents a potential rejection of a key level.
The setup is armed when a candle’s wick violates the level. The indicator then waits for confirmation inside a defined bar window. The confirming close must occur on a later candle, not on the same candle that made the breach. For example, after PDH is pierced, price must then close back below that level on a bearish candle (close below open) to produce a Sweep Sell. Likewise, a pierce of PDL followed by a close back above the level on a bullish candle (close above open) can produce a Sweep Buy.
Breakout
A Breakout represents a potential hold on the breakout side and continuation of the move.
After the level is violated, the indicator waits for the next confirmation. If price closes on the breakout side, the confirming candle closes in the direction of the move, and the distance filter is met, a Breakout signal is generated. The same mechanism is used for daily, ATR, weekly and monthly levels.
Confirmation & Distance Filter
Signals are not generated from a single touch or wick through the level. The indicator uses a confirmation window and an optional minimum-distance filter for the confirming close, expressed as a multiple of ATR.
This helps reduce weaker signals in which price only slightly crosses the level without a clear confirming move.
If the confirmation window expires without a valid close, or after a Breakout is printed, the setup is locked until price reclaims the level. Only then can a new Sweep or Breakout setup start.
Distance-from-Levels Table
The Distance-from-Levels table shows the current distance of price from the main levels.
For each level it displays the price value and the distance in ATR units and in percent. This makes it possible to see quickly how close price is to key levels without measuring distances on the chart by hand.
█ FEATURES
Day / Week / Month Levels
• PDH / PDL – previous day’s High and Low
• PWH / PWL – previous week’s High and Low
• PMH / PML – previous month’s High and Low
• Each group can be turned on or off independently and has its own visual settings
• Color, line style, width and transparency can be used to build a visual hierarchy of levels on the chart
ATR Levels
• ATR High / Low plotted from the Day/Session Open
• Configurable ATR length, timeframe and distance multiplier
• Independent visibility and style controls
• ATR used for these levels is taken from closed bars of the selected timeframe and is fixed at the start of the day
Day / Session Open
• Current day or session opening price
• Configurable color, style, width and transparency
• Can be used as an extra reference for session direction
Previous Day Range
• Visualisation of the full range between PDH and PDL
• Two-Color or Gradient fill mode
• Independent colors and transparency for the upper and lower parts of the range
• Two-Color mode keeps a limited history of range boxes. Gradient mode is drawn as a fill between the current previous-day high and low
Range Division Levels
• Up to three configurable percentage levels inside the PDH–PDL range
• Any values from 0% to 100%
• Configurable segment length, horizontal offset, style and width
• Optional percentage labels
Sweep / Breakout Signals
• Sweep signals – potential rejection after a level is violated and price closes back on the opposite side
• Breakout signals – potential continuation after price holds the close on the breakout side
• Signals can be enabled independently for daily, ATR, weekly and monthly levels
• Configurable confirmation window in number of bars
• The piercing candle itself never generates a signal from its own close. Confirmation is evaluated from the next bar through the last bar of the window
• The confirming candle must also close in the signal direction: close below open for sell-side signals, close above open for buy-side signals
• Optional ATR-based minimum distance filter for the confirming close
• Independent Buy / Sell signal colors
• Sweeps are marked with diamonds, Breakouts with triangles
Labels & Live Price
• Global switch for all labels
• Adjustable size and horizontal offset for day, ATR, week and month label groups
• Optional live price labels at the right end of active lines
• Configurable decimal precision and offset from the last candle
History
• Independent number of stored daily, weekly and monthly levels
• Older lines, labels and range boxes are removed automatically to keep the chart readable
Day / Week / Month Reset
• Reset aligned with the instrument session
• Alternatively a manually defined reset time
• Time zone can be set for the manual reset
• Week and month boundaries follow the same reset method as the day
Distance-from-Levels Table
• Current value of each level
• Distance from price in xATR and %
• Configurable table position, text size and value precision
• Optional coloring of levels depending on whether they sit above price (resistance) or below price (support), using the Sell / Buy colors from the Sweep section
• Table ATR is always calculated on the current chart timeframe
Alerts
• Separate alerts for Sweep and Breakout on each individual level
• Combined alerts for any Sweep Buy / Sell and any Breakout Buy / Sell
• Can be used in TradingView alert automation
█ APPLICATIONS
Identifying key intraday reaction levels
The indicator can be used to mark in advance the levels where price may show increased activity. PDH, PDL, PWH, PWL, PMH and PML build a map of important historical levels, while ATR Levels add extra reference points derived from current volatility.
Trading a Sweep
Example scenario: price approaches PDH. Instead of assuming an automatic reversal, the trader watches the reaction. If price violates PDH, then returns below the level and a confirmed Sweep Sell appears, this may indicate that the breakout was not held. In that case the trader can still review market structure, momentum and trend before taking a trade.
Trading a Breakout
Alternative scenario: price tests PDH and breaks above it. If a later close holds on the breakout side, the confirming candle is in the direction of the move, and the distance filter is met, the indicator prints a Breakout Buy. The trader may then treat the level as potential confirmation of continuation and look for an entry in the direction of the breakout.
Combining Levels with Trend
Levels do not have to be treated as standalone trade signals. They can be combined with trend analysis. For example, in an uptrend a trader may prefer reactions at PDL or breakouts above PDH, while in a downtrend more attention may be given to reactions at PDH and breaks below PDL.
Using the Previous Day Range
The PDH–PDL range can serve as a map of the previous day’s internal structure. The trader can observe whether price is in the upper, middle or lower part of the range, then use the 25%, 50% and 75% levels as extra reference points when planning scenarios.
Using the Distance Table
The distance table can be used to see quickly which key level is closest to current price. This reduces the need to inspect many lines by hand and helps judge whether price is near a potential reaction level.
█ NOTES
• Signals require confirmation on a later candle after the bar that pierced the level. The piercing candle never triggers a signal from its own close.
• The confirming close must also be in the signal direction (close below open for sell-side Sweep/Breakout, close above open for buy-side Sweep/Breakout).
• The ATR distance filter can require the confirming close to be a chosen number of ATRs away from the violated level, which may help filter weaker confirmations. A filter value of 0 disables the distance requirement.
• If no valid confirmation appears inside the window, or after a Breakout is confirmed, a new setup on that level can start only after price reclaims the level.
• All main visual elements can be configured individually, so the indicator can be adapted both to a minimal chart and to a more detailed intraday workflow.
• Signals are best used as part of a broader analysis that includes market structure, trend, price action, support and resistance, and proper risk management. Indicator

DAO GAM Reversal StructureBX Reversal Structure - Adaptive Top and Bottom is a market-structure indicator designed to identify potential horizontal reversal structures formed by two significant swing areas, referred to as A and B.
The indicator analyzes both top structures and bottom structures.
For a top structure, the script looks for an upward price phase followed by a meaningful rejection. It uses the high and close of the final bullish anchor candle to define a price zone around the swing high.
For a bottom structure, the logic is reversed. The script looks for a downward price phase followed by a meaningful recovery and uses the low and close of the final bearish anchor candle to define the swing-low zone.
When two valid zones, A and B, share an overlapping price area, the script attempts to determine a horizontal reference level called X.
The X level is selected so that it remains within the common price area of A and B while avoiding the interior of candle bodies located between the two structures. Wick interaction with X is permitted.
This approach is intended to distinguish meaningful horizontal market structures from simple price equality between two isolated swing points.
Main concepts
The indicator evaluates several structural conditions, including:
Minimum price movement into and away from each swing.
A minimum number of candles forming the directional phase before and after the swing.
Overlap between the price zones of A and B.
Candle-body interaction between A and B.
Separation between the two swing areas.
Distance and spacing between A and B.
Additional interactions with the X level after the structure is formed.
The indicator can detect:
Top structures: potential resistance or reversal structures.
Bottom structures: potential support or reversal structures.
Adaptive mode
The indicator includes an adaptive mode based on ATR (Average True Range).
Instead of relying exclusively on fixed price distances, ATR-based thresholds can automatically scale according to the volatility of the current symbol and timeframe.
This allows the indicator to be tested on different markets and timeframes, including forex, metals, cryptocurrencies, indices and other instruments available on TradingView.
A manual mode is also available for users who prefer fixed parameter values.
A, B and X
A represents the first qualified swing structure.
B represents a later qualified swing structure that shares a valid price area with A.
X is the horizontal reference level calculated from the overlapping zones of A and B.
Additional qualified interactions with the same level may be displayed as C, D, E or subsequent touches.
For top structures, X acts as a horizontal resistance reference.
For bottom structures, X acts as a horizontal support reference.
Line behavior
After a valid A-B structure is detected, the X line is extended to the right.
The visual line stops when a future candle body reaches the X level. Candle wicks alone do not necessarily stop the line.
The script may also generate a CHECK condition when price moves a specified distance beyond X within the configured monitoring period.
These signals indicate that the predefined structural condition has occurred; they are not automatic trading orders.
How to use
Users can apply the indicator directly to a chart and choose between:
AUTO (ATR): parameters adapt to current market volatility.
MANUAL: price-distance parameters are entered manually.
Because volatility and market structure differ significantly between instruments and timeframes, users should evaluate the parameters on the specific market they intend to analyze.
The indicator is intended primarily as a market-structure visualization and research tool. It can be combined with independent analysis of trend, volatility, liquidity, risk management and broader market context.
Original concept
The central idea of this indicator is that a horizontal resistance or support structure should not necessarily be defined by two identical highs or lows.
Instead, each swing is represented as a price zone between the close and the extreme of its anchor candle.
The indicator searches for the common price area between two qualifying zones and then determines a horizontal level that respects candle-body structure between them.
This zone-overlap and candle-body approach is the main structural concept used by the script.
Limitations
This indicator does not predict future market direction and does not guarantee that a detected support or resistance structure will produce a reversal.
Pivot-based structures require subsequent candles for confirmation, so signals are identified only after sufficient market data becomes available.
ATR adaptation improves portability between instruments and timeframes, but no single parameter configuration can provide identical behavior across all markets.
Low-liquidity instruments, gaps, unusually volatile market conditions and different data feeds may produce different results.
Historical structures should not be interpreted as evidence of future profitability.
Users should independently evaluate the indicator and apply appropriate risk management before making trading decisions. Indicator

Indicator

Modern Squeeze Momentum [GBB]MODERN SQUEEZE MOMENTUM
A rework of the Squeeze Momentum Indicator with an adaptive length, graded compression, normalised momentum, a qualified-release filter and a higher-timeframe context layer. Classic mode reproduces the original exactly.
The Squeeze Momentum Indicator (LazyBear's open-source implementation of John Carter's TTM Squeeze) is one of the most used free scripts on TradingView, and for good reason: Bollinger Bands inside Keltner Channels is a clean, intuitive way to spot compression before expansion. It also has four well-known limitations:
- The length is fixed at 20 bars regardless of the market's current cycle.
- The squeeze is binary. A hair inside the Keltner Channel counts the same as an extreme contraction.
- Momentum is in price units, so a reading of 15 on gold and 0.0004 on EURUSD tell you nothing comparable, and no fixed threshold works across symbols.
- Every squeeze release fires, whether or not price actually did anything.
This script keeps the original as its base (Layer 0) and adds five layers on top. Each layer has its own on/off switch so you can see exactly what each one changes.
HOW IT WORKS
Layer 0 - Classic base
Bollinger Bands (SMA +/- 2.0 standard deviations) and Keltner Channels (SMA +/- 1.5 x SMA of true range). Momentum is the linear regression of close minus the midpoint of the Donchian midline and the SMA, exactly as in the original.
Layer 1 - Adaptive length
Instead of a fixed 20, the length follows the dominant cycle measured by the Ehlers Homodyne Discriminator on (high + low) / 2. The cycle estimate is smoothed with a short EMA, clamped to a 12-40 bar range, and rounded. All bands and the momentum calculation use this length, so the indicator tightens in fast markets and widens in slow ones.
Layer 2 - Graded compression
The ratio Bollinger width / Keltner width is percentile-ranked over the last 150 bars. Three grades: light (bottom 30%), medium (bottom 15%), tight (bottom 5%). The zero-line dot grows and changes colour with the grade, and a duration counter tracks how many bars the squeeze has lasted. With this layer off, the classic binary test (BB inside KC) is used.
Layer 3 - Normalised momentum
Momentum is divided by the Keltner range, so the histogram is in "Keltner-range units". A reading of 1.0 means the same thing on BTC 1h, gold 15m and EURUSD 1h. Reference lines at +/-0.5 and +/-1.0 are drawn for orientation. The momentum threshold used in Layer 4 is set in the same units.
Layer 4 - Qualified release
A raw release is simply the squeeze ending. A qualified release additionally requires, on the release bar:
- momentum direction agrees with the bar direction (close vs open),
- absolute momentum is at or above the threshold (default 0.5),
- the squeeze lasted at least the minimum number of bars (default 3),
- close breaks the high (long) or low (short) of the range that formed during the squeeze.
Qualified releases are drawn as solid triangles (green up, red down). Unqualified releases are drawn as small grey dots so you can see what the filter removed. Turn the layer off and every release fires, as in the original.
Layer 5 - Context
HTF wash: the full layer stack is evaluated on a higher timeframe (default 4x the chart timeframe, or pick your own). When the higher timeframe is in a squeeze, the pane background is tinted, darker for tighter grades. Only closed higher-timeframe bars are used, lookahead is off. If the chosen HTF is not above the chart timeframe, a label says so and the wash is disabled.
Stats table: running counts on the loaded bars. Number of squeezes, raw vs qualified releases, hit rate (did close move in the release direction after H bars) and range multiple (the H-bar range after a qualified release, in ATR, relative to the H-bar range of all bars). H defaults to 10 bars.
READING THE PANE
- Histogram: the four original states are kept. Positive and rising, positive and falling, negative and falling, negative and rising, each in its own colour.
- Zero-line dot: small blue-grey = no squeeze; yellow / orange / red and increasingly large = light / medium / tight squeeze.
- Triangles: qualified release, long below the histogram, short above.
- Grey dots: releases that did not pass the filter.
- Background tint: the higher timeframe is in a squeeze.
- Reference lines: +/-0.5 and +/-1.0 Keltner-range units (only drawn when Layer 3 is on).
Three palettes: GBB (default), LazyBear (original colours) and Mono.
CLASSIC MODE
One switch in the General group turns Layers 1-4 off, sets the fixed length, and reproduces the original Squeeze Momentum Indicator histogram and squeeze dot. Combine it with the LazyBear palette if you want the familiar look. It is there so you can check for yourself what the added layers do and do not change.
ALERTS
Five alert conditions, all evaluated on confirmed bars only:
- Squeeze started (message includes the grade)
- Squeeze released (raw)
- Qualified release - long
- Qualified release - short
- HTF squeeze started / released
REPAINTING
Releases, markers, alerts and table counts are evaluated on confirmed bars. The higher-timeframe layer uses closed HTF bars only. The adaptive length and the percentile rank depend on recent history, so values on the current bar can move until it closes, like any indicator that uses the live bar.
SETTINGS OVERVIEW
- General: Classic mode.
- Adaptive length (Layer 1): on/off, min and max length, fixed length for when the layer is off.
- Bands: BB and KC multipliers.
- Compression (Layer 2): percentile ranking on/off, rank window, light / medium / tight percentiles, minimum squeeze bars.
- Momentum (Layer 3): normalisation on/off, momentum threshold.
- Release (Layer 4): qualified filter on/off, require range break, show unqualified releases.
- Context (Layer 5): HTF wash on/off, HTF selection, stats table on/off, stats horizon.
- Visual: palette.
CREDITS
- John Carter for the TTM Squeeze concept.
- LazyBear for the open-source Squeeze Momentum Indicator that this script extends. Layer 0 and Classic mode are his logic.
- John F. Ehlers for the Homodyne Discriminator (Rocket Science for Traders).
Open source. No hype, just data. Nothing here is a trade recommendation; a squeeze tells you volatility contracted, not which way it will expand. Indicator

Indicator

Prime Structure BiasKaushik Prime — Prime Structure Bias 👑 is a professional 1H market structure dashboard designed to identify the current market bias and structure using confirmed price action.
The indicator analyzes Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), and Lower Lows (LL), along with BOS and CHOCH confirmations to determine whether the market is Bullish, Bearish, or Neutral.
It displays the analysis in a clean, table-only dashboard with no chart labels, arrows, or structure drawings. The dashboard shows Market Bias, Structure, Direction, Last Structure Event, Trend Strength, Market Condition, Trading Bias, and Analysis Timeframe.
The indicator is designed to provide a clear 1H higher-timeframe market direction for traders analyzing lower timeframes such as 5M and 15M.
Features:
• 1H Higher-Timeframe Market Bias
• HH / HL / LH / LL Structure Detection
• BOS & CHOCH Detection
• Bullish / Bearish / Neutral Classification
• Trend Strength Assessment
• Trending / Ranging Market Detection
• BUY / SELL / NO TRADE Bias
• Clean Table-Only Dashboard
• No unnecessary chart markings
Note: This indicator is intended as a market-structure analysis tool and does not guarantee future price movement. Indicator

Indicator
