Smart Flow Imbalance [StrixEDGE]TRADINGVIEW CATEGORIES
1. Volume
2. Trend Analysis
3. Oscillators
SEARCH TAGS (9)
smart-flow-imbalance, overlay-signals, order-flow, volume, relative-volume, buying-selling-pressure, accumulation-distribution, momentum, market-structure
DESCRIPTION
StrixEDGE Smart Flow Imbalance is Engine #06 in the StrixEDGE indicator framework. It is a flow-focused market-state tool designed to identify changes in directional quality, liquidity behavior, volatility structure and confirmation strength without relying on a single conventional oscillator.
WHAT THIS INDICATOR IS DESIGNED TO DO
Blends persistent flow, displacement and range structure into a directional participation score.
Rather than treating one input as a complete signal, StrixEDGE combines the engine's dedicated core logic with an optional DNA layer. The final result is normalized into a 0–100 Strix Score so the same framework can be read consistently across different symbols and timeframes.
HOW TO READ THE STRIX SCORE
• Above 72: bullish state / long-side trigger zone.
• Below 28: bearish state / short-side trigger zone.
• Around 50: balanced or neutral state.
• A signal is generated on a transition into a trigger zone, not on every bar that remains inside it.
SIGNAL & POSITION FRAMEWORK
When a valid state transition is detected, the overlay version can create a structured trade plan containing:
• Entry
• DCA level
• TP1
• TP2
• TP3
• Stop Loss
Each projected level includes its percentage distance from Entry. When a level is reached, the same chart label is updated with a ✓ marker. TP and SL outcome tracking is mutually controlled so the dashboard does not report contradictory terminal results for the same setup.
PROFESSIONAL DASHBOARD
The built-in StrixEDGE dashboard summarizes the active market state in a compact TradingView table, including:
• Engine and category
• Strix Score and directional bias
• Signal / market regime
• Flow pressure and trend quality
• Relative volume and ATR volatility
• Structure / VWAP context
• Active position and signal age
• Entry, DCA, TP1, TP2, TP3 and SL
• Hit status for each projected level
COMBINATION PROFILE
• CORE BALANCE
• Active DNA modules: 3
• Lookback: 24
• Smoothing: 5
• Signal threshold: 72
ENGINE DNA
• Displacement Efficiency — Directional body displacement normalized by ATR and relative volume.
• Range Structure Balance — Maps close location inside rolling high/low structure to a signed state.
• Normalized Flow Acceleration — Smooths ATR-normalized return × relative volume to estimate directional flow.
MARKET / STYLE PROFILE
• Market focus: Crypto
• Intended style: Swing
• Core engine: #06 Smart Flow Imbalance
• Category: Flow
NON-REPAINT / DATA HANDLING
By default, signals require a confirmed chart-bar close. This reduces intrabar signal fluctuation and makes historical signal placement more stable.
ALERTS
The generated script includes alert conditions for:
• Long state shift
• Short state shift
• DCA reached
• TP1 reached
• TP2 reached
• TP3 reached
• Stop Loss reached
HOW I USE IT
StrixEDGE is designed as a market-state and trade-structure tool rather than a standalone prediction system. Stronger setups generally occur when the Strix Score, market regime, flow pressure, structure and volatility context agree instead of relying on the trigger alone.
LIMITATIONS
No indicator can predict future price movement with certainty. Signals can fail during sudden news events, illiquid conditions, gaps, abnormal volatility, regime transitions or unreliable volume. DCA, TP and SL levels are systematic projections derived from the active setup and should not be interpreted as guaranteed outcomes.
Users should validate the indicator on the symbol, exchange and timeframe they trade, and should apply independent position sizing and risk management. Historical behavior does not guarantee future performance.
ORIGINALITY
StrixEDGE Engine #06 is built from generic price, volume, volatility, structure and confirmed-context primitives arranged in a dedicated engine formula and optional DNA layer. It is not intended to reproduce or rename a specific community indicator.
DISCLAIMER
For research and educational purposes only. This indicator is not financial advice and does not guarantee profitability. Indicator

Smart Money Concepts [AxeAlgo]Overview
- Smart Money Concepts is a clean, non-repainting indicator designed for traders who want to identify institutional market structure without clutter.
The indicator visualizes where smart money is likely to defend, attack, and accumulate positions by displaying order blocks, fair value gaps, liquidity pools, and premium/discount dealing ranges on your chart.
What It Shows
Market Structure (CHoCH and BOS)Identifies when the market changes direction (Change of Character) and when new directional commitment breaks prior structure (Break of Structure). Each signal confirms only after a specified number of bars, ensuring no repainting.
Order BlocksHighlights the price zones where the last aggressive institutional movement originated. These are areas where smart money entered positions and often acts as support or resistance on subsequent pullbacks.
Fair Value GapsDetects imbalances between candlesticks (gaps not filled by wicks). The indicator marks these zones because institutions often return to fill them as price moves away.
Liquidity PoolsAutomatically identifies clusters of equal highs and equal lows where retail traders typically set stop losses. The indicator marks when price breaks through these pools (institutional sweeps).
Premium and DiscountDisplays whether price is trading above (premium) or below (discount) the 50% equilibrium level between the most recent swing high and low. Extreme premium or discount often precedes reversals.
How to Use It
Enable individual components using the dashboard toggles: Show Structure, Show Order Blocks, Show Fair Value Gaps, Show Liquidity Pools, Show Premium/Discount.
Turn on the dashboard to see your current swing bias, internal structure direction, and range position at a glance.
Auto-Tune automatically scales all sensitivity parameters based on your chart timeframe. Turn it off if you prefer manual tuning.
Use Simple Mode to display only swing structure without internal noise for a cleaner chart.
Key Settings
Confirmation Bars: How many bars confirm a pivot before a structure signal fires. Higher values filter out false signals but add lag. Default is 2.
Min Displacement: The minimum price movement (in ATR multiples) required for a structure signal to register. Default is 1.0 ATR.
Zone Sizing: Controls the minimum and maximum height of order blocks and FVGs. Adjust to filter noise or capture smaller opportunities.
P/D Lookback: How many bars back to scan for the swing high and low that define your premium/discount range.
Dashboard Position and Size: Choose where the info table appears and how large you want it.
Colors: Customize bullish, bearish, and gap colors to match your chart theme.
What This Indicator Is For
Smart Money Concepts is intended for traders who want to visually identify institutional order flow patterns and understand where smart money accumulates and distributes. It helps you:
Spot areas where institutions likely accumulated or distributed (order blocks and FVGs)
Recognize when price is overextended and vulnerable to reversal (premium/discount extremes)
Distinguish real structural breaks from noise during choppy consolidation
Plan entries and stops around levels where smart money defends
How It Works
The indicator uses pivot-point analysis to identify swing highs and lows, then marks the price zones where directional movement originated (order blocks). Fair value gaps are detected using standard three-candle imbalance logic. Liquidity pools are identified by clustering equal price levels within a configurable tolerance.
All signals confirm only on closed bars. Zones never repaint, but they shrink or change state as price action develops.
Limitations
The indicator shows 5 active zones at a time to keep your chart clean. If multiple institutional structures are forming simultaneously, older zones will age out. This is by design to prioritize the most recent price action.
This indicator identifies structural levels and patterns. It does not predict price direction or guaranteed support/resistance. Use it as one component of a complete trading plan, not as a standalone signal.
Fair value gaps and order blocks are useful but not infallible. Price may skip through them or reverse before reaching them.
Important Disclaimer
This indicator is for educational and analytical purposes only. It does not provide financial advice, and past performance does not guarantee future results. Trading involves risk of loss. Always use proper risk management, stop losses, and position sizing. Never risk more than you can afford to lose.
The accuracy and effectiveness of this indicator depends on your market conditions, timeframe, and trading methodology. Results vary by trader and asset class.
Indicator

Liquidity Absorption Engine [StrixEDGE]TRADINGVIEW TITLE
Liquidity Absorption Engine Liquidity
DESCRIPTION
StrixEDGE Liquidity Absorption Engine is Engine #01 in the StrixEDGE indicator framework. It is a liquidity-focused market-state tool designed to identify changes in directional quality, liquidity behavior, volatility structure and confirmation strength without relying on a single conventional oscillator.
WHAT THIS INDICATOR IS DESIGNED TO DO
Scores wick absorption, sweep rejection and directional flow to identify defended liquidity zones.
Rather than treating one input as a complete signal, StrixEDGE combines the engine's dedicated core logic with an optional DNA layer. The final result is normalized into a 0–100 Strix Score so the same framework can be read consistently across different symbols and timeframes.
HOW TO READ THE STRIX SCORE
• Above 72: bullish state / long-side trigger zone.
• Below 28: bearish state / short-side trigger zone.
• Around 50: balanced or neutral state.
• A signal is generated on a transition into a trigger zone, not on every bar that remains inside it.
SIGNAL & POSITION FRAMEWORK
When a valid state transition is detected, the overlay version can create a structured trade plan containing:
• Entry
• DCA level
• TP1
• TP2
• TP3
• Stop Loss
Each projected level includes its percentage distance from Entry. When a level is reached, the same chart label is updated with a ✓ marker. TP and SL outcome tracking is mutually controlled so the dashboard does not report contradictory terminal results for the same setup.
PROFESSIONAL DASHBOARD
The built-in StrixEDGE dashboard summarizes the active market state in a compact TradingView table, including:
• Engine and category
• Strix Score and directional bias
• Signal / market regime
• Flow pressure and trend quality
• Relative volume and ATR volatility
• Structure / VWAP context
• Active position and signal age
• Entry, DCA, TP1, TP2, TP3 and SL
• Hit status for each projected level
COMBINATION PROFILE
• CORE BALANCE
• Active DNA modules: 3
• Lookback: 24
• Smoothing: 5
• Signal threshold: 72
ENGINE DNA
• Wick Absorption Pressure — Compares upper/lower wick asymmetry and amplifies it when relative volume is elevated.
• Liquidity Sweep Rejection — Detects previous-range stop sweeps that close back inside the broken boundary.
• Normalized Flow Acceleration — Smooths ATR-normalized return × relative volume to estimate directional flow.
MARKET / STYLE PROFILE
• Market focus: Crypto
• Intended style: Swing
• Core engine: #01 Liquidity Absorption Engine
• Category: Liquidity
NON-REPAINT / DATA HANDLING
By default, signals require a confirmed chart-bar close. This reduces intrabar signal fluctuation and makes historical signal placement more stable.
ALERTS
The generated script includes alert conditions for:
• Long state shift
• Short state shift
• DCA reached
• TP1 reached
• TP2 reached
• TP3 reached
• Stop Loss reached
HOW I USE IT
StrixEDGE is designed as a market-state and trade-structure tool rather than a standalone prediction system. Stronger setups generally occur when the Strix Score, market regime, flow pressure, structure and volatility context agree instead of relying on the trigger alone.
LIMITATIONS
No indicator can predict future price movement with certainty. Signals can fail during sudden news events, illiquid conditions, gaps, abnormal volatility, regime transitions or unreliable volume. DCA, TP and SL levels are systematic projections derived from the active setup and should not be interpreted as guaranteed outcomes.
Users should validate the indicator on the symbol, exchange and timeframe they trade, and should apply independent position sizing and risk management. Historical behavior does not guarantee future performance.
ORIGINALITY
StrixEDGE Engine #01 is built from generic price, volume, volatility, structure and confirmed-context primitives arranged in a dedicated engine formula and optional DNA layer. It is not intended to reproduce or rename a specific community indicator.
DISCLAIMER
For research and educational purposes only. This indicator is not financial advice and does not guarantee profitability. Indicator

Mbedaiwi - Market Structure and Price Action mbedaiwi - Market Structure & Price Action
Overview
This Pine Script v6 overlay brings market structure, liquidity events, order blocks, volume estimates, price imbalances, and chart-pattern candidates into one configurable workspace. It helps users examine where price has broken structure, where earlier zones remain active, and how several observations align on the same chart.
The indicator is intended for discretionary analysis and chart study. It is not an automated execution system or a backtested TradingView strategy.
Purpose and benefits
Compare short-term internal structure with broader swing structure.
Organize potential reaction areas using order blocks, imbalances, liquidity levels, and range bands.
Compare the volume associated with visible order blocks through an overlay or a separate right-side display.
Select the modules and labels needed for a particular workflow, reducing chart clutter.
Use alerts to monitor defined events without continuously watching the chart.
The integration follows a practical sequence: establish structure, locate relevant areas, observe price interaction, and optionally evaluate a rule-based setup. The components provide context for one another; agreement between them does not establish a probability of success.
1. Market structure
Internal and swing structure can be configured separately. The script supports SMC leg-transition detection and symmetric pivot detection, with adjustable lengths.
BOS: a break classified as continuation of the current structural direction.
CHoCH: a break against the previous structural direction.
CHoCH+: a CHoCH supported by an intervening higher low for a bullish change, or lower high for a bearish change, under this script's pivot and sequence rules.
HH, HL, LH, and LL: higher highs, higher lows, lower highs, and lower lows.
Strong/Weak High-Low: structural classifications based on the current directional state, not forecasts of whether a level will hold.
Each structure selector offers All, BOS, CHoCH (All), CHoCH, CHoCH+, and None. CHoCH (All) includes both ordinary and supported changes; CHoCH and CHoCH+ select their respective classifications. The separate Show BOS and Show CHoCH switches also affect visibility.
Historical and Present display modes, candle coloring, label sizes, and colored or monochrome themes provide additional control.
2. Order blocks and volume display
The script includes independent swing-break, volume-pivot, and legacy structure-break order-block engines. Available controls include zone boundaries, mitigation rules, retained-zone counts, overlap suppression, midlines, and breaker display.
Volume information can appear on the price-chart overlay, in a right-side chart, or in both locations. Users can choose the volume accumulation interval, including the interval between a broken pivot and its break, an origin window, or an origin-based interval.
How to read the volume numbers
The displayed volume belongs to the selected calculation interval. The percentage is that block's share of the summed volume of currently displayed non-breaker blocks. Changing visible blocks, filters, or retention settings can therefore change the percentages. They are not win rates or percentages of the instrument's entire trading volume.
Internal buy/sell activity is an OHLCV-based estimate. Close-location mode allocates volume according to the close's position within each candle's range; candle-direction mode allocates it according to candle direction. These estimates do not measure actual bid/ask transactions, institutional orders, or order-book liquidity. Volume-dependent outputs rely on the data supplied for the symbol.
3. Liquidity tools
Equal Highs and Equal Lows use an adjustable ATR-based tolerance. Liquidity Grabs identify excursions beyond tracked levels followed by a return inside those levels, subject to the detection rules.
Grabs are displayed as hollow frames around the relevant candle wick: blue for bullish lower-wick grabs and red for bearish upper-wick grabs by default. Optional text can be enabled. Detection sensitivity and retained history are adjustable.
Live previews can change or disappear before the candle closes. Liquidity Grab alerts require a confirmed bar. Separate trendline tools and trendline-break alerts are also available.
4. Price imbalances
The imbalance selector displays one of five types:
FVG: a three-candle gap between the first and third candles' price ranges.
Inverse FVG: a tracked FVG that is breached and reclassified in the opposite direction.
Double FVG: an overlapping area between a new FVG and a tracked opposite-direction FVG.
Volume Imbalance: a gap between adjacent candle bodies while their wick ranges overlap. Despite the name, this detection is price-based.
Opening Gap: a gap between adjacent candle ranges.
Controls include source timeframe, volatility threshold, extension, mitigation method, and maximum retained zones. The imbalance timeframe must be the chart timeframe or higher. Higher-timeframe imbalance detection uses completed source candles, so it becomes available after source-bar confirmation.
To hide only the FVG/type text while retaining the shaded zones, disable Show Imbalance Type on Zones. Re-enable it at any time from Inputs.
5. Premium, equilibrium, and discount
Optional bands divide a selected Swing, Internal, or Impulse range into upper, middle, and lower reference areas. Band width and colors are adjustable. These areas describe relative position within the selected range; they do not measure fundamental fair value or guarantee a reversal.
6. Chart-pattern candidates
The pattern module classifies recent pivot geometry and can display pattern boundaries, shaded zones, and a Detected Pattern table. Candidate types include triangles, wedges, broadening wedges, double tops/bottoms, and head-and-shoulders formations.
Pattern drawings are separate from the trendline module. Detection depends on pivot length, available history, and tolerance settings. In this release, a displayed pattern can remain after price has moved outside its boundaries until the detection state updates. Treat the pattern name as a geometric candidate, not confirmation that a formation remains valid or that a breakout will succeed.
7. Additional context and optional setup planning
Optional Fibonacci retracements, an OTE region, extension levels, and previous daily/weekly/monthly/quarterly highs and lows provide additional reference points.
The optional setup layer combines structural events with configurable checks such as liquidity sweeps, order-block or imbalance interaction, displacement, higher-timeframe direction, EMA alignment, volume, and RSI. Score and Strict modes control how these conditions are evaluated.
When enabled, the trade layer can display a hypothetical entry, stop, and up to three targets using configurable zone, structure, ATR, or risk-multiple methods. These are rule-based planning levels, not executed orders or verified performance results. The default mbedaiwi profile suppresses the trade layer.
How to use
Add the indicator to a standard candlestick chart and choose an analysis profile. The default mbedaiwi profile uses internal length 5, swing length 50, and close-based structural breaks. Select Custom or enable Override profile lengths when you want the manual lengths to take effect.
Choose the internal and swing events you want to see. Start with structure and a small number of zones before enabling additional modules.
Enable order-block metrics if you want volume comparisons. Select the accumulation method and overlay/side-chart layout appropriate for your analysis.
Enable Liquidity Grabs and select detection sensitivity. Distinguish a live preview from a completed event.
Choose an imbalance type and its mitigation method. Add premium/discount bands or prior-period levels if they help define context.
Enable Patterns only when studying pivot-based formations, and check the actual candles against the displayed boundaries.
Use Clean chart mode, individual visibility switches, label sizes, and zone-count controls to manage clutter. The Show tables switch controls on-chart tables.
If using the optional setup layer, choose a compatible profile, review all filters and risk settings, and evaluate its behavior before relying on the planning levels.
Reading entries, stops, targets, and exits
Use the indicator as a sequence of observations: structural direction, an area to monitor, confirmation, and a predefined risk/target plan. A BOS, CHoCH, or Liquidity Grab on its own is not an automatic instruction to buy or sell.
Step 1 - Read the structural context
Start with Swing Structure for the broader context, then use Internal Structure to examine shorter movements. Higher highs and higher lows describe an upward structure; lower highs and lower lows describe a downward structure. A bullish BOS is classified as continuation, while a bullish CHoCH marks a potential change from the preceding bearish structure. CHoCH+ adds the script's supporting pivot-sequence condition; it does not guarantee a reversal.
An internal bullish change can occur while swing structure remains bearish. Always identify which structure level produced the label. Pivot confirmations can arrive after the turning point and be drawn back at the earlier pivot bar.
Step 2 - Identify an area to monitor
A bullish order block, bullish FVG, discount band, previous low, or Equal Lows can provide a reference area for studying a possible bullish reaction. Price entering an area only establishes an interaction; it does not confirm that a rebound has started. Order-block volume percentages are calculated volume shares, not probabilities that the area will hold.
Step 3 - Observe confirmation
The following is an illustrative manual reading sequence, not the mandatory algorithm behind every setup generated by the script:
Price reaches a previously identified reference area.
Price moves below a tracked low and closes back above it, producing a confirmed bullish Liquidity Grab if the detection conditions are met.
Price subsequently breaks an internal structural level upward, producing a bullish CHoCH or CHoCH+ under the script's rules.
The user evaluates the completed confirmation candle or a later retest of the broken level, together with the broader structure and the planned invalidation level.
A retest may never occur, and confirmation can still fail. Do not assume that a marker anchored to an earlier candle was available in real time on that candle.
Step 4 - Understand the optional planning layer
The planning layer displays hypothetical levels when its setup conditions are satisfied:
Entry method: Market, Fibonacci, or Zone determines the entry-reference calculation.
Stop method: Structure, ATR, or Zone determines the stop-reference calculation. The selected invalidation level defines where the planned idea no longer applies.
Target method: Risk multiple, Smart money, or Hybrid determines how target references are calculated.
TP1, TP2, and TP3: up to three target references, according to the selected method.
Move stop to breakeven after TP1: updates the hypothetical stop to the entry reference after the first-target condition is met.
These are chart calculations. They do not send orders to a broker, establish actual fills, or move a real stop order.
To make this layer available, choose a profile such as Custom, enable Show trade layer (entry / SL / TP), and disable Structure only. The default mbedaiwi profile suppresses the trade layer. Enabling the display does not guarantee that levels appear immediately: the selected signal conditions and filters must also be satisfied.
Step 5 - Read risk multiples: a numerical example
Consider a hypothetical entry at 100 and a stop at 98. The distance between them is 2 per share, so 1R equals 2. In Risk multiple target mode:
Entry reference: 100.
Stop reference: 98.
1R target: 102.
2R target: 104.
3R target: 106.
This example explains arithmetic only. It is not a trade recommendation, a prediction, or a result produced by a backtest. It excludes fees and slippage. A real fill can differ from the plotted reference, and an actual exit can differ from the stop price. If the hypothetical breakeven option is enabled, a qualifying TP1 event changes the plotted stop reference to 100; this does not guarantee a cost-free exit in actual trading.
Step 6 - Interpret exits and changes in structure
A TP reached alert means that the script's target condition has been met. A Stop-loss reached alert means that its stop condition has been met. Neither confirms that a broker executed an order.
A bearish CHoCH during an upward move provides information about a structural change. It does not automatically mean that the planning layer closed a position, nor that every internal change requires the same response. Target exits, invalidation exits, and any discretionary response to opposing structure should be defined before acting on a setup. The script does not automatically carry out partial sales or discretionary exits described by a user's plan.
Manual analysis versus calculated setups
The manual sequence above explains how the visual components can be read together. The optional planning layer instead evaluates its configured rules, filters, and calculation methods. It does not necessarily require that exact sequence. Neither workflow supplies verified profitability or guarantees that a displayed setup will succeed.
Alerts
Available conditions cover internal and swing BOS/CHoCH/CHoCH+, liquidity grabs and sweeps, equal highs/lows, imbalance formation, zone interactions, order-block breaks, trendline breaks, detected patterns, and optional setup/target/stop events.
Select this indicator in TradingView's Create Alert dialog, then choose the event. Use Once Per Bar Close when you want close-confirmed notifications. General CHoCH alerts also include supported changes; separate CHoCH+ conditions are available. Some touch conditions can remain true across consecutive bars, so they should not be interpreted as one notification per zone for its entire lifetime.
Timing, historical drawings, and limitations
Pivot-based features require later bars to confirm earlier turning points. Labels and zones may be anchored back to those earlier bars, although the information was not available at that time.
Live candles and enabled previews can change before close. This indicator is not presented as universally non-repainting.
Zone removal depends on mitigation, age, overlap, and retention settings. Older drawings can disappear as new observations replace them.
Results depend on the symbol, timeframe, session, available history, and settings. Different indicators can use different definitions and produce different results.
The confluence score is a rule-based score, not a calibrated probability. Volume percentages and Strong/Weak labels are not measures of signal accuracy.
The planning layer does not provide a broker execution model, Strategy Tester results, or verified profitability. No accuracy, return, or future-performance claim is made.
Source acknowledgment
The hierarchical pivot-detection logic used in the Liquidity Grabs module is adapted from LuxAlgo's open-source "Pure Price Action Liquidity Sweeps", licensed under CC BY-NC-SA 4.0. Modifications include wick-frame rendering, display controls, and alert handling. Credit for the adapted source logic belongs to LuxAlgo.
This acknowledgment concerns the identified open-source component and does not imply access to LuxAlgo's closed-source Price Action Concepts indicator. This publication is not affiliated with or endorsed by LuxAlgo.
Intended use
For educational chart analysis and discretionary decision support. Users remain responsible for validating the settings, interpreting signals, and managing risk. No displayed zone, pattern, or setup guarantees a particular market outcome.
Indicator

AMD Structure Map [AxeAlgo]AMD Structure Map
============================================
------------------------------------------------------------
WHAT THIS SCRIPT DOES
------------------------------------------------------------
AMD Structure Map automatically detects the Accumulation → Manipulation →
Distribution cycle on any chart, in real time, and draws each phase as its
own labeled zone directly on the candles — so the market's own three-act
structure is visible as it forms, instead of something you have to
eyeball yourself after the fact.
This is a pattern-recognition and structure-labeling tool. It identifies
and visualizes market structure per the AMD model. It does not predict
future price direction, it does not generate buy or sell signals, and
nothing it draws should be treated as a trading recommendation.
------------------------------------------------------------
BACKGROUND — WHAT "AMD" MEANS
------------------------------------------------------------
AMD is a way of reading price action as three sequential acts:
Accumulation is a period where price contracts into a range while orders
build on both sides of the market. Manipulation is a deliberate-looking
move beyond that range — far enough, and on enough volume, to run the
stop-losses and breakout orders sitting just outside it — that then fails
and closes back inside. Distribution is the real, sustained move that
follows, expanding in the opposite direction of that failed move.
The core idea is that the Manipulation phase exists to create liquidity:
a move beyond an obvious range draws in breakout traders and triggers
stops on the other side, providing the volume needed for the real
directional move that follows. Whether or not you subscribe to that
interpretation, the three-part sequence — range, false break, real break
— is a recurring, observable structure across most liquid markets and
timeframes, and this script exists to detect it mechanically and
consistently rather than by eye.
------------------------------------------------------------
HOW EACH PHASE IS DETECTED
------------------------------------------------------------
ACCUMULATION is flagged by genuine volatility contraction: a fast-length
ATR reading meaningfully below its own slow-length ATR baseline, averaged
over a short recent window rather than judged off a single bar, combined
with a minimum range width relative to current volatility. This rules out
both a lone quiet tick being mistaken for real compression and micro-noise
ranges being mistaken for a real base. Once contraction is confirmed, the
zone locks to the highest high and lowest low of the seed window and does
not move afterward.
MANIPULATION is a liquidity sweep: a wick that pierces beyond the
Accumulation range by a minimum distance, on volume above this specific
cycle's own frozen baseline (measured from its own seed window, not a
constantly-rolling average that would otherwise get distorted by the
sweep's own volume spike), that closes back inside the range within a
short window of bars. It does not have to reverse on the exact same bar
it pierced — it is given a handful of bars to do so, since real liquidity
sweeps do not always resolve instantly. The moment a sweep confirms, the
script labels the zone with an Expected Direction: opposite the side that
was swept, since that is what the AMD model itself defines Distribution to
be. If price later sweeps the OPPOSITE side too, before the range
resolves, that second sweep supersedes the first and the call flips —
capped at one such re-arm, since a range swept a third time no longer
looks like a clean setup.
DISTRIBUTION is a confirmed break — by distance and by volume, both judged
against that same frozen baseline — in the direction the Manipulation
phase called. Only at that point is the cycle logged as complete. A break
in the SAME direction as the earlier sweep is logged separately and
honestly as "Manipulation Failed," since the expected reversal did not
occur — the script does not force an incomplete or contradictory sequence
into the AMD narrative just because a Manipulation event happened
somewhere in the range's history.
------------------------------------------------------------
ON THE EXPECTED DIRECTION LABEL
------------------------------------------------------------
The "Expected Direction" shown on the Manipulation zone is a direct
restatement of the AMD model's own definition, not an independent
forecast: Distribution is, by definition, the move opposite the side that
got swept. It carries no probability estimate, is not back-tested, and is
not a trade instruction. It is confirmed or denied by the same real
price-and-volume break logic used everywhere else in the script — nothing
is assumed true until price actually does it.
------------------------------------------------------------
WHAT YOU SEE ON THE CHART
------------------------------------------------------------
Each phase is drawn as its own colored zone box with a label. The
Accumulation zone appears the moment contraction confirms. The
Manipulation zone appears the moment a sweep confirms, labeled with the
Expected Direction. The Distribution zone appears ONLY once the break
genuinely confirms in that expected direction — it is sized to the
Accumulation range's own width rather than to whatever the breakout bar's
own volatility happened to produce, then grows to track the real move for
a limited window before freezing in place, so it always reads as a
proportionate rectangle rather than an arbitrary spike or a box that
keeps expanding indefinitely.
A cycle that does not complete — a Manipulation that failed to lead to a
real Distribution break, or a breakout with no Manipulation ever detected
beforehand — is marked with a single small flag rather than a full zone
box, since nothing pattern-like actually happened there. A small signal
also marks the exact first candle a genuine Distribution phase begins on.
An optional session-window highlight is available for traders who want to
see which cycles are forming inside a specific trading session.
------------------------------------------------------------
DASHBOARD
------------------------------------------------------------
A compact corner table shows the current phase and its status, the
current Expected Direction, an optional higher-timeframe bias reading
(a simple moving-average slope check on a timeframe you choose, shown
purely as background context and never used to filter or alter
detection), and a running Follow-Through Rate.
The Follow-Through Rate is a historical tally, going back to when the
chart loaded, of how often this chart's own past Manipulation calls
actually went on to confirm into a real Distribution break versus failing
or the range simply expiring. It is not a win rate, not the result of a
back-tested strategy, and not a claim about the cycle currently forming.
The percentage is intentionally hidden until a minimum number of cycles
have been observed, so a small handful of outcomes is never presented as
a statistically meaningful rate.
------------------------------------------------------------
INPUTS
------------------------------------------------------------
A single Detection Sensitivity dial (Loose / Normal / Strict) governs
every underlying threshold at once — the seed window length, the required
depth of volatility contraction, the sweep depth and volume requirements,
and the breakout distance and volume requirements. Loose finds more
cycles at looser quality; Strict finds fewer, higher-conviction cycles
only.
Beyond that, every visual element can be toggled or recolored
independently: the zone boxes, the phase labels, the Expected Direction
label, the Distribution start signal, the Follow-Through Rate row, the
higher-timeframe bias row, the session highlight, and the on-chart legend.
A "completed cycles only" mode is also available, which hides everything
while a cycle is still forming and only draws it — retroactively, all at
once — if and when it actually completes the full sequence.
------------------------------------------------------------
CALCULATION AND REPAINT BEHAVIOR
------------------------------------------------------------
All detection logic runs exclusively on confirmed, closed bars. Nothing is
decided from an intrabar wick on the currently forming candle. A sweep
candidate's return window is evaluated bar by bar as it actually happens,
never by looking ahead. A confirmed Manipulation call can be superseded
later within the same range by the one-time re-arm described above, but
only by an equally real, fully confirmed opposite-side sweep — never
speculatively, and never by revising a call that has already led to a
resolved outcome. Once a range resolves, or a zone's phase has finished,
its boundaries are not redrawn or repainted. Higher-timeframe data is
requested with lookahead explicitly disabled, so historical bars never
change; only the still-forming higher-timeframe candle can naturally
update until it itself closes, which is standard behavior for any
multi-timeframe context reading and is not repainting in the sense of
historical values changing after the fact.
------------------------------------------------------------
LIMITATIONS
------------------------------------------------------------
This script is a structure-labeling tool, not a trading system. It has no
concept of risk management, position sizing, or trade execution, and it
does not account for spread, slippage, commissions, or liquidity
conditions specific to any individual broker or exchange. Detection
quality depends heavily on the instrument, timeframe, and chosen
sensitivity setting — a setting well suited to one market or timeframe may
under- or over-detect on another, and some manual tuning of the
sensitivity dial is expected. Past detected cycles, and the Follow-Through
Rate built from them, describe what has already happened on this specific
chart and are not a guarantee of how future cycles on the same chart, or
on any other chart, will behave.
------------------------------------------------------------
DISCLAIMER
------------------------------------------------------------
This script detects and labels historical and current market structure
per the AMD model only. Nothing it displays is a probability of future
price direction, a guarantee, or a buy or sell instruction — a
Manipulation event describes a liquidity sweep that has already happened,
not a prediction of what comes next, and a Distribution zone is only ever
drawn once the corresponding break has already confirmed. The Expected
Direction label is a restatement of the pattern's own definition, not a
forecast. The Follow-Through Rate is a tally of what has already happened
to this chart's own past Manipulation calls, typically a modest sample
size, and should not be read as a win rate or as investment advice.
Trading involves substantial risk of loss and is not suitable for every
investor. Nothing in this script or its description constitutes financial,
investment, or trading advice, and past structure detected by this
script is not indicative of future results. Use at your own discretion
and risk.
Indicator

Indicator

SMC EngineSMC Engine
Overview
SMC Engine is a market-context indicator designed to identify potential liquidity sweeps and directional pressure around a selected session range.
The indicator combines an open-based NY range, candle spread analysis, and lower-timeframe volume pressure to classify market conditions such as Stop Hunts, directional aggression, and breakouts.
The default session is 09:30–10:30 New York time, but the session and timezone can be adjusted from the settings.
Key Features
Open-based NY session range
Automatic range box visualization
Projected range levels after the session
Candle spread anomaly detection
Lower-timeframe volume pressure
Stop Hunt High detection
Stop Hunt Low detection
Bullish Aggression detection
Bearish Aggression detection
Breakout Up/Down classification
Real-time sentiment dashboard
How It Works
1. Open-Based NY Range
During the selected session, the indicator tracks the highest and lowest candle opening prices.
These levels form the open-based range used by the sentiment engine.
Note: This is an open-based range, not a conventional opening range calculated from candle highs and lows.
2. Spread Analysis
The indicator compares the current candle's spread (High - Low) with its average spread over the selected baseline period.
Default settings:
Spread Baseline: 50 bars
Spread Anomaly Multiplier: 2.0
When the current spread exceeds the baseline multiplied by the anomaly multiplier, it is classified as a spread anomaly.
3. Volume Pressure
The indicator uses lower-timeframe candle data to estimate directional volume pressure.
Lower-timeframe close > open → volume is counted as positive
Lower-timeframe close < open → volume is counted as negative
Lower-timeframe close = open → volume is ignored
The resulting value is used as a volume-pressure proxy.
This is not true bid/ask volume delta.
Sentiment Conditions
Stop Hunt High
A Stop Hunt High is identified when:
The candle has an unusually large spread
Price trades above the open-based range high
The candle closes back at or below that level
Lower-timeframe volume pressure is negative
The signal is displayed with an orange downward triangle.
This can be viewed as a potential bearish liquidity-sweep setup.
Stop Hunt Low
A Stop Hunt Low is identified when:
The candle has an unusually large spread
Price trades below the open-based range low
The candle closes back at or above that level
Lower-timeframe volume pressure is positive
The signal is displayed with an orange upward triangle.
This can be viewed as a potential bullish liquidity-sweep setup.
Bullish / Bearish Aggression
When a spread anomaly occurs without meeting the Stop Hunt conditions, the indicator evaluates candle direction and volume pressure to identify:
Bullish Aggression
Bearish Aggression
Air Pocket/Uncertain
Breakouts
When the spread is not classified as an anomaly, the indicator can identify:
Breakout Up
Breakout Down
These classifications are based on price closing beyond the open-based range together with corresponding volume pressure.
How to Use It
The indicator is primarily intended as a market-context and confirmation tool, rather than a standalone buy/sell system
A simple way to use the Stop Hunt signals is:
Bullish Setup
Stop Hunt Low → wait for confirmation → consider long
When an orange Stop Hunt Low appears, avoid entering immediately. Observe the following price action and look for bullish confirmation before considering a long trade.
Bearish Setup
Stop Hunt High → wait for confirmation → consider short
When an orange Stop Hunt High appears, avoid entering immediately. Observe the following price action and look for bearish confirmation before considering a short trade.
The Stop Hunt signal should therefore be treated as a setup/area of interest, not an automatic entry signal.
Traders can combine the signal with their own market structure, price action, risk management, and higher-timeframe analysis.
Dashboard
The dashboard displays:
VSA Price Spread — current candle spread in ticks
Baseline Spread — average spread used for anomaly detection
Volume Pressure — calculated lower-timeframe directional volume pressure
Current Sentiment — current classification produced by the engine
Recommended Usage
The default configuration is designed around using a lower timeframe for volume-pressure analysis, such as a 1-minute lower timeframe on a 5-minute chart.
The appropriate settings can vary by market, symbol, and timeframe, so traders should test the indicator under the conditions in which they intend to use it.
Important Limitations
The range is based on candle opens, not highs and lows.
Volume Pressure is a directional-volume proxy and should not be interpreted as true bid/ask delta.
A Stop Hunt signal does not guarantee a reversal or profitable trade.
Breakout classifications do not guarantee that a breakout will continue.
The indicator does not determine stop-loss placement, take-profit levels, or position sizing.
Market conditions, liquidity, and data-feed characteristics can affect the behavior of lower-timeframe calculations.
Traders should independently test and validate the indicator before using it in live trading.
SMC Engine is intended for market analysis and educational purposes and should be used together with appropriate risk management. Indicator

Structure Participation Matrix [MQLSoftware]OVERVIEW
Structure Participation Matrix turns confirmed structure breaks into auditable records. It shows price-travel and chart-feed participation context, then compares endpoints across frozen score buckets. Each record has four readings, a score, and one delayed observation. It is research, not entries, stops, targets, sizing, execution, or forecasts.
Its distinct contribution is the complete frozen event ledger: strict delayed pivots, four disclosed measurements fixed at the break close, explicit UNSCORED handling, and one outcome check aggregated by frozen bucket. It links structure, participation, and later observation rather than merely combining standard indicators.
CONCEPTS
Strict symmetric pivots require a unique extreme on both sides; ties are rejected. A pivot becomes eligible only after its full right-side delay. A break requires a confirmed close beyond the armed level plus the ATR buffer; a wick alone is not an event.
Four 0-100 components freeze at that close. PATH measures displacement against the leg's total path. CLOSE averages directional close location over its final bars. REL VOL compares average leg volume with a rolling median. BALANCE weights volume by close location. The fixed score is 30% EFF/PATH, 25% CLOSE, 25% RVOL/REL VOL, and 20% BAL/BALANCE, normalized once for displays, buckets, and alerts.
RVOL uses reported or tick volume; BAL is an OHLCV proxy. They are not bid/ask delta, order flow, or a footprint; neither proves participant identity or predicts future behavior. Missing leg volume or bounded history makes an event UNSCORED and excludes it from bucket statistics.
After exactly N confirmed bars, the close is checked once. HELD N means the endpoint is beyond the broken level; FAILED N means it is not. HELD does not mean price stayed beyond the level throughout. The result is fixed.
FEATURES
Confirmed BREAK UP and BREAK DOWN events
Latest-event PATH, CLOSE, VOL, BAL rail
LOW, MODERATE, HIGH, and VERY HIGH score bands
HELD N or FAILED N endpoint checks
Sample-aware count and held-at-N rate by bucket
Break, direction, score-60+, and outcome alerts
HOW TO USE
Start with defaults. Higher Strict Swing Strength gives fewer pivots and a longer delay. Break Buffer sets the required closing distance in ATR units. Maximum Measured Leg Bars bounds history; an older leg remains a visible UNSCORED break.
Read the latest label first. In the rail, PATH describes travel efficiency; CLOSE, final-bar commitment; VOL, relative chart activity versus baseline; and BAL, a directional OHLCV proxy. The score summarizes a frozen event, not an instruction or probability.
The newest event keeps its expanded label and rail. Older events become compact labels; Historical Detailed Rails restores detail. Visual switches and retention affect drawings only, not calculations, counts, or alerts.
The matrix uses events recalculated from the history currently loaded on the chart. Counts and rates change with symbol, timeframe, inputs, or the history boundary. Small buckets remain collecting. HELD N rates are historical endpoint observations, not future estimates.
CONCLUSION
The result is an inspectable break record with transparent measurements, compact history, one timed outcome, and visible data limits. Indicator

Adaptive Structure Support & ResistanceChinese description is provided below. Chinese readers, please scroll down to read.
A structure-based support and resistance framework using confirmed pivots, price clustering, adaptive search ranges, historical reaction analysis and post-break role reversal.
1. What is this indicator?
Adaptive Structure Support & Resistance is a market-structure tool designed to identify the support and resistance areas that are currently most relevant to price.
The purpose of this script is not to display every historical swing high and swing low.
Instead, it attempts to answer a more practical question:
Among all historical turning points, which price areas still have enough structural significance to matter to the current market?
The script therefore treats support and resistance as a multi-stage structural problem.
The complete process is:
Identify confirmed swing highs and swing lows.
Merge nearby turning points into structural price clusters.
Evaluate the historical importance of each cluster.
Determine how far above and below the current price the model needs to search.
Select the most relevant support and resistance structures.
Evaluate the historical strength of the selected structures.
Convert exact levels into practical support/resistance zones.
Track what happens after a confirmed break.
Require a retest or rebound before confirming a support/resistance role reversal.
This means that the script is not simply:
ta.pivothigh(...)
ta.pivotlow(...)
followed by two horizontal lines.
Confirmed pivots are only the raw structural observations. Several additional stages are used before a level becomes the displayed support or resistance.
2. Why was this model designed?
Traditional automatic support/resistance tools often face several practical problems.
Too many levels
If every historical pivot is plotted independently, the chart can quickly become filled with horizontal lines. Many of those lines represent nearly identical prices or structures that are no longer relevant.
A single pivot may not represent a meaningful structure
A temporary local high or low can occur for many reasons. A more meaningful market structure often forms when price reacts around the same area multiple times.
Fixed search distances do not work equally well for every instrument
A low-volatility instrument may have meaningful support only 10–20% below the current price.
A highly volatile or strongly trending instrument may require a much wider historical price range before a significant support or resistance structure appears.
The nearest level is not always the most important level
A minor pivot located very close to current price may be less meaningful than a slightly more distant area that has produced several strong historical reactions.
A breakout does not automatically mean role reversal
Resistance does not necessarily become support simply because price trades above it once.
Likewise, support does not necessarily become resistance immediately after one breakdown.
The model is designed around these problems.
Its goal is therefore not to maximize the number of detected structures, but to reduce historical information into a smaller set of currently relevant structural areas.
3. Where can this indicator be used?
The script is intended for standard price charts where historical swing structure is meaningful.
Typical applications include:
Stocks
Indices
ETFs
Futures
Foreign exchange
Cryptocurrency
Other liquid instruments with usable price history
It can be used on different timeframes, but the meaning of the detected structure changes with the timeframe.
For example:
A support structure on a 15-minute chart describes short-term intraday structure.
A support structure on a daily chart describes a larger swing structure.
A support structure on a weekly chart may represent a long-term structural price area.
The indicator does not automatically convert a lower-timeframe level into a higher-timeframe level.
The displayed support and resistance always belong to the chart timeframe being analyzed.
4. Core principle: confirmed structural pivots
The first stage identifies confirmed pivot highs and pivot lows.
A pivot requires price bars on both sides of the potential turning point.
Representative logic:
float pivotHigh = ta.pivothigh(
high,
pivotLeftBarsInput,
pivotRightBarsInput)
float pivotLow = ta.pivotlow(
low,
pivotLeftBarsInput,
pivotRightBarsInput)
The important word here is confirmed .
A newly formed high is not immediately considered a structural resistance observation.
A newly formed low is not immediately considered a structural support observation.
The model waits for the configured number of right-side bars before confirming the pivot.
The intention is to sacrifice some immediacy in exchange for more stable structural observations.
This also means that pivot detection naturally contains confirmation delay.
That delay is part of the methodology rather than an attempt to predict a turning point before it exists.
5. Core principle: price clustering
Multiple pivots occurring around similar prices should not necessarily be treated as unrelated horizontal levels.
For this reason, the script groups nearby pivot observations into price clusters.
Conceptually:
float distancePercent =
math.abs(price - clusterPrice) /
clusterPrice *
100.0
if distancePercent <= mergePercent
matchingIndex := clusterIndex
If several historical lows occur around approximately the same area, they can contribute to one support structure.
The same process applies to historical highs when building resistance structures.
This changes the interpretation from:
"Price touched 12.01, 12.05 and 12.09."
to:
"Price has repeatedly reacted around the same structural area."
The cluster center is updated using the accumulated structural contribution of its observations rather than simply keeping the first pivot price.
6. Core principle: structural ranking
Not every cluster deserves the same importance.
Each pivot contributes a base structural score that incorporates relative volume participation and recency.
A simplified representation of the calculation is:
float pivotBaseScore =
1.0 +
volumeWeightInput * volumeRatio +
recencyWeightInput * recencyFactor
When several pivots belong to the same cluster, their contributions accumulate.
After the candidate clusters have been created, the model evaluates structures within the active search range.
The final ranking also gives a limited preference to structures nearer the current price:
float candidateRank =
accumulatedBaseScore +
proximityBonusInput *
proximityFactor
Proximity is therefore useful, but it is not the entire model.
A level is not selected only because it is the nearest pivot.
7. Relative volume participation
Historical price reactions can contain different levels of market participation.
For each pivot observation, volume is compared with its recent average.
Representative logic:
float volumeRatio =
pivotAverageVolume > 0.0
? math.min(
pivotVolume / pivotAverageVolume,
3.0)
: 1.0
Higher relative volume can contribute additional structural weight.
However, volume is only one component.
The model does not assume that high volume by itself automatically creates support or resistance.
8. Historical reaction analysis
A structural level is more informative when historical interactions with that area produced meaningful price responses.
For a support pivot, the model measures the maximum upside response after the confirmed low during a configurable observation window.
Conceptually:
float reactionPercent =
(highestPostPivotPrice / pivotPrice - 1.0) *
100.0
For resistance, the opposite calculation is used:
float reactionPercent =
(pivotPrice - lowestPostPivotPrice) /
pivotPrice *
100.0
This allows the model to distinguish between two different situations.
A level that price touched repeatedly but barely reacted to.
A level where historical interaction repeatedly produced meaningful rejection or recovery.
These situations are not treated as structurally equivalent.
9. Why the search range is adaptive
One of the main design features of this script is that support and resistance do not have to use the same fixed search distance.
A fixed 25% range can work well for one instrument but fail on another.
A fixed 100% range may capture important historical structures, but can also introduce unnecessarily distant structures when meaningful nearby levels already exist.
The Auto mode therefore uses progressive search tiers.
25%
50%
75%
100%
The algorithm first asks whether the nearest tier contains a structure that satisfies minimum structural requirements.
If it does, the search can stop.
If it does not, the model expands to the next tier.
Representative logic:
if distancePercent <= 25.0
result := 25.0
else if distancePercent <= 50.0 and maximumRangePercent >= 50.0
result := 50.0
else if distancePercent <= 75.0 and maximumRangePercent >= 75.0
result := 75.0
else if distancePercent <= 100.0 and maximumRangePercent >= 100.0
result := 100.0
The important feature is that support and resistance are evaluated independently .
For example:
Support search range: 25%
Resistance search range: 75%
This can occur when a meaningful support structure exists close below price, while the next meaningful resistance structure is much farther above the market.
10. The model does not stop at the first nearby pivot
Adaptive search would not be useful if any small nearby pivot could immediately stop expansion.
The model therefore requires a nearby structure to satisfy minimum quality conditions.
Conceptually:
bool qualifiedStructure =
touchCount >= minimumStructureTouchesInput and
structureQuality >= adaptiveQualityThreshold
Only a qualified structure can stop the search from expanding to the next distance tier.
This prevents a minor local pivot from automatically hiding a larger and more meaningful historical structure.
11. Volatility-aware search adjustment
Volatility also affects how much evidence is required from nearby structures.
ATR is converted into a percentage of price:
float currentAtrPercent =
close > 0.0
? averageTrueRange / close * 100.0
: 0.0
When volatility is high, the minimum structural-quality requirement is increased moderately.
Representative logic:
if currentAtrPercent >= 6.0
adaptiveQualityThreshold :=
minimumStructureQualityInput + 8.0
else if currentAtrPercent >= 4.0
adaptiveQualityThreshold :=
minimumStructureQualityInput + 5.0
The purpose is not simply:
Higher volatility = wider search range.
Instead:
Higher volatility = minor nearby structures need stronger evidence before they are allowed to stop the search.
This distinction is important.
Volatility assists the structural search; it does not independently determine support or resistance.
12. Structural quality used by adaptive search
To decide whether search expansion can stop, a separate quality model evaluates candidate clusters.
The quality assessment combines several components:
Number of structural interactions
Average historical reaction
Relative volume participation
Recency
Accumulated structural contribution
A simplified representation is:
float structureQuality =
touchComponent +
reactionComponent +
volumeComponent +
recencyComponent +
baseScoreComponent
The result is bounded to a 0–100 scale.
clampValue(
structureQuality,
0.0,
100.0)
This quality score primarily answers:
"Is this structure meaningful enough for the adaptive search to stop here?"
It is separate from the final displayed strength score.
13. Selecting the final support and resistance
After the adaptive search distance has been determined, the model evaluates all valid clusters inside that range.
For support:
The cluster must be below or near the current price.
It must remain inside the active support search range.
Its structural score is combined with a proximity adjustment.
For resistance, the same process is applied above current price.
The highest-ranked candidate becomes the primary structural level.
This means that the displayed level represents the outcome of:
confirmed pivots → clustering → structural scoring → adaptive distance selection → final ranking
rather than simply selecting the latest high or low.
14. Strength score: what does 0–100 mean?
After the primary support and resistance levels are selected, the model performs a second evaluation.
This stage describes the historical quality of the selected structure .
The strength score considers:
Touch count
Average reaction after historical interactions
Relative volume participation
Recency
Repeated crossings of the level
Fast failed breaks
The positive components are conceptually:
float rawStrengthScore =
touchComponent +
reactionComponent +
volumeComponent +
recencyComponent +
stabilityComponent -
totalPenalty
Repeated crossings reduce the score:
float totalPenalty =
crossingCount *
crossingPenaltyInput +
failedBreakCount *
failedBreakPenaltyInput
The final value is limited to 0–100.
The interface converts it into:
Weak
Medium
Strong
The score should not be interpreted as:
82 points = 82% probability that support will hold.
It does not represent probability, expected return or strategy win rate.
It is a normalized description of historical structural behavior.
15. Why repeated crossings reduce strength
A price level may appear frequently in historical data simply because the market traded through it many times.
That does not necessarily make the level stronger.
A structurally useful support or resistance area usually produces some degree of rejection, recovery or directional response.
For this reason, the script counts repeated close-to-close crossings.
Representative logic:
bool crossedAbove =
olderClose <= level and
newerClose > level
bool crossedBelow =
olderClose >= level and
newerClose < level
if crossedAbove or crossedBelow
crossingCount += 1
Frequent crossings therefore reduce structural strength instead of increasing it automatically.
16. Why support and resistance are displayed as zones
Real market structure rarely operates at one mathematically exact tick.
Several pivots may occur at slightly different prices while still representing the same area.
The script therefore displays:
A center structural level
A surrounding structural zone
Zone width contains two elements.
First, the actual spread of the clustered pivot prices.
Second, a small volatility-sensitive padding:
float zonePadding =
math.max(
selectedLevel *
minimumZoneWidthPercentInput /
100.0,
averageTrueRange *
atrZoneMultiplierInput)
The center line is useful for reference.
The surrounding area is intended to represent the broader price region where structural interaction may occur.
17. Breakout detection uses the previous structure
There is an important implementation detail in breakout detection.
When price breaks resistance, the current resistance calculation may immediately change because current price itself has changed.
If breakout detection used only the newly recalculated structure, the model could lose the level that price actually broke.
The script therefore references the previously confirmed zone:
float previousResistanceZoneUpperBound =
resistanceZoneUpperBound
float resistanceBreakTrigger =
previousResistanceZoneUpperBound *
(1.0 +
breakoutBufferPercentInput /
100.0)
The same principle applies to support breakdowns.
This allows the structural state machine to remember the actual area involved in the break.
18. Resistance does not immediately become support
A confirmed break starts a new structural state.
The model uses named states internally:
const int STATE_NORMAL = 0
const int STATE_BREAKOUT_WAITING_RETEST = 1
const int STATE_RESISTANCE_TO_SUPPORT = 2
const int STATE_BREAKDOWN_WAITING_REBOUND = -1
const int STATE_SUPPORT_TO_RESISTANCE = -2
After resistance is broken:
The previous resistance area is stored.
The model enters a "waiting for retest" state.
Price is monitored for a return toward the old resistance.
If the retest holds, the former resistance may become support.
If price falls back through the old zone, the breakout is treated as failed.
Representative confirmation logic:
bool testedFormerResistance =
low <=
roleReversalUpperBound *
(1.0 +
retestTolerancePercentInput /
100.0)
bool retestHeld =
testedFormerResistance and
close > roleReversalUpperBound
Only after this process can the old resistance be promoted to support.
19. Support-to-resistance uses the opposite process
After support is broken:
The previous support area is stored.
The model waits for a rebound.
Price must test the former support area.
If price is rejected and cannot recover the area, the former support can become resistance.
Representative logic:
bool testedFormerSupport =
high >=
roleReversalLowerBound *
(1.0 -
retestTolerancePercentInput /
100.0)
bool reboundRejected =
testedFormerSupport and
close < roleReversalLowerBound
This creates a distinction between:
price crossed a level
and:
the market actually completed a structural role reversal.
20. Failed breakout and failed breakdown
The script also monitors invalidation after a break.
If resistance is broken but price quickly returns below the former resistance structure, the event can be treated as a failed breakout.
If support is broken but price quickly recovers the former support structure, the event can be treated as a failed breakdown.
These events reset the pending role-reversal process rather than automatically promoting the old structure to a new role.
21. How to use the indicator
A simple workflow is:
Locate the current support
Identify the support area below the current market.
This is the structural area currently considered most relevant by the model.
Locate the current resistance
Identify the active structural resistance above price.
Read the strength
A stronger score indicates that the selected structure has historically shown better structural characteristics under this model.
It does not mean the level cannot break.
Read "Why this level?"
The dashboard shows the number of historical structural interactions and the average subsequent reaction.
This gives a plain-language explanation for why the level has been selected.
Check how far the algorithm searched
For example:
"Below 25% | Above 75%"
means that qualified support was available relatively close below current price, while the model had to inspect a much wider area to find qualified resistance.
Observe the current structural state
The dashboard may report states such as:
"Price is between support and resistance"
"Resistance broken; waiting for a retest"
"Former resistance is currently acting as support"
"Support broken; waiting for a rebound"
"Former support is currently acting as resistance"
22. Practical interpretation
The indicator is designed primarily as a context tool .
For example:
Price approaching strong support does not automatically mean "buy".
It means price is entering an area that has meaningful structural evidence and may deserve closer observation.
Likewise:
Price approaching resistance does not automatically mean "sell".
It identifies an area where historical supply or rejection has been structurally significant.
A trader can then combine that context with his or her own analysis of:
Price action
Volume
Trend
Market regime
Higher-timeframe structure
Risk/reward
Position sizing
Independent fundamental or macro analysis
The script itself does not generate automatic buy or sell orders.
23. Dashboard explanation
The dashboard intentionally avoids exposing every internal statistical variable.
Instead, it translates the model into simpler trading language.
Support
Current selected support level and its strength evaluation.
Why this level?
Shows how many historical structural interactions contributed to the area and the average subsequent upside response.
Resistance
Current selected resistance level and strength evaluation.
Why this level?
Shows historical interactions and the average subsequent downside response.
How far it searched
Shows the active adaptive search range below and above the current market.
Current state
Explains whether price remains between the structures, has broken one of them, is waiting for confirmation, or has completed a role reversal.
24. Main settings
Lookback Bars
Controls how much historical price data is considered when constructing structural clusters.
A longer lookback includes more historical structure but may also retain older information.
Pivot Left Bars / Pivot Right Bars
Control how strict pivot confirmation is.
Larger values generally identify larger structural turns but require more confirmation.
Price Cluster Width %
Controls how close two pivot observations must be before they can belong to the same structural area.
Search Mode
Auto allows support and resistance to determine their own search distances.
Manual uses a fixed maximum distance.
Maximum Auto Range
Defines the maximum distance the adaptive search is allowed to inspect.
Minimum Structure Quality
Controls how meaningful a structure must be before it can stop automatic search expansion.
Minimum Valid Tests
Defines the minimum number of structural observations required for a candidate to qualify during adaptive search.
Reaction Observation Bars
Defines how many bars after a historical pivot are examined when measuring its subsequent price reaction.
Break Confirmation Buffer
Adds a small margin beyond the old structural zone before a break is considered confirmed.
Retest Tolerance
Controls how close price must return to the former structural area during retest/rebound evaluation.
25. Alerts
Alert conditions are provided for:
Resistance break
Support break
Resistance confirmed as support
Support confirmed as resistance
Failed breakout
Failed breakdown
When close confirmation is enabled, structural break events are evaluated on confirmed bars.
26. About repainting and structural updates
This script should not be interpreted as a system that predicts pivots before they are confirmed.
Pivot highs and lows require right-side confirmation bars.
Therefore:
A newly forming pivot is not shown as confirmed structure until sufficient bars exist to confirm it.
Once new market data arrives, the active support and resistance can still change for legitimate structural reasons.
Examples include:
A new confirmed pivot enters the calculation.
Several new observations create a stronger price cluster.
Current price moves enough to change the relevant search region.
An older observation exits the configured lookback window.
A breakout creates a role-reversal state.
This is dynamic structural recalculation, not a promise that current support and resistance will remain fixed forever.
27. Why these components belong together
This script combines several concepts, but they are not independent indicators placed together for convenience.
Each component solves a different stage of the same problem.
Confirmed pivots identify potential structural observations.
Price clustering converts nearby observations into common price areas.
Structural ranking determines which areas contain more meaningful historical evidence.
Adaptive search determines how far the model needs to inspect for an adequate structure.
Reaction analysis measures how price historically responded to that structure.
Strength evaluation summarizes the historical quality of the selected area.
ATR-based zone construction converts an exact center price into a practical market area.
The role-reversal state machine manages what happens after the structure is broken.
The components are therefore sequential stages of one structural support/resistance framework rather than a mashup of unrelated indicators.
28. What is distinctive about this implementation?
The primary design characteristics of this implementation are:
Nearby pivots are aggregated into structural price clusters rather than displayed independently.
Support and resistance use independent adaptive search ranges.
Search expansion depends on structural quality rather than distance alone.
Volatility modifies the evidence required from nearby structures.
Level selection and level-strength evaluation are deliberately separated.
Repeated crossings and failed breaks can reduce structural strength.
Support and resistance are represented as price areas instead of exact single-price barriers.
Break detection references the previous structural zone.
Role reversal requires confirmation through a state machine instead of occurring immediately after a single crossing.
The chart intentionally focuses on the current relevant structure rather than filling the chart with historical event markers.
29. Limitations
No support/resistance algorithm can know with certainty whether a level will hold or fail.
Important limitations include:
Pivot confirmation introduces intentional delay.
Support and resistance may change as new information becomes available.
Historical reaction does not guarantee future reaction.
A high strength score is not a probability of success.
Very new instruments with limited history may not contain enough structural observations.
Strong trend transitions can invalidate historical structures quickly.
Volume-based components depend on the quality and meaning of the instrument's volume data.
Different timeframes can produce materially different support and resistance structures.
Synthetic or non-standard chart types may use transformed OHLC values and can therefore produce different structural results.
30. Final note
Support and resistance should be understood as areas of market interaction, not guaranteed turning points.
The purpose of this indicator is to organize historical structure and reduce it into a small number of currently relevant price areas.
It is an analytical framework, not an automatic trading system.
This script is intended for market-structure analysis and educational use. It does not constitute investment advice, a recommendation, or a guarantee of future market performance.
────────────────────────────────────
中文说明
1. 这个指标是什么?
Adaptive Structure Support & Resistance 是一个基于市场历史结构,自动寻找当前价格上下方关键支撑与压力区域的分析工具。
它解决的并不是:
“历史上哪里出现过高点和低点?”
而是试图解决一个更实际的问题:
“历史上这么多高低点里,哪些价格区域到现在仍然具有足够的结构意义,值得当前继续关注?”
所以,这个指标不是简单地把每一个 Pivot High 和 Pivot Low 都画成水平线。
完整计算过程包括:
识别已经确认的历史高低结构。
把价格相近的多个结构合并成一个价格簇。
评价不同价格簇的历史结构意义。
分别判断寻找支撑和压力到底需要看多远。
从有效搜索范围中选择当前更重要的支撑与压力。
评价被选中位置过去的实际价格反应。
将精确价格转化为更加符合实际交易的撑压区域。
价格突破或跌破以后保存原结构。
通过回踩或反抽确认撑压角色是否真正发生转换。
因此,Pivot 只是整个模型的第一步,而不是最终结果。
2. 为什么要做这套模型?
传统的自动支撑压力工具经常存在几个问题。
画出来的线太多
如果把每个前高前低全部保留下来,时间稍长以后主图会出现大量水平线。
不仅影响阅读,而且其中很多价格其实属于同一个结构。
单个高低点不一定有意义
市场临时出现一个局部最高点或最低点,并不能说明这个价格一定存在真正的供需结构。
如果不同时间价格多次来到相近区域并产生反应,它所代表的结构意义通常更加完整。
不同标的不能使用完全相同的搜索距离
有些股票距离现价下方 20% 就存在非常明确的历史结构。
有些高波动、长期趋势较强的股票,却可能需要向下或者向上看 50%、75% 甚至更远,才能找到真正有意义的位置。
距离最近的不一定最重要
现价附近可能存在一个很小的 Pivot,但稍微远一点的位置可能历史上被多次验证,并且每次都出现较大价格反应。
突破并不等于立刻完成撑压转换
突破压力一次,不应该马上认为压力已经变成支撑。
跌破支撑一次,也不应该马上认为原支撑已经成为新压力。
所以这套模型的设计目标不是“尽量多找线”。
而是:
尽量把复杂的历史价格结构压缩成少量、当前更值得关注的支撑和压力区域。
3. 可以用在哪里?
只要历史价格结构具有一定参考意义,理论上都可以使用,例如:
股票
指数
ETF
期货
外汇
加密资产
其他具有正常历史行情数据的流动性标的
不同周期看到的是不同级别的结构。
例如:
15分钟图得到的是偏短线结构。
日线得到的是波段级结构。
周线得到的是更长期的历史结构。
指标不会把15分钟的支撑自动解释成日线支撑。
所有计算都基于当前图表所使用的周期。
4. 第一步:确认历史结构高低点
模型首先通过已经确认的 Pivot High 与 Pivot Low 获取历史结构观察点。
核心逻辑:
float pivotHigh = ta.pivothigh(
high,
pivotLeftBarsInput,
pivotRightBarsInput)
float pivotLow = ta.pivotlow(
low,
pivotLeftBarsInput,
pivotRightBarsInput)
这里最重要的是“确认”。
一个刚刚形成的高点不会马上成为正式压力结构。
一个刚刚形成的低点也不会马上成为正式支撑结构。
需要等待右侧一定数量的K线完成确认。
所以模型主动接受一定的确认延迟,用来减少把尚未成立的短期极值直接当成重要结构的情况。
5. 第二步:把相近价格合并成一个结构
如果历史上存在:
12.01
12.05
12.09
这三个低点,实际上它们很可能描述的是同一片支撑区域,而不是三条完全独立的支撑线。
所以系统会计算不同 Pivot 之间的价格距离:
float distancePercent =
math.abs(price - clusterPrice) /
clusterPrice *
100.0
if distancePercent <= mergePercent
matchingIndex := clusterIndex
如果距离足够接近,就把它们合并到同一个价格结构中。
这样模型关注的就不再是:
“12.01碰过一次”
而是:
“12元附近这个区域历史上反复出现过结构反应。”
6. 第三步:给历史结构进行初步排序
并不是所有 Pivot 对结构的重要性都一样。
模型会考虑:
当时成交量相对大小
这个结构距离现在有多久
多个 Pivot 是否属于同一个价格区域
基础贡献大致表现为:
float pivotBaseScore =
1.0 +
volumeWeightInput * volumeRatio +
recencyWeightInput * recencyFactor
多个相近 Pivot 被合并后,它们的结构贡献会累积。
最后选择当前结构时,还会给予距离现价较近的位置一定加分:
float candidateRank =
accumulatedBaseScore +
proximityBonusInput *
proximityFactor
但这里需要注意:
“距离近”只是一个因素,并不是谁离现价最近就一定选择谁。
7. 成交量在这里做什么?
模型会把 Pivot 当时的成交量与近期平均成交量进行比较。
例如:
float volumeRatio =
pivotAverageVolume > 0.0
? math.min(
pivotVolume / pivotAverageVolume,
3.0)
: 1.0
如果某个结构形成时伴随更明显的市场参与,它可以得到额外权重。
但是成交量并不会单独决定支撑压力。
它只是结构评价中的一个辅助信息。
8. 历史触碰以后到底有没有真正反应?
一个位置历史上碰过很多次,并不代表它一定很重要。
关键还要看:
碰到以后,价格到底有没有发生真正的反向运动?
对于历史支撑 Pivot,系统观察之后一定K线范围内出现的最大向上反应。
核心思想:
float reactionPercent =
(highestPostPivotPrice / pivotPrice - 1.0) *
100.0
对于历史压力,则计算后续最大回落:
float reactionPercent =
(pivotPrice - lowestPostPivotPrice) /
pivotPrice *
100.0
这样能够区别:
一个历史上经常出现,但价格几乎没有明显反应的位置。
一个每次靠近以后,价格都出现较明显反转或回撤的位置。
9. 为什么搜索距离必须智能调整?
这是这个模型比较重要的一部分。
固定使用25%的搜索范围并不适合所有标的。
固定使用100%,又可能在不必要的情况下把非常遥远的历史结构纳入计算。
所以自动模式采用:
25%
50%
75%
100%
逐级寻找。
核心映射逻辑:
if distancePercent <= 25.0
result := 25.0
else if distancePercent <= 50.0 and maximumRangePercent >= 50.0
result := 50.0
else if distancePercent <= 75.0 and maximumRangePercent >= 75.0
result := 75.0
else if distancePercent <= 100.0 and maximumRangePercent >= 100.0
result := 100.0
如果25%以内已经存在合格结构,就可以停止。
如果没有,就扩大到50%。
依次类推。
10. 支撑和压力是分别搜索的
支撑和压力并不会强制使用同一个范围。
完全可能出现:
下方支撑搜索:25%
上方压力搜索:75%
它表达的意思是:
下方距离现价比较近的地方已经存在足够明确的历史支撑结构。
但是上方近距离没有达到要求的压力,所以模型继续向更远的位置寻找。
11. 为什么不是25%以内随便有个Pivot就停止?
如果只要附近出现一个 Pivot 就停止寻找,所谓智能搜索就没有意义。
因此,候选结构必须同时满足最低触碰次数和最低结构质量。
例如:
bool qualifiedStructure =
touchCount >= minimumStructureTouchesInput and
structureQuality >= adaptiveQualityThreshold
这意味着:
附近有结构 ≠ 附近有足够好的结构。
如果近端只是一个很弱的小级别价格点,系统仍然可以继续扩大搜索范围。
12. 波动率为什么也参与?
系统使用 ATR 相对于当前价格的比例观察标的自身波动程度。
float currentAtrPercent =
close > 0.0
? averageTrueRange / close * 100.0
: 0.0
高波动股票附近出现小 Pivot 非常正常。
因此,对于高波动标的,系统会适当提高“附近结构足够好”的要求。
例如:
if currentAtrPercent >= 6.0
adaptiveQualityThreshold :=
minimumStructureQualityInput + 8.0
else if currentAtrPercent >= 4.0
adaptiveQualityThreshold :=
minimumStructureQualityInput + 5.0
这里不是:
“ATR越高,搜索距离一定越远。”
而是:
“波动越高,附近的小结构必须更有说服力,才能阻止系统继续向外寻找。”
13. 智能搜索中的结构质量怎么计算?
用于决定“是否还要继续扩大搜索范围”的结构质量,主要包含:
历史触碰次数
触碰后的平均反应
相对成交量
结构新旧程度
多个结构累积后的基础得分
可以简化理解为:
float structureQuality =
touchComponent +
reactionComponent +
volumeComponent +
recencyComponent +
baseScoreComponent
最后压缩到0–100:
clampValue(
structureQuality,
0.0,
100.0)
这个分数主要解决的是:
“这个位置够不够好,好到可以不用继续向外找了?”
14. 最终支撑压力怎么选?
确定搜索范围以后,系统会重新检查范围内所有候选结构。
支撑必须位于现价下方或附近。
压力必须位于现价上方或附近。
最后比较:
历史结构累积得分
与当前价格的距离
选择当前 Rank 更高的结构。
所以最终看到的线经历了:
Pivot确认
→ 相近价格聚类
→ 结构评价
→ 智能搜索距离
→ 范围内重新排序
→ 最终支撑压力
15. 0–100强度分数到底是什么意思?
当最终支撑压力确定以后,系统会再做一次独立评价。
这一部分不是用来重新选择线,而是告诉你:
“现在已经选中的这条结构,历史质量到底怎么样?”
主要考虑:
触碰次数
历史平均反应
相对成交量
结构是否较新
是否经常被来回穿越
是否出现过快速失败突破
大致计算结构:
float rawStrengthScore =
touchComponent +
reactionComponent +
volumeComponent +
recencyComponent +
stabilityComponent -
totalPenalty
其中反复穿越和失败突破会扣分:
float totalPenalty =
crossingCount *
crossingPenaltyInput +
failedBreakCount *
failedBreakPenaltyInput
最后得到0–100,并转化成:
弱
中
强
但是一定不要理解成:
“82分 = 未来82%概率守住。”
它不是胜率,也不是未来预测概率。
它只是对历史结构质量进行标准化后的评分。
16. 为什么反复穿越反而扣分?
有些价格历史上出现很多次,仅仅是因为市场一直在这个位置上下震荡。
如果价格能够非常轻松地不断穿过这个位置,它未必是真正强支撑或强压力。
所以系统统计价格穿越中心结构的情况:
bool crossedAbove =
olderClose <= level and
newerClose > level
bool crossedBelow =
olderClose >= level and
newerClose < level
穿越越频繁,结构稳定性评价越低。
17. 为什么画的是区域,不只是一条线?
真实交易中,很少存在一个价格精确到最小报价单位以后永远有效。
历史多个 Pivot 本身就可能分布在一个小区间里。
所以模型保留:
中心结构价格
结构区域
区域宽度由:
历史 Pivot 聚类本身的价格范围
少量 ATR 波动缓冲
共同决定。
核心思想:
float zonePadding =
math.max(
selectedLevel *
minimumZoneWidthPercentInput /
100.0,
averageTrueRange *
atrZoneMultiplierInput)
中心线用于定位。
阴影区域用于表达真实市场中的价格博弈带。
18. 为什么突破使用上一根K线的压力?
这是结构判断里很重要的一点。
当价格突破压力以后,如果马上重新计算当前压力,那么旧压力可能已经被系统替换。
这样反而不知道价格刚刚突破的到底是哪一个结构。
所以突破判断使用突破之前已经存在的压力区域:
float previousResistanceZoneUpperBound =
resistanceZoneUpperBound
并基于它计算突破标准:
float resistanceBreakTrigger =
previousResistanceZoneUpperBound *
(1.0 +
breakoutBufferPercentInput /
100.0)
支撑跌破同理。
19. 突破压力以后为什么不能马上变成支撑?
系统内部使用一个状态机:
const int STATE_NORMAL = 0
const int STATE_BREAKOUT_WAITING_RETEST = 1
const int STATE_RESISTANCE_TO_SUPPORT = 2
const int STATE_BREAKDOWN_WAITING_REBOUND = -1
const int STATE_SUPPORT_TO_RESISTANCE = -2
突破压力以后:
保存原来的压力区域。
进入“等待回踩”状态。
观察价格是否重新回来测试原压力。
如果回踩以后守住,才确认压力转支撑。
如果重新跌回原结构下方,则视为突破失败。
回踩逻辑类似:
bool testedFormerResistance =
low <=
roleReversalUpperBound *
(1.0 +
retestTolerancePercentInput /
100.0)
bool retestHeld =
testedFormerResistance and
close > roleReversalUpperBound
20. 支撑转压力同样需要确认
支撑跌破以后:
保存原来的支撑。
等待价格反抽。
观察反抽是否重新接触原支撑区域。
如果无法重新站回,才确认原支撑变成压力。
例如:
bool testedFormerSupport =
high >=
roleReversalLowerBound *
(1.0 -
retestTolerancePercentInput /
100.0)
bool reboundRejected =
testedFormerSupport and
close < roleReversalLowerBound
因此模型会区分:
“价格只是穿过了一下”
与:
“原来的市场结构真正完成了角色转换”
21. 实际怎么使用?
最简单的使用顺序:
先看支撑在哪里
这是当前算法认为下方更值得关注的历史结构区域。
再看压力在哪里
这是当前上方更值得关注的历史结构区域。
看强度
强度越高,代表这个结构在模型评价中具有更好的历史表现。
但再强也可能被突破。
看“为什么是它?”
这里会直接告诉你历史上大致碰过多少次,以及碰到以后平均出现多大的反向运动。
看“算法看了多远”
例如:
下方25%|上方75%
意味着下方较近就找到了合格支撑,但是上方需要看更远,才找到合格压力。
最后看“现在怎么看”
这里会告诉你目前属于:
价格仍在支撑压力之间;
突破压力等待回踩;
原压力已经转为支撑;
跌破支撑等待反抽;
原支撑已经转为压力;
等结构状态。
22. 应该如何理解支撑压力?
这个指标最适合作为“位置和结构背景工具”。
例如:
价格到了强支撑,不等于自动买入。
它代表价格已经进入一个历史结构相对重要的位置,值得进一步观察。
同样:
价格到了强压力,也不等于必须卖出。
它代表价格进入过去曾经出现明显供给或回落反应的区域。
后续仍然可以结合自己的:
价格行为
成交量
趋势结构
大周期方向
市场环境
赔率
风险控制
仓位管理
共同判断。
23. 右上角面板怎么看?
我刻意没有把所有内部统计数据全部堆在面板上。
面板只保留实际使用中更容易理解的信息。
支撑位置
当前支撑在哪里,以及它的结构强弱。
为什么是它?
告诉你历史触碰次数和触碰以后平均反弹幅度。
压力位置
当前压力在哪里,以及强弱。
为什么是它?
告诉你历史触碰次数和之后平均回落幅度。
算法看了多远
显示支撑和压力分别使用了多大的搜索范围。
现在怎么看
使用大白话告诉你当前市场与撑压之间处于什么结构状态。
24. 常用参数怎么理解?
Lookback Bars / 回看K线数
决定使用多少历史K线寻找结构。
周期越长,可以考虑更久以前的结构,但也可能保留更多较旧的信息。
Pivot Left / Right Bars
决定 Pivot 判断严格程度。
数值越大,一般意味着只识别更明显的结构转折,同时确认速度也会更慢。
Price Cluster Width %
决定两个历史 Pivot 相差多少以内可以被认为属于同一结构。
Search Mode
Auto:自动决定支撑和压力分别要搜索多远。
Manual:手动固定搜索范围。
Maximum Auto Range
智能搜索允许向外扩展到的最大距离。
Minimum Structure Quality
决定附近结构必须达到多高质量,才能让系统停止继续扩大搜索。
Minimum Valid Tests
智能搜索中,一个结构至少需要多少次历史观察才能成为有效候选。
Reaction Observation Bars
计算历史 Pivot 出现以后,向后观察多少根K线的价格反应。
Break Confirmation Buffer
突破原撑压区域以后,需要额外超过多少缓冲才认定为有效突破。
Retest Tolerance
回踩或反抽过程中,允许价格距离原结构存在多大误差。
25. 警报
指标支持以下 Alert:
有效突破压力
有效跌破支撑
压力确认转支撑
支撑确认转压力
突破失败
跌破失败
如果启用了收盘确认,那么对应结构事件会等待K线确认以后判断。
26. 关于重绘和结构变化
这个指标不是提前预测 Pivot 的工具。
Pivot 本身必须等待右侧K线确认。
因此:
刚刚形成的最高点或最低点,不会在尚未确认时被当成已经成立的正式结构。
但是当前支撑压力未来仍然可能发生变化。
原因包括:
新的 Pivot 被确认。
新的历史触碰让另一个价格簇变得更重要。
现价移动以后,当前最相关的结构发生变化。
旧数据离开回看范围。
价格突破以后发生撑压角色转换。
这是动态结构模型正常的重新评价过程。
27. 为什么这些模块必须放在一起?
虽然指标中包含多个计算部分,但它们并不是几个无关指标简单拼接。
每一个部分都负责解决同一个支撑压力问题中的不同阶段。
Pivot :找出可能的历史结构观察点。
价格聚类 :把相近观察点合并成真正的价格区域。
结构排序 :判断哪些区域具有更多历史证据。
智能搜索 :判断为了找到有效结构到底需要看多远。
历史反应 :判断价格过去触碰以后是否真的产生明显反应。
强度评分 :评价最终选中结构过去的整体质量。
ATR区域 :把一个中心价格转化为更加符合实际市场的撑压带。
状态机 :处理结构突破以后,到底是真突破、失败突破还是完成撑压转换。
因此:
这是一条连续的结构计算链,而不是把多个独立指标组合到同一个脚本中。
28. 这套实现有什么特点?
主要设计特点包括:
不会把所有 Pivot 独立画线,而是先进行价格聚类。
支撑和压力可以使用完全不同的智能搜索距离。
是否扩大搜索范围由结构质量决定,而不是只有距离。
高波动环境会提高附近小结构的有效要求。
“选哪条线”和“这条线有多强”是两个独立计算阶段。
反复穿越会降低结构评分,而不是因为出现次数多就自动变强。
支撑压力使用区域表达,而不是绝对精确价格。
突破使用之前已经存在的结构,而不是突破以后重新计算出的新位置。
撑压转换必须经过回踩/反抽状态确认。
主图只重点展示当前结构,不保留大量历史突破标签干扰图表。
29. 使用限制
任何支撑压力算法都无法提前确定某个位置未来一定守住或者一定突破。
需要注意:
Pivot 确认天然存在延迟。
随着市场产生新数据,当前支撑压力可能发生变化。
历史上反应明显,不代表未来一定继续反应。
强度分数不是未来成功概率。
刚上市或者历史数据很少的标的可能缺少足够结构样本。
趋势发生巨大变化以后,过去有效的结构可能迅速失效。
成交量相关评价依赖该标的成交量数据本身的有效性。
不同周期得到的撑压位置可以完全不同。
非标准K线可能使用经过转换的 OHLC,因此计算结果可能与真实成交价格图存在差异。
30. 最后
支撑和压力应该被理解为市场可能发生博弈的区域,而不是保证发生反转的价格。
这个指标的核心目标,是把复杂的历史市场结构整理成少量、当前更值得观察的位置。
它是市场结构分析框架,而不是自动交易系统。
本指标仅用于市场结构研究与辅助分析,不构成投资建议、收益承诺或任何形式的买卖推荐。 Indicator

[SkuldX] Market Structure BOS & CHoCHSkuldX Market Structure — BOS & CHoCH
by SkuldX Trading Systems
What is it?
SkuldX Market Structure automatically maps the structural flow of price action by detecting Break of Structure and Change of Character events in real time. Instead of manually identifying swing highs and lows and drawing trend lines, the indicator does it for you — classifying every significant price move as either a trend continuation or a reversal signal, and labeling the market's structural state at every step.
Core concepts
Market structure is the sequence of swing highs and swing lows that defines whether price is trending up, trending down, or transitioning between the two. Reading structure correctly is the foundation of ICT, Smart Money, and most institutional trading methodologies.
HH / HL / LH / LL — the four structural labels that appear at every confirmed swing point:
HH Higher High — price makes a new high above the previous swing high. Bullish continuation.
HL Higher Low — price makes a higher low before pushing up again. Confirms bullish structure.
LH Lower High — price fails to reach the previous high. First sign of bearish pressure.
LL Lower Low — price breaks below the previous swing low. Bearish continuation.
BOS — Break of Structure
A BOS confirms that the existing trend is continuing. It fires when price breaks through the most recent swing extreme in the direction of the current trend.
BOS ▲ — price closes above the last swing high in an already bullish market. Institutions are adding to longs. The trend is intact and likely to continue.
BOS ▼ — price closes below the last swing low in an already bearish market. Sellers remain in control. The trend is intact.
BOS signals are ideal for trend-following entries — entering after a confirmed pullback when the BOS confirms trend resumption.
CHoCH — Change of Character
A CHoCH signals a potential trend reversal. It fires when price breaks through the swing extreme in the opposite direction of the current trend — the first structural evidence that the dominant side is losing control.
CHoCH ▲ — price breaks above a swing high while the market was in a bearish structure. Buyers have stepped in with enough force to break the bearish sequence. A new bullish trend may be beginning.
CHoCH ▼ — price breaks below a swing low while the market was in a bullish structure. Sellers have overwhelmed the existing uptrend. A new bearish trend may be starting.
CHoCH is not a guarantee of reversal — it is the first structural signal that conditions are changing. It becomes high probability when combined with additional confluence such as a key S&R level, an SFP, or an OI signal.
Two detection modes
Close mode — signals fire as soon as price closes beyond the structural level. Faster, more responsive, better for intraday trading on 15m and lower. May produce slightly more signals.
Pivot mode — signals fire only when a confirmed pivot point (N bars on each side) breaks the previous pivot extreme. Slower but structurally cleaner. Better for higher timeframes where false breaks are filtered naturally by requiring full confirmation.
Both modes can be used simultaneously on different chart instances for a multi-perspective view.
What you see on the chart
HH / HL / LH / LL labels — appear at every confirmed pivot point showing whether each swing is making higher or lower extremes. Reading the sequence of these labels from left to right tells the full structural story of price action.
BOS / CHoCH labels — appear at the bar where the structural break occurs. Color-coded by direction and type — green for bullish BOS, red for bearish BOS, aqua for bullish CHoCH, orange for bearish CHoCH.
Dashed line — extends from the broken structural level to the right, marking the exact price that was breached. This level often acts as support or resistance on subsequent retests.
Zone box — shaded area between the broken level and the current close. Shows the range of the structural break — wider boxes indicate more decisive moves, tighter boxes indicate marginal breaks that deserve extra scrutiny.
Structure background — a very subtle background tint showing the current structural state across the chart. Green tint for bullish structure, red tint for bearish. Immediately visible even when zoomed out.
Settings reference
Pivot Lookback — how many bars on each side a swing point must be the extreme to qualify as a pivot. Default 5. Lower values find more frequent swings, higher values require more significant structure. On 15m charts, 5 bars covers approximately 1.25 hours.
Detection Mode — Close for faster signals, Pivot for confirmed structure only
Show BOS — toggle Break of Structure signals
Bullish / Bearish BOS Color — independent color control
Show CHoCH — toggle Change of Character signals
Bullish / Bearish CHoCH Color — independent color control
Show Zone Box — toggle the shaded zone between level and close
Show Labels — toggle BOS/CHoCH text labels
Show HH/HL/LH/LL — toggle structural pivot labels
Show Structure Background — toggle the subtle trend tint
Box Transparency — opacity of the zone fill
Line Width — thickness of the broken level line
Label Size — tiny, small, or normal
Zone Extend — how many bars right the zone and line extend
How to use it in practice
Reading the sequence — scan the HH/HL/LH/LL labels from left to right before looking at any signals. A clear sequence of HH → HL → HH → HL tells you the market is in a clean bullish structure. Any interruption of that sequence is a warning.
BOS as entry confirmation — after a pullback in a trending market, wait for a BOS in the direction of the trend. This confirms the pullback is over and the original direction is resuming. Enter at the close of the BOS candle with a stop below the previous HL for longs.
CHoCH as reversal alert — when a CHoCH appears, switch your bias. Do not immediately enter against the trend — wait for the new structure to develop. Ideally wait for the first BOS in the new direction after the CHoCH to confirm the reversal is gaining momentum.
Combining BOS and CHoCH — the most powerful setups occur when a CHoCH is followed by a BOS in the same new direction. CHoCH establishes the reversal intent. The subsequent BOS confirms it. Enter on the BOS, stop below the CHoCH swing low for longs.
Timeframe selection — on 15m and 1h the indicator works well for intraday structure. On 4h and daily it maps the larger swing structure that defines the week's directional bias. Running both simultaneously — 4h for bias, 15m for entry — is a common and effective approach.
Part of the SkuldX Suite
SkuldX Market Structure integrates naturally with the full SkuldX indicator suite:
A bullish CHoCH that coincides with a bullish SFP at a key S&R level from SkuldX SFP + Auto S&R is one of the strongest reversal confluences available — structure is changing and institutional players have swept liquidity at the same time
A BOS that fires while price is between the VAL and POC zone confirms trend resumption from a high-value area
A bearish CHoCH during the London+NY Overlap session with Bearish Trend OI Delta from SkuldX OI Delta signals institutional repositioning with full structural and flow confirmation
The Structure Background tint aligns with the London Bias logic in SkuldX session strategies — bullish structure during London session = continuation long bias, bearish structure = short bias
Indicator

Confirmed Structure Transition Map [Pineify]Confirmed Structure Transition Map
Overview
This Pine Script v6 indicator separates confirmed swings, break-of-structure events, and direction candidates. A finite state appears as a stepped price corridor.
Problem Definition
A common baseline finds fractal highs and lows, then labels any crossing BOS or CHoCH. It hides the pivot bar, the later confirmation bar, and the still later break. One level may emit repeated labels, while one counter-break may be called a reversal. Label density replaces a distinction between swing formation, continuation, and transition. This script separates those events and never triggers an earlier break with future information.
Design Rationale
Confirmed pivots provide stable levels; a moving extreme has no fixed identity. Each high and low becomes a one-use rail. A break with the bias is BOS; the first qualified counter-break is only a potential CHoCH. Bias changes after a fresh rail breaks again in that direction. Crossing the frozen opposite rail or age limit cancels the candidate. This rejects immediate reversal on one counter-break. The tradeoff is lag for explicit evidence. ATR scaling filters tiny overruns but does not estimate probability.
Key Features
Optional confirmed HH, LH, HL, and LL labels.
One-use rails that suppress duplicate breaks.
BOS, potential CHoCH, shift, invalidation, and expiry states.
ATR displacement, state corridor, alerts, and dashboard.
How It Works
The script reads chart OHLC and a symmetric pivot window. A pivot is accepted after its right-side bars close. Its price and index are stored, compared with the prior same-type pivot, and armed as a rail. If price already exceeded the required displacement when it became knowable, that rail is consumed without a hindsight event.
Each confirmed bar compares the Close or Wick probe with both rails. Distance beyond a rail is divided by ATR and must meet Minimum Break Displacement. On a two-sided outside bar, the larger normalized wick defines one event. The first event sets bias; a same-direction event is BOS. A counter-event freezes break rail, invalidation rail, displacement, and start bar. Confirmation needs a fresh rail and second break in the candidate direction. Invalidation or expiry ends the candidate. The corridor shows bullish, bearish, pending, or neutral state; early bars stay neutral.
How Multiple Indicators Work Together
This is one dependent state model, not a mashup. Pivot confirmation supplies stable rails; otherwise levels move while tested. ATR displacement separates a tiny overrun from a range-scaled break. The ordered state machine consumes those qualified breaks; otherwise crossings remain a label stream. The corridor encodes the resulting state instead of adding an unrelated signal.
Trading Ideas and Insights
Read BOS as evidence that price cleared a rail with the established bias, not as an entry command. Violet marks a candidate; amber shows why it ended. A wide corridor requires a larger absolute move. Apply separate risk, liquidity, and execution rules: the map does not select stops, size positions, or forecast events.
Unique Aspects
The contribution is an ordered lifecycle. Rails arm only when knowable, each fires once, a counter-break stays provisional, and a second newly armed break is required before bias changes. Invalidation level and age limit freeze at candidate start, so later pivots cannot rewrite the test. One corridor carries bias and transition while labels, wash, bar colors, and table remain optional. This is more than a renamed fractal plot.
How to Use
Begin with Close and default pivots, then check swing density for the market and timeframe. Read rails first: BOS continues state, P-CH opens a candidate, and SHIFT completes the two-break transition. HH/HL locations are revealed after the right-bar delay, not known on their historical bars. Use BOS and shift alerts only within an existing process.
Customization
Pivot Left/Right Bars control granularity and delay: smaller values add noise; larger values add lag. Close requires settlement beyond a rail. Wick uses extremes and resolves outside bars by larger excursion. Minimum Break Displacement sets ATR clearance; Candidate Expiry limits age. Corridor, labels, wash, bar colors, and dashboard are independently configurable.
Assumptions and Limitations
Pivots need future bars for confirmation, so markers appear on pivot bars only after the right-side delay; breaks and shifts remain on confirmation bars. Probes move live, but state and alerts require bar close. ATR and pivot settings are market-sensitive. Gaps can jump rails, Wick mode reduces an outside bar to one event, and chop can repeat candidates. The model reads chart prices, not order flow, news, higher timeframes, or execution quality. A shift is an ordered event, not a guaranteed reversal or profitable trade.
Conclusion
The map turns delayed pivots and breaks into an auditable sequence: location, one-use break, provisional counter-break, then confirmation or invalidation. It provides structural context; interpretation and risk remain with the user.
Indicator

SMC Analytics Pro Hey traders! 👋
Finding a clean, non-lagging Smart Money Concepts (SMC) indicator on TradingView can be frustrating. Most public scripts end up squishing your chart scale , lagging your browser, or cluttering your screen with hundreds of overlapping boxes. 😩
So I decided to code a complete, ultra-precise Smart Money Concepts engine in Pine Script v5—rebuilt from the ground up to keep your charts smooth, clean, and 100% accurate! 🚀✨
The Core Idea: Institutional trading isn't about guessing where price is going—it's about tracking where bank liquidity lives. This indicator maps out market structure, institutional order blocks, and imbalance gaps without crowding your price action.
🔥 Key Features That Make This Unique
Dual Structure Architecture: Automatically plots both Internal Structure (micro scalp breaks) and Swing Structure (macro trend breaks) so you never trade against the major market trend.
Structure-Triggered Order Blocks (OB): No more clutter! OBs are drawn only when a real Break of Structure (BOS) or Change of Character (CHoCH) occurs at the origin of the impulse move.
Real-Time Mitigation Engine: When price retraces and touches an Order Block or fills a Fair Value Gap (FVG), the zone automatically vanishes in Present Mode to keep your chart tidy.
Fixed Chart Scale Guarantee: Unlike other SMC scripts that distort your vertical price scale and make candles look flat, this indicator keeps your chart scaling perfectly proportioned on every single timeframe! 📈
Fair Value Gaps (FVG): Identifies genuine 3-candle imbalance gaps where big money stepped in with aggressive market orders.
Liquidity Pools (EQH / EQL): Highlights Equal Highs and Equal Lows where retail stop losses are sitting waiting to be swept.
Dynamic Equilibrium (50%) Level: Displays the exact 50% midpoint of the active swing range so you always know if you're buying in Discount or selling in Premium .
🛠️ How to Use This in Your Trading Setup
Identify the Macro Trend: Look for solid green/red BOS lines and check if swing points are making Higher Highs (HH) or Lower Lows (LL).
Wait for Price to Enter a Zone: Look for price to retrace back down into an unmitigated Bullish Order Block or fill a Bullish FVG below the Equilibrium (50%) line.
Look for Internal Confirmation: Drop down to a lower timeframe and wait for a dashed iBOS / CHoCH break in your direction before taking the trade! 🎯
⚡ Multi-Timeframe Compatibility
Whether you are scalping the 1-minute chart on CAPITALCOM:NAS100 , day trading Forex on the 15-minute, or swing trading Crypto on the Daily, the logic adapts dynamically to any market and timeframe! 🌍
Inputs can be customized in the settings panel—feel free to tweak the pivot lookbacks to match your personal trading style.
If you find this indicator helpful for your daily analysis, please hit the Boost button 🚀 and leave a comment below! Happy trading! 🙌 Indicator

HTF Swing Highs & LowsAn open-source multi-timeframe market structure indicator that automatically identifies and projects confirmed swing highs and swing lows from the Weekly, Daily, and 4-Hour timeframes onto any lower timeframe chart.
The indicator is designed to provide clean, non-repainting support and resistance levels based on confirmed market structure rather than developing pivots.
Features
- Weekly, Daily and 4H swing highs and lows
- Non-repainting confirmed pivots
- Automatic higher timeframe detection using request.security()
- Horizontal levels extended until invalidated
- Independent visibility controls for each timeframe
- Hierarchical timeframe filtering
- Custom colours and line widths for every timeframe
- Adjustable pivot strength
- Wick, Close or Never invalidation options
- Stop or Delete broken levels
- Automatic level management to prevent exceeding TradingView object limits
How it works
The script uses confirmed pivot highs and lows from higher timeframes.
Unlike developing pivots, a swing is only confirmed after the selected number of candles has formed on both sides of the pivot. Once confirmed, a horizontal level is created at the swing price and extended to the right.
Because only confirmed pivots are used, historical levels do not repaint.
Pivot Strength
Pivot Strength controls how significant a swing must be before it becomes a level.
A strength of 3 means the pivot candle must have:
- three lower highs (or higher lows) before it
- three lower highs (or higher lows) after it
Higher values filter market noise and identify more significant market structure.
They also produce fewer levels and require longer confirmation.
Lower values detect smaller swings, produce more levels, react faster.
Level Invalidation
Choose how a level is treated once price trades through it.
Wick - Invalidates when price wicks beyond the level.
Close - Invalidates only after a candle closes beyond the level.
Never - Levels remain permanently.
Broken levels can either:
- Stop extending while remaining visible
- Be deleted completely
Hierarchical Visibility
The indicator can automatically display only relevant higher timeframe levels.
For example:
- Weekly levels appear on Weekly and all lower timeframes.
- Daily levels appear on Daily and all lower timeframes.
- 4H levels appear on 4H and lower charts.
This helps reduce clutter when analysing higher timeframe charts.
Notes
- Uses confirmed higher timeframe pivots only.
- Levels are anchored to the original swing candle.
- Designed for support and resistance, market structure, liquidity analysis, and confluence with other tools.
- Works on all symbols and asset classes supported by TradingView. Indicator

Entry-to-Exit ToolA realtime non-repainting entry-to-exit analysis tool that retains a Provisional or Finalized BUY/SELL entry reference and resolves it through an opposite signal, confirmed terminal invalidation, minimum-profit target, or entry-terminal risk/reward target. The displayed exits are analytical reference events and are not a guarantee of profitability or future performance.
Name:
Entry-to-Exit Tool
Searchable Name:
Realtime Non-Repainting Entry Exit Target and Risk Reward Tool
Technical Name:
Realtime Non-Repainting Provisional Finalized Entry Reference Opposite Signal Terminal Break Profit Target and Risk Reward Exit Resolution Tool
Short title:
Trade Exit Tool
Summary
Entry-to-Exit Tool is an exit-resolution indicator that converts internally generated Provisional or Finalized BUY/SELL signals into retained entry references and then identifies where those references would resolve under a selected exit method.
The script does not require signals from another indicator. It contains its own causal transform-path signals, structural resolver, Provisional signal ledger, and Finalized signal ledger. The user selects which internally generated signal stage establishes the entry reference and which stage can later provide an opposite-signal exit.
Each retained entry reference stores:
direction
confirmation bar
confirmation price
retained terminal price
The reference remains active until one enabled exit condition resolves it.
Available exit conditions include:
selected opposite BUY/SELL signal
confirmed close through the retained entry terminal
fixed minimum-profit target
entry-terminal risk/reward target
Opposite-signal exits, terminal exits, fixed-profit targets, and risk/reward targets remain separate exit identities. The script records the exit bar, exit price, resolved direction, and exit reason without rewriting the completed record after later chart history arrives.
This is not a complete strategy or automated trade-management engine. It does not submit orders, calculate position quantities, reverse broker positions, calculate complete strategy profitability, manage a portfolio, or route executable instructions. Its purpose is to show structured entry-to-exit reference behavior from the script’s own causal signal records.
How it works
The script first produces two internally retained signal stages:
Provisional
Finalized
The selected Entry Reference Stage determines which signal stage opens a retained entry reference.
The selected Opposite Exit Signal Stage determines which signal stage can later resolve that reference through an opposite BUY or SELL confirmation.
These two stages can be selected independently.
For example, a user can choose:
Provisional entry with Provisional opposite exit
Provisional entry with Finalized opposite exit
Finalized entry with Provisional opposite exit
Finalized entry with Finalized opposite exit
The script then processes entry-reference events and opposite-exit events in chronological order.
When both event streams contain an event on the same bar, the exit-stage event is processed before the entry-stage event. This prevents the new same-bar entry event from being incorrectly treated as active before the earlier reference has had a chance to resolve.
Provisional entry references
A Provisional entry reference is established from an accepted causal transform-path-agreed BUY or SELL confirmation.
Provisional confirmation requires the candidate direction to agree with the stored causal transform-reference direction.
A retained transform candidate can confirm:
on its candidate bar
or on the following closed bar
The maximum signal confirmation delay is limited to zero or one bar.
When Active Path-Filtered Candidate Memory is enabled, a valid candidate that initially fails transform-path direction agreement can remain stored. It can later confirm on the first closed bar where the retained candidate terminal agrees with the active causal transform direction.
That later passing bar becomes the actual Provisional confirmation bar and entry-reference price.
A Provisional signal is earlier than a Finalized signal, but it has not yet completed structural finalization. It can still be replaced, superseded, or fail to become the retained Finalized identity of its structural swing.
Finalized entry references
A Finalized entry reference is established from a Provisional signal that survives the selected structural resolver.
Finalized identity requires structural completion of the containing swing.
The Finalized reference uses:
the retained structural BUY or SELL identity
the Finalized confirmation bar
the Finalized confirmation price
the retained structural terminal price
Finalized references generally occur later than Provisional references, but they represent the signal identity retained after structural resolution.
Structural events classify and finalize signal identity. They do not independently create the Provisional BUY/SELL signal universe.
Entry-reference behavior
Only one entry reference can remain active at a time.
When no reference is active, the next qualifying event from the selected Entry Reference Stage establishes a new reference.
The reference retains:
long or short direction
entry confirmation bar
entry confirmation price
terminal price associated with that entry identity
The script does not continuously replace an unresolved reference with later same-side entry signals.
A new entry reference is committed only after the prior reference has resolved and the script is flat at the reference-state level.
The reference is an analytical state retained by the indicator. It is not a broker position and does not contain position size or account information.
Exit Resolution Method
The user selects one of three primary exit-resolution methods:
Opposite Signal
Entry Terminal Break
Opposite Or Terminal Break
Target exits are controlled separately and can operate alongside the selected primary exit method.
Opposite Signal
Opposite Signal resolves the active entry reference when the selected opposite signal stage confirms.
For a long reference, the selected SELL signal is the opposite event.
For a short reference, the selected BUY signal is the opposite event.
The opposite event uses the stage selected under Opposite Exit Signal Stage:
Provisional
or Finalized
The exit occurs at that opposite event’s confirmation price.
An opposite signal that does not oppose the currently active direction does not resolve the reference.
Require Profit For Opposite Exit
Require Profit For Opposite Exit applies only to opposite-signal exits.
When disabled, every qualifying opposite signal can resolve the active reference.
When enabled, the opposite signal resolves the reference only when the raw-price return from the retained entry price to the opposite confirmation price is at least the selected Minimum Profit For Opposite Exit percentage.
For a long reference, profit requires the opposite exit price to be sufficiently above the entry price.
For a short reference, profit requires the opposite exit price to be sufficiently below the entry price.
This setting does not delay or block:
Entry Terminal Break
Minimum Profit Target
Risk/Reward Target
An unprofitable opposite signal can therefore be ignored while another enabled exit condition remains active.
Minimum Profit For Opposite Exit is a gate on an opposite signal. It is not the same as the independent Minimum Profit Target exit.
Entry Terminal Break
Entry Terminal Break resolves the active reference when a confirmed close invalidates the retained entry terminal.
For a long reference:
a confirmed close below the retained terminal resolves the reference
For a short reference:
a confirmed close above the retained terminal resolves the reference
The terminal is taken from the same signal identity that established the entry reference.
The terminal is not replaced by every later support, resistance, pivot, or same-side signal.
Terminal exits use confirmed closes only.
An intrabar move through the terminal that does not remain broken at the confirmed close does not create a terminal exit under this script.
Opposite Or Terminal Break
Opposite Or Terminal Break enables both primary exit conditions.
The reference resolves on whichever valid event occurs first:
a qualifying opposite signal
or a confirmed terminal invalidation
When Require Profit For Opposite Exit is enabled, an opposite signal that does not meet the profit requirement is not treated as a valid exit. The terminal condition remains active and can still resolve the reference.
Target Exit
Target Exit is independent from the selected primary Exit Resolution Method.
Available target modes are:
Off
Minimum Profit %
Risk/Reward
When Target Exit is Off, no target price is calculated and no target exit can resolve the reference.
The status table displays:
OFF when the target mode is disabled
n/a when no entry reference is active
unavailable when a Risk/Reward target cannot be formed
the calculated target price when a valid active target exists
Minimum Profit Target
Minimum Profit % creates a fixed target from the retained entry-reference price.
For a long reference:
Target Price = Entry Price × (1 + Minimum Profit Target %)
For a short reference:
Target Price = Entry Price × (1 − Minimum Profit Target %)
The reference resolves when a confirmed close reaches or passes the calculated target.
For a long reference:
the confirmed close must be at or above the target
For a short reference:
the confirmed close must be at or below the target
The exit label is recorded as:
PROFIT TARGET
This target operates independently from Require Profit For Opposite Exit.
The two settings serve different purposes:
Minimum Profit For Opposite Exit controls whether an opposite signal is allowed to exit
Minimum Profit Target creates an independent price level that can exit without an opposite signal
Risk/Reward Target
Risk/Reward creates a target from the distance between the retained entry price and the retained entry terminal.
For a long reference:
Risk Distance = Entry Price − Retained Terminal
Target Price = Entry Price + Risk Distance × Risk/Reward Multiple
For a short reference:
Risk Distance = Retained Terminal − Entry Price
Target Price = Entry Price − Risk Distance × Risk/Reward Multiple
The target is valid only when the retained terminal is on the correct defensive side of the entry price and the resulting risk distance is positive.
For a long reference, the terminal must be below the entry price.
For a short reference, the terminal must be above the entry price.
When the terminal does not produce a positive risk distance, the Risk/Reward target is unavailable. The script does not invent a target by using an absolute distance or moving the terminal to the other side of the entry.
The reference resolves when a confirmed close reaches or passes the valid calculated target.
The exit label is recorded as:
RISK/REWARD TARGET
Confirmed-close target behavior
Both target modes use confirmed closes.
The script does not assume execution at the exact target price when price crosses the target intrabar.
The recorded exit price is the confirmed close of the bar that first satisfies the target condition.
This makes target resolution consistent with the script’s confirmed-close terminal-break behavior.
When a terminal break and target hit are both visible during the same scanned bar, terminal invalidation is given resolution priority in the code and the event is recorded as:
TERMINAL EXIT
Exit identities
The script preserves four separate exit identities:
OPPOSITE EXIT
TERMINAL EXIT
PROFIT TARGET
RISK/REWARD TARGET
These identities are not merged into one generic EXIT label.
This allows the user to distinguish whether the reference resolved because:
an opposite signal confirmed
the retained terminal failed
a fixed percentage target was reached
or the selected risk/reward target was reached
Completed exit records retain:
resolved direction
exit bar
exit price
exit reason
Later chart history does not move the completed exit to a different bar or change its recorded reason.
Signal construction
The internal signal engine uses a causal transform-reference path built from loaded raw-price records.
The transform path is used as a mandatory direction-agreement source for Provisional BUY and SELL confirmation.
The script separately maintains:
raw price arrays
transform path arrays
close, high, and low replay arrays
Provisional signal ledgers
Finalized signal ledgers
structural event ledgers
The transform path and structural resolver remain separate systems.
The transform path confirms Provisional signal direction.
The structural resolver determines which Provisional identity survives into the Finalized ledger.
A structural event does not directly create an entry reference unless Finalized is selected as the Entry Reference Stage and the corresponding Finalized signal record exists.
Transform Path Capturable Segment
Transform Path Capturable Segment percentage controls the captured movement required by the internal transform-reference path.
It is used to retain broader directional legs and reject smaller path pivots.
The setting affects transform-path construction and therefore can affect which candidates pass mandatory path agreement.
It is not an exit target and does not define minimum trade profit.
Structural resolution
The script includes three structural resolver options:
Earliest Terminal
Original Grouping
Conditional Accelerated
Original Grouping is the default.
Earliest Terminal
Earliest Terminal follows the known-prefix earliest terminal chain.
It is intended to retain the earliest causally provable structural terminal under the solver’s rules.
Original Grouping
Original Grouping retains same-side structural candidates as a group.
A later same-side candidate can replace the retained group extreme before an opposite structural candidate resolves the group.
The retained extreme becomes the finalized structural identity when the opposite side completes the structural transition.
Conditional Accelerated
Conditional Accelerated uses captured-path potential after structural proof.
The Structural Capturable Segment percentage applies only to this resolver.
It does not directly filter transform BUY/SELL events or calculate exit targets.
Structural records are prefix-stable and are committed permanently after confirmation.
Structural path and signal context
The script can display:
structural change labels
structural resolution path
Finalized transform BUY/SELL labels
Provisional Candidate signals
failed or superseded Provisional signals
path-disagreed Candidate labels
current live Candidate
live transform-reference path
confirmed support and resistance
These context displays do not change the selected entry-reference stage or exit-resolution method.
Turning a display off hides the object but does not remove its underlying retained ledger.
Entry and exit displays
Entry Reference Markers
Optional Entry Reference Markers show where the selected Provisional or Finalized entry reference was established.
These markers are display-only and do not represent submitted orders.
Resolved Exit Labels
Resolved Exit Labels show completed exit events.
Each label includes the exit identity determined by the resolution condition.
The script limits retained exit labels through the Maximum Exit Labels input.
Older labels are deleted from the chart when the display limit is exceeded. Their removal from the chart does not alter the chronological exit reconstruction used to determine the current active reference.
Active entry level
When Show Active Entry / Terminal Levels is enabled, the active entry confirmation price is displayed as a blue dotted line.
The line starts from the retained entry-reference bar and extends to the right while the reference remains active.
Active terminal level
When terminal-based resolution is enabled, the retained terminal is displayed as an orange dashed line.
For a long reference, this is the price below which a confirmed close produces a terminal exit.
For a short reference, this is the price above which a confirmed close produces a terminal exit.
Active target level
When a valid target mode is enabled, the target is displayed as a green dashed line.
The line appears only when:
an entry reference is active
the selected target mode is not Off
and the target calculation produces a valid price
Minimum Profit % generally produces a target whenever a valid entry price exists.
Risk/Reward requires a valid positive entry-to-terminal risk distance.
Support and resistance
Optional support and resistance levels are derived from confirmed signal terminals.
The user can:
show or hide the levels
extend the levels right
keep or remove broken levels
change line width
control the maximum number of managed chart objects
These levels provide contextual market structure.
They do not replace the retained entry terminal used by the exit-resolution module.
Replay and chronological reconstruction
The script reconstructs the entry-to-exit state from historical Provisional and Finalized signal ledgers.
The selected entry-stage ledger and selected opposite-stage ledger are merged chronologically.
The merge is linear rather than repeatedly sorting the complete combined event list.
This allows the script to preserve event order while avoiding the unnecessary quadratic event sorting that would become increasingly expensive as the number of signal records grows.
For each historical interval, the script checks:
whether the active retained terminal was invalidated
whether an enabled target was reached
whether a qualifying opposite event occurred
whether a new entry reference should be committed after the previous reference resolved
The reconstructed active state at chart end determines:
current active direction
entry price
retained terminal
target price
last exit reason
last exit bar
last exit price
Same-bar event priority
When an entry-stage event and exit-stage event occur on the same bar, the exit-stage event is processed first.
This preserves the prior active reference’s opportunity to resolve before a new reference from the same bar is committed.
It also prevents a newly created same-bar reference from being immediately interpreted as though it existed before the opposite event that appears at the same timestamp.
Performance controls
The script includes:
Statistics-Only Replay
Maximum Replay Objects
Auto Limit Live Replay
Live Replay Bars
Statistics-Only Replay reduces historical chart-object construction while retaining internal calculations.
Maximum Replay Objects limits the number of displayed historical objects.
Auto Limit Live Replay and Live Replay Bars can reduce the amount of live historical drawing on large charts.
These settings primarily control display and replay workload. They do not change the configured exit formulas.
Status pages
The status table includes separate pages for:
Exit State
Signals
Structural
Support/Resistance
Alerts
Guide
Exit State
The Exit State page displays:
selected Entry Stage
selected Opposite Stage
selected Resolution Method
active direction
entry price
retained terminal
last resolution reason
last exit bar
last exit price
selected Target Exit mode
current target price
Target-price display behavior is:
OFF when target exits are disabled
n/a when no reference is active
unavailable when a Risk/Reward target cannot be formed
the formatted target price when the target is valid
Signals
The Signals page summarizes the internal Provisional and Finalized signal state and selected signal context.
Structural
The Structural page displays selected structural resolver information and structural event context.
Support/Resistance
The Support/Resistance page displays level configuration and retained level state.
Alerts
The Alerts page shows whether resolved exit alerts are enabled and whether the current reconstruction produced a long-reference or short-reference exit event.
Guide
The Guide page explains the main output identities and chart-line colors:
retained entry reference
selected-stage opposite exit
confirmed terminal invalidation
target resolution
blue entry line
orange terminal line
green target line
Alerts
The script contains informational alerts for:
Provisional Transform BUY
Provisional Transform SELL
Finalized Transform BUY
Finalized Transform SELL
Long Reference Exit
Short Reference Exit
Provisional alerts are generated from accepted transform-path-agreed Provisional events.
Finalized alerts are generated when structural resolution commits a Finalized BUY or SELL identity.
Exit alerts identify whether a long or short entry reference resolved.
The exit alert title does not distinguish the exact reason in separate alertconditions. The exact chart label and status-table Last Resolution field identify whether the reconstructed exit was:
OPPOSITE EXIT
TERMINAL EXIT
PROFIT TARGET
RISK/REWARD TARGET
Alerts are informational.
They do not contain:
position size
broker account information
order type
stop order
limit order
routing destination
portfolio instruction
or guaranteed execution price
Important behavior note
The script should be understood as:
causal in its signal confirmation
historically stable after closed-bar confirmation
reconstructed chronologically from retained signal ledgers
live-updating only for current open-bar signal and path context
Closed-bar Provisional signals, Finalized signals, entry references, and completed exits are not moved or reclassified by later chart history.
The current open bar can update only the existing live Candidate and transform-reference context inherited from the internal signal engine.
Terminal and target exits use confirmed closes only.
The tool identifies analytical entry-to-exit reference events. It does not confirm that a real order was filled at the displayed price.
Features
Internally generated Provisional BUY/SELL signals
Internally generated Finalized BUY/SELL signals
Selectable Provisional or Finalized Entry Reference Stage
Selectable Provisional or Finalized Opposite Exit Signal Stage
Opposite Signal exit method
Entry Terminal Break exit method
Combined Opposite Or Terminal Break method
Optional profit requirement for opposite exits
Independent Minimum Profit Target
Independent Risk/Reward Target
Entry-to-terminal risk calculation
Confirmed-close target resolution
Confirmed-close terminal invalidation
Separate opposite, terminal, profit-target, and risk/reward exit identities
One retained active entry reference
Chronological entry and exit event reconstruction
Exit-first same-bar event ordering
Linear two-ledger event merge
Permanent closed-bar entry and exit records
Active entry price line
Active retained terminal line
Active target price line
Entry-reference markers
Resolved exit labels
Maximum retained exit-label control
Three selectable structural resolvers
Mandatory causal transform-path agreement
Candidate-bar or next-bar Provisional confirmation
Stored path-filtered Candidate memory
Provisional and Finalized signal ledgers
Failed and superseded Provisional context
Optional structural path
Optional live transform-reference path
Optional support and resistance
Replay and chart-object performance controls
Multiple status-table pages
Informational signal alerts
Informational long-reference and short-reference exit alerts
Strengths
Self-Contained Signal Source — generates its own Provisional and Finalized entry references without requiring another script’s external signal input.
Entry-to-Exit Structure — converts internal BUY/SELL identities into a retained reference with a clearly defined entry price, terminal, target, and exit reason.
Stage Flexibility — allows the entry stage and opposite exit stage to be selected independently.
Exit Method Flexibility — supports opposite confirmation, terminal invalidation, or whichever valid event occurs first.
Independent Target Logic — fixed-profit and risk/reward targets can resolve the reference without waiting for an opposite signal.
Opposite Profit Gate — can prevent an unprofitable opposite signal from resolving the reference while leaving terminal and target exits active.
Identity Separation — opposite, terminal, fixed-profit, and risk/reward exits remain distinguishable.
Terminal Consistency — uses the terminal retained by the same signal identity that established the entry reference.
Confirmed-Close Stability — terminal and target exits do not depend on unfinished intrabar movement.
Chronological Reconstruction — historical state is rebuilt in event order rather than inferred only from the latest signal.
Same-Bar Ordering — exit-stage processing precedes entry-stage processing when both events occur on the same bar.
Performance-Aware Merge — merges already chronological signal ledgers directly instead of repeatedly sorting a combined event array.
Long and Short Symmetry — applies entry, opposite, terminal, and target calculations to both long and short references.
Visual Clarity — separates entry price, terminal price, and target price with distinct chart lines.
Context Availability — retains optional Provisional, Finalized, structural, path, and support/resistance displays.
Weaknesses
Signal Dependence — exit quality depends on the quality and timing of the internally generated Provisional or Finalized entry reference.
No Universal Best Stage — Provisional entries are earlier but less structurally resolved; Finalized entries are more confirmed but later.
Confirmed-Close Delay — terminal and target exits can occur later than an intrabar crossing.
Close-Price Exit Recording — the recorded exit price is the confirmation-bar close, not necessarily the exact target or terminal price touched intrabar.
No Partial Exits — each retained reference resolves as one complete analytical state rather than splitting into multiple exit quantities.
No Trailing Target — the fixed-profit and risk/reward targets do not trail favorable movement.
Static Entry Terminal — the retained terminal belongs to the entry identity and is not dynamically replaced with every later structural level.
Risk/Reward Availability — a risk/reward target cannot be formed when the retained terminal is not on the correct defensive side of the entry price.
Opposite Profit-Gate Persistence — an opposite signal that fails the profit gate is ignored rather than stored as a pending opposite exit.
No Complete Strategy Return — the tool does not calculate commissions, slippage, quantity, capital allocation, or portfolio equity.
No Broker Execution — displayed exits and alerts do not prove that a real order would fill at the same price.
One Active Reference — the script does not maintain simultaneous independent long and short references or multiple scaled entries.
Historical Reconstruction Cost — although the event merge is linear, the script still performs substantial transform, structural, replay, and chart-object work on large charts.
Parameter Sensitivity — transform capture, structural solver, entry stage, opposite stage, target percentage, and reward multiple can materially change results.
No Universal Profitability — structured exits do not guarantee that the underlying entries have sufficient predictive edge.
Who it’s for
This tool is best suited for:
TradingView users who want an exit-focused companion to transform-based entry signals
traders comparing Provisional and Finalized entry timing
users studying opposite-signal exit timing
users testing retained-terminal invalidation
users testing fixed minimum-profit targets
users testing entry-terminal risk/reward targets
reversal and market-structure traders
users who want long and short exit references
users who want historically stable closed-bar exit labels
users who want one retained entry reference at a time
users interested in causal transform-path agreement
users developing an exit framework before integrating position sizing or routing
research-oriented users comparing multiple exit identities
users who want chart-based exit analysis without a complete strategy engine
Who it’s not for
This tool is not best suited for:
users looking for guaranteed profitable exits
users expecting the script to know the best future exit in advance
users looking for automatic broker execution
users requiring position sizing or account-risk calculations
users requiring partial profit taking
users requiring multiple simultaneous entries
users requiring dynamic trailing stops
users requiring intrabar target or stop execution
users expecting target price to guarantee actual fill price
users wanting complete strategy-equity reconstruction
users wanting commissions, slippage, leverage, or margin modeling
users expecting Provisional or Finalized signals to universally identify profitable trades
users seeking a complete operational transform engine with split quantities, portfolio state, or order routing
Known limitations
The tool is better at:
retaining a consistent entry reference
showing multiple structured exit conditions
distinguishing why an exit occurred
comparing Provisional and Finalized signal stages
visualizing entry, terminal, and target prices
and reconstructing closed-bar entry-to-exit state
than it is at:
predicting which entry will succeed
guaranteeing that a selected target will be reached
guaranteeing that a terminal exit will contain loss
finding the best possible future exit
or reproducing real broker fills
A fixed-profit target can improve consistency but can also exit before a larger move develops.
A risk/reward target can align the target with entry-terminal distance, but the retained terminal may not represent the user’s actual financial risk or intended stop placement.
An opposite signal can respond to changing structure, but it can arrive late or be ignored when Require Profit For Opposite Exit is enabled and the profit requirement is not met.
A terminal exit can preserve the entry identity’s invalidation point, but confirmed-close evaluation can exit beyond the terminal after a fast move.
These are structural exit references, not guarantees of favorable trade outcomes.
Final note
Entry-to-Exit Tool is a focused indicator for converting internally generated Provisional or Finalized BUY/SELL signals into retained entry references and resolving those references through explicitly defined exit conditions.
Its main value is not that it predicts the perfect exit. Its value is that it makes the exit framework visible and consistent:
which stage opened the reference
which stage can provide the opposite exit
which terminal belongs to the entry
whether an opposite exit requires profit
whether a fixed or risk/reward target is active
which condition actually resolved the reference
and where that resolution occurred on a confirmed close
The tool should be viewed as an entry-to-exit analysis layer, not as a complete strategy, broker-execution system, or guarantee of profitability.
It provides more structured exit information than an entry-only signal script while stopping before quantities, partial positions, portfolio state, order routing, and full operational trade management. Indicator

Price Structure RSIOverview
Price Structure RSI is a market-structure oscillator that converts confirmed structural breaks into a cumulative directional series and then applies the Relative Strength Index calculation to that series.
Unlike a traditional RSI, which is calculated directly from price changes, this indicator measures how previously identified pivot highs and pivot lows are being broken.
The oscillator includes:
- market-structure-based RSI
- configurable RSI length
- configurable overbought and oversold levels
- Close or High/Low structure-break confirmation
- optional EMA, SMA, or WMA smoothing
- confirmed bullish and bearish signals
- dark and light colour presets
- gradient oscillator visualization
- simplified bullish and bearish historical W/L panels
- configurable target and stop distances
- configurable panel positions
- bullish and bearish alerts
The indicator is intended to help users examine whether recent market-structure breaks are producing stronger bullish or bearish pressure.
It does not predict future price movement and does not provide automatic instructions to enter or exit a trade.
Open-source reuse and credits
Price Structure RSI is a modified and expanded derivative of the open-source indicator "Market Structure RSI" by ClayeWeight.
The original pivot detection, stored structure levels, broken-structure accumulation, cumulative structure total, RSI transformation, moving-average selection, threshold-crossing signals, and alert framework were adapted from ClayeWeight's work.
This version adds:
- Pine Script v6 compatibility
- dark and light colour presets
- revised oscillator colours and gradient fills
- confirmed-bar signal processing
- configurable historical target and stop measurements
- next-bar outcome evaluation
- conservative same-bar target and stop handling
- separate bullish and bearish W/L panels
- configurable panel positioning and offsets
- additional input validation
- revised alert messages
The original source was published under the Mozilla Public License 2.0.
This modified version is also published open-source under the Mozilla Public License 2.0.
Core methodology
The indicator first identifies simple confirmed pivot highs and pivot lows.
A pivot high is identified when:
- the centre candle has a higher high than the candle before it
- the centre candle has a higher high than the candle after it
A pivot low is identified when:
- the centre candle has a lower low than the candle before it
- the centre candle has a lower low than the candle after it
Because the script evaluates historical candles, the pivot is recognized only after the necessary later candle has closed.
Confirmed pivot-high prices are stored in an array.
Confirmed pivot-low prices are stored in a separate array.
Structure breaks
The indicator checks whether stored pivot levels have been broken.
Users can select one of two Structure Break Type settings:
- Close
- High/Low
When Close is selected:
- a stored pivot high is considered broken when the previous candle closes above it
- a stored pivot low is considered broken when the previous candle closes below it
When High/Low is selected:
- a stored pivot high is considered broken when the previous candle high moves above it
- a stored pivot low is considered broken when the previous candle low moves below it
When one or more stored pivot highs are broken, positive values are added to the cumulative structure total.
When one or more stored pivot lows are broken, negative values are added to the cumulative structure total.
Broken levels are removed from their respective arrays so that the same structure level is not counted repeatedly.
Cumulative structure total
Each broken pivot high contributes:
- +1
Each broken pivot low contributes:
- -1
If several stored structure levels are broken together, several values can be added during the same calculation.
The script then calculates the cumulative sum of these positive and negative structure changes.
A rising structure total indicates that more stored pivot highs are being broken.
A falling structure total indicates that more stored pivot lows are being broken.
Structure RSI
The Relative Strength Index calculation is applied to the cumulative structure total rather than directly to price.
The default RSI Length is:
- 20
The resulting oscillator is called the Structure RSI.
Higher Structure RSI values indicate that bullish structure breaks have recently had greater influence on the cumulative series.
Lower Structure RSI values indicate that bearish structure breaks have recently had greater influence.
The Structure RSI should not be interpreted as a standard price RSI because its input is the cumulative structure-break series rather than normal closing-price changes.
Overbought and oversold levels
The default levels are:
- Overbought Level: 80
- Oversold Level: 20
The Oversold Level must remain below the Overbought Level.
The script displays an error when the oversold setting is equal to or above the overbought setting.
The levels are configurable and should be treated as analytical thresholds rather than universally optimal settings.
Bullish signal
A bullish signal occurs when the Structure RSI crosses upward through the selected Oversold Level.
The signal is confirmed only after the chart candle closes.
The bullish marker appears at the bottom of the oscillator pane.
A bullish signal indicates that the structure-based oscillator has recovered above its lower threshold.
It does not guarantee that price will continue higher.
Bearish signal
A bearish signal occurs when the Structure RSI crosses downward through the selected Overbought Level.
The signal is confirmed only after the chart candle closes.
The bearish marker appears at the top of the oscillator pane.
A bearish signal indicates that the structure-based oscillator has moved back below its upper threshold.
It does not guarantee that price will continue lower.
Moving average
An optional moving average can be applied to the Structure RSI.
Available moving-average types are:
- EMA
- SMA
- WMA
The default settings are:
- Moving Average Type: EMA
- Moving Average Length: 8
The moving average can be used to observe the smoother direction of the Structure RSI.
The moving average does not directly create the bullish or bearish threshold signals.
Hiding the moving average does not change the Structure RSI calculation.
Oscillator colours
The Structure RSI line changes colour according to its current position.
- Above the Overbought Level: bearish colour
- Below the Oversold Level: bullish colour
- Between the two levels: neutral grey
The oscillator also includes:
- a dashed overbought line
- a dashed oversold line
- a dotted 50 midline
- a neutral background fill between the main levels
- bullish and bearish gradient fills
- optional dark and light colour presets
The colour settings change presentation only.
They do not alter the structure calculation or signal logic.
Confirmed signals
Bullish and bearish signals are accepted only on confirmed chart bars.
The script does not finalize a signal solely because the Structure RSI temporarily crosses a threshold while the active candle is still open.
Values may still move while the current chart candle develops.
The final marker and alert are generated only after the candle closes with the crossing condition confirmed.
Historical W/L measurements
The indicator includes simplified historical bullish and bearish outcome measurements.
These measurements are not a complete TradingView strategy backtest.
When no measurement is currently active, a confirmed signal can begin a new historical measurement.
For a bullish signal:
- the signal candle close becomes the recorded entry price
- the target is placed above the recorded entry
- the stop is placed below the recorded entry
For a bearish signal:
- the signal candle close becomes the recorded entry price
- the target is placed below the recorded entry
- the stop is placed above the recorded entry
Only one unresolved historical measurement is tracked at a time.
Target distance
Target Distance (%) controls the percentage distance between the recorded signal close and the historical target.
The default value is:
- 1.0%
For a bullish measurement:
- Target = Entry Price × (1 + Target Percentage)
For a bearish measurement:
- Target = Entry Price × (1 - Target Percentage)
The minimum allowed target distance is 0.1%.
Stop distance
Stop Distance (%) controls the percentage distance between the recorded signal close and the historical stop.
The default value is:
- 1.0%
For a bullish measurement:
- Stop = Entry Price × (1 - Stop Percentage)
For a bearish measurement:
- Stop = Entry Price × (1 + Stop Percentage)
The minimum allowed stop distance is 0.1%.
Next-bar evaluation
Target and stop evaluation begins on the bar after the signal.
The signal candle itself is not used to determine the result.
This prevents price movement that occurred earlier during the signal candle from being counted after the entry has been recorded at that candle's close.
Wins and losses
The tables use the following labels:
- W = Win
- L = Loss
A win means that the configured target was reached before the configured stop.
A loss means that the configured stop was reached before the configured target.
The displayed percentage is:
- Wins divided by completed Wins and Losses
Bullish and bearish measurements are counted separately.
Same-bar target and stop handling
A chart candle can sometimes touch both the target and stop.
Standard OHLC chart data does not reveal which level was reached first inside that candle.
When both levels are touched during the same bar, the script records a loss.
This conservative rule avoids automatically assuming the more favourable outcome.
The script does not reconstruct lower-timeframe intrabar movement.
One active measurement at a time
Only one unresolved historical measurement can be active.
When a measurement is already active:
- later bullish or bearish signals can still appear
- later signals can still trigger alerts
- later signals do not start another W/L measurement
- the active measurement remains open until its target or stop is reached
An opposite signal does not automatically close the existing measurement.
This means that not every displayed signal is included in the W/L panels.
Bull panel
The Bull panel displays results from completed bullish measurements.
The panel contains:
- Bull
- W: number of bullish targets reached first
- L: number of bullish stops reached first
- percentage of completed bullish measurements recorded as wins
The Bull panel position can be selected from the available chart locations.
Bear panel
The Bear panel displays results from completed bearish measurements.
The panel contains:
- Bear
- W: number of bearish targets reached first
- L: number of bearish stops reached first
- percentage of completed bearish measurements recorded as wins
The Bear panel position can be selected independently from the Bull panel.
Panel positions and offsets
The Bull and Bear panels can be placed at:
- top left
- top centre
- top right
- middle left
- middle centre
- middle right
- bottom left
- bottom centre
- bottom right
Row and column offsets can be used to move each panel within the available position grid.
Negative row values move the selected panel upward.
Positive row values move it downward.
Negative column values move it to the left.
Positive column values move it to the right.
The final position is restricted to the available TradingView table locations.
The panels can overlap when both are assigned to the same effective position.
Meaning of the displayed percentage
The percentage represents the share of completed measurements where the configured target was reached before the configured stop.
It is not:
- a guaranteed win rate
- proof of future profitability
- a complete strategy result
- a recommendation to enter a trade
- a forecast of future performance
The historical measurement does not include:
- commissions
- spread
- slippage
- liquidity
- order execution
- position sizing
- account equity
- partial exits
- trailing stops
- market gaps
- order rejection
- overlapping positions
- complete intrabar sequencing
Historical results do not guarantee future results.
Alerts
The indicator includes two alert conditions:
- Bullish Signal
- Bearish Signal
The Bullish Signal alert is triggered when the Structure RSI crosses upward through the Oversold Level on a confirmed chart bar.
The Bearish Signal alert is triggered when the Structure RSI crosses downward through the Overbought Level on a confirmed chart bar.
When creating TradingView alerts, use:
- Once Per Bar Close
This matches the confirmed signal logic.
How to Use
1. Apply the indicator
Add Price Structure RSI to a standard TradingView chart.
The oscillator appears in a separate pane below the main price chart.
2. Begin with the default settings
The default configuration is:
- RSI Length: 20
- Overbought Level: 80
- Oversold Level: 20
- Structure Break Type: High/Low
- Moving Average Type: EMA
- Moving Average Length: 8
- Target Distance: 1.0%
- Stop Distance: 1.0%
Review the indicator with its default configuration before changing several settings simultaneously.
3. Select the structure-break type
Choose High/Low when a stored structure level should be considered broken as soon as the previous candle's high or low passes it.
Choose Close when the previous candle must close beyond the stored structure level.
High/Low is generally more responsive.
Close is generally more restrictive.
Neither setting is automatically more accurate.
4. Read the Structure RSI
Use the oscillator to observe the balance of recent broken pivot highs and pivot lows.
A rising oscillator indicates that bullish structure breaks are having greater recent influence.
A falling oscillator indicates that bearish structure breaks are having greater recent influence.
The oscillator can remain elevated or depressed during extended directional conditions.
5. Read the overbought area
When the Structure RSI moves above the Overbought Level, bullish structure-break pressure has pushed the oscillator into its upper region.
The bearish signal does not occur merely because the oscillator is above the level.
The bearish signal occurs only when the oscillator later crosses downward through the Overbought Level on a confirmed bar.
6. Read the oversold area
When the Structure RSI moves below the Oversold Level, bearish structure-break pressure has pushed the oscillator into its lower region.
The bullish signal does not occur merely because the oscillator is below the level.
The bullish signal occurs only when the oscillator later crosses upward through the Oversold Level on a confirmed bar.
7. Wait for the candle to close
Signals are confirmed at bar close.
Do not treat a temporary intrabar threshold crossing as a finalized signal.
Wait for the marker to remain after the chart candle closes.
8. Use the moving average
Enable the moving average to observe a smoother version of the Structure RSI.
Available types are:
- EMA
- SMA
- WMA
A shorter moving-average length reacts more quickly.
A longer moving-average length responds more slowly.
The moving average can provide visual context, but it is not part of the threshold-crossing signal condition.
9. Configure the target and stop distances
Set Target Distance (%) and Stop Distance (%) according to the historical measurement you want to study.
For example:
- Target: 1.0%
- Stop: 1.0%
This creates an equal-distance historical measurement.
Another example:
- Target: 2.0%
- Stop: 1.0%
This creates a larger target than stop.
These settings are research parameters and are not recommended trading settings.
10. Read the Bull panel
The Bull panel measures completed bullish signals.
- W means the bullish target was reached first
- L means the bullish stop was reached first
- the percentage shows bullish wins divided by completed bullish outcomes
Only signals that begin while no other measurement is active are included.
11. Read the Bear panel
The Bear panel measures completed bearish signals.
- W means the bearish target was reached first
- L means the bearish stop was reached first
- the percentage shows bearish wins divided by completed bearish outcomes
Only signals that begin while no other measurement is active are included.
12. Understand same-bar outcomes
When both the target and stop are touched during the same candle, the result is counted as a loss.
This is a conservative assumption because the chart's OHLC data cannot show which level was reached first.
13. Understand skipped measurements
A signal can appear while another historical measurement is still unresolved.
That signal can still:
- display a marker
- trigger an alert
However, it does not begin another historical measurement.
This is why the total W/L count may be lower than the total number of visible signals.
14. Position the panels
Choose separate positions for the Bull and Bear panels.
The default positions are:
- Bull panel: top left
- Bear panel: top right
Use the row and column offsets when small position adjustments are needed.
Avoid assigning both panels to the same final position unless overlapping panels are intended.
15. Select the colour preset
Use Dark Background on dark chart themes.
Use Light Background on light chart themes.
The preset changes moving-average and panel text colours.
It does not change the indicator calculations.
16. Create alerts
Create separate TradingView alerts for:
- Bullish Signal
- Bearish Signal
Use Once Per Bar Close.
Test alerts on the intended symbol and timeframe before using them operationally.
17. Review broader market context
Use Price Structure RSI together with additional analysis such as:
- trend direction
- price structure
- support and resistance
- volume
- volatility
- liquidity
- market sessions
- recent swing highs and lows
- scheduled economic or company events
- risk management
A threshold crossing alone does not guarantee a reversal or continuation.
Suggested starting process
- Apply the indicator to a standard candlestick chart
- Keep RSI Length at 20
- Keep the levels at 80 and 20
- Begin with High/Low structure breaks
- Keep the EMA smoothing line enabled
- Use a target and stop distance of 1.0%
- Wait for confirmed bar-close signals
- Compare the oscillator with visible price structure
- Review the Bull and Bear panels separately
- Remember that only one active measurement is tracked
- Test several symbols and timeframes before drawing conclusions
- Use Once Per Bar Close for alerts
Limitations
- The indicator is derived from the open-source Market Structure RSI by ClayeWeight
- The central structure-break accumulation methodology is adapted from the original work
- Pivot identification is based on a simple three-candle relationship
- Pivots are identified only after the required later candle has closed
- The oscillator measures broken stored structure levels rather than normal price momentum
- The Structure RSI can behave differently from a standard price RSI
- The indicator does not determine whether a structure break is genuine or false
- The indicator does not measure volume, volatility, liquidity, or trend strength
- Signals are confirmed at bar close and may occur later than temporary intrabar conditions
- A bullish signal does not guarantee that price will rise
- A bearish signal does not guarantee that price will fall
- Only one unresolved historical measurement is tracked at a time
- Not every visible signal is represented in the W/L panels
- Opposite signals do not close active measurements
- Target and stop evaluation begins on the bar after the signal
- Same-bar target and stop contact is recorded as a loss
- The W/L panels are simplified historical measurements
- The displayed percentages are not complete backtest results
- Commissions, spread, slippage, liquidity, position sizing, and execution are not included
- Historical outcomes do not imply future results
- The indicator should not be used as the sole basis for a trading decision
Price Structure RSI is an analytical and research tool.
It does not provide financial advice, guaranteed signals, guaranteed win rates, or guaranteed results. Indicator

Market Compass - Dynamic Range FrameworkHello English readers, the English version is provided below. Please scroll down to view it.
Market Compass - Dynamic Range Framework
市场指南针 · 动态区间框架
版本:1.0 | 类型:非预测性价格结构定位工具 | 作者:
绝大多数交易亏损,根源并非方向判断错误,而是 “位置感”的缺失 。本指标旨在为您解决这一核心痛点——它不告诉您涨跌,但它告诉您 “此时此刻,价格在地图上的精确坐标” 。
---
本指标并非传统的均线或动量振荡器,而是一个 基于固定回溯周期的价格百分位区间定位系统 。它以最近 N 根 K 线(默认 252 根,对应约 1 个交易年度)的最高价与最低价为天然边界,构建出一个覆盖 0% 至 100% 的 动态箱体网格 。
该网格并非平均分割,而是采用 非对称的黄金分割与极值锚定法 ,精确定制了 9 条关键水平轨道。这些轨道以彩色矩形色带和右侧实时浮动标签的形式,干净利落地叠加于主图 K 线之上:
100% 顶部极值轨 (红色):回溯周期内的绝对天花板。
89% 超买警戒轨 (橙色):情绪极度亢奋区,多头衰竭高发带。
75% 强势分界轨 (黄色):牛熊分水岭,站上此线意味中期趋势转强。
62.5% 强界枢轴轨 (紫色):多头趋势中的次级回踩支撑位。
50% 多空中轴轨 (白色):价值均衡线,长线资金的成本密集区。
37.5% 弱界枢轴轨 (青色):空头趋势中的次级反弹阻力位。
25% 弱势分界轨 (亮蓝):跌破此线意味中期趋势正式转入空头。
11% 超卖警戒轨 (浅绿):情绪极度恐慌区,空头衰竭高发带。
0% 底部极值轨 (深蓝):回溯周期内的绝对地板。
随着新 K 线的生成,整个框架会 滚动迭代 ,始终锚定最新的价格活动范围,确保参考坐标永不失效。
---
传统价格图表存在严重的 视角局限性 ,导致交易者频繁陷入误判:
“绝对值幻觉”与锚定效应 :股价 100 元是高是低?脱离近期波动区间谈绝对价格毫无意义。本指标将价格转化为 0~100 的相对百分位数 ,消除了价格基数的干扰,让您客观评判当前价格是“相对高位”还是“相对低位”。
“区间失忆症”与近因偏好 :人类大脑天然对最近 5~10 根 K 线赋予过高权重,极易遗忘前期关键的支撑与阻力结构。本指标通过固定窗口的滚动计算,强制将 过去 N 根 K 线的价格极值 醒目地绘制在当前图表上,纠正了这种认知偏差。
均值回归与极端磁吸理论 :金融市场价格长期遵循 “极端值向中轴(50% 均衡线)回归” 的统计规律。当价格进入 89% 以上或 11% 以下的极端尾部区域时,统计概率上必然面临向 50% 中轴的牵引力。本框架为这种“牵引力”提供了精确的量化刻度。
---
本指标是 趋势过滤、盈亏比评估与动态止盈止损 的绝佳辅助工具。请勿将其视为独立入场信号,而应作为 “价格行为决策的量化底座” 。
3.1 基于市场环境的三种经典战法
【趋势跟踪战法】—— 适用于强势单边行情
当价格经过充分调整后,以放量大阳线有效突破 75% 强势分界轨 时,视为中期趋势由震荡转强的关键确认点。若后续价格回踩 75% 轨并获得支撑(收出长下影线),则为绝佳的 顺大势、逆小势 加仓机会。此时可将止损设于 62.5% 强界枢轴轨下方。
【均值回归战法】—— 适用于宽幅震荡行情
当价格快速冲高至 89% 超买轨 上方,且 K 线出现明显滞涨形态(如射击之星、看跌吞没)时,可视为短线高空机会,第一目标位看向 75% 轨,第二目标位看向 50% 中轴。反之,价格急跌至 11% 超卖轨 下方并出现止跌反转形态时,可视为短线低吸机会。
【突破回踩确认战法】—— 适用于关键阻力支撑转换
任何一条百分比轨道都具备动态支撑/阻力的属性。当价格自下而上突破某一轨道(如 62.5% 轨)后,若随后缩量回踩该轨道且未跌破,则说明该轨道已由阻力转换为支撑,此处是风险收益比极高的 “0 级入场点” (止损极小,空间极大)。
3.2 动态止盈与止损设置指南
波段多头持仓 :可将 37.5% 弱界枢轴轨 设为最终的硬性离场线。只要价格在此轨之上,多头头寸便可安心持有,避免被早期震荡洗出。
短线空头持仓 :可将 62.5% 强界枢轴轨 设为硬性止损线。一旦价格强势反抽并站上此轨,则空头逻辑被证伪,需果断离场。
3.3 参数动态调整建议(针对不同交易周期)
日线级别(中长线 / 波段) :建议保持默认 252 (约 1 年交易日),用于捕捉年度大箱体的牛熊转换。
周线级别(大趋势 / 仓位布局) :建议调整为 52 (约 1 年周线),用于识别超大周期的价格百分位极值。
小时 / 分钟级别(日内短线 / 剥头皮) :建议调整为 50 ~ 100 ,过长的周期在分钟图上会导致框架钝化,失去短线参考意义。
---
4.1 最佳适用场景
流动性充裕的权益市场 :沪深 300、中证 500、标普 500 等主流指数及成分股。
高流动性大宗商品与外汇 :黄金、原油、欧元/美元等主要交易对。
高市值加密货币 :比特币(BTC)、以太坊(ETH)等。
4.2 禁用与慎用场景(风控红线)
严禁用于上市不足 N 根 K 线的新股/次新股 :尽管代码内置了自适应缩窄逻辑,但新股价格极不稳定,高低点极易被操纵,百分位框架参考价值极低。
慎用于连续无量涨跌停的极端行情 :在极强的单边轧空或流动性枯竭的踩踏中,价格可能长期粘合在 100% 轨之上或 0% 轨之下,此时指标出现 “钝化” 现象,需立即切换至趋势跟踪指标(如 SAR 抛物线或均线系统)进行二次印证。
慎用于高度控盘的“庄股”或低成交量仙股 :稀疏的成交导致价格跳跃性极大,计算出的区间极易失真。
---
本指标严格遵循 TradingView 最佳实践, 完全不包含未来函数 ,所有信号均基于确定性的历史数据实时滚动计算。
5.1 自适应周期核心算法
系统优先读取用户设定的 `lookbackLength`(默认 252)。然而,当图表加载的品种上市天数不足时,引擎会自动触发保护机制:
effectiveLookback = math.min(i_lookbackLength, bar_index + 1)
该行代码确保指标在上市首日即能工作,且随着新 K 线增加,窗口期自然增长,直至达到用户设定的标准周期。
5.2 九宫格线性映射(百分位分割数学)
首先确定箱体极值与范围:
periodLow = ta.lowest(low, effectiveLookback) // 底部 0%
periodHigh = ta.highest(high, effectiveLookback) // 顶部 100%
priceRange = periodHigh - periodLow
随后基于 斐波那契数列与统计学标准差启发式阈值 进行非均匀切割:
priceL89 = periodLow + priceRange * 0.89 // 极值警戒
priceL75 = periodLow + priceRange * 0.75 // 强市分界
priceL625 = periodLow + priceRange * 0.625 // 黄金分割枢轴
priceL50 = periodLow + priceRange * 0.50 // 均衡中轴
// ... 下方对称切割同理
注:62.5% 与 37.5% 的选取来源于对 0.618 黄金分割率的整数微调,旨在提供比传统 61.8% 更为清晰且易于记忆的刻度。
5.3 图形渲染引擎优化(内存与性能管理)
为了避免在大量历史 K 线上重复绘制矩形和线条导致图表卡顿,引擎采用 “惰性删除与单次实例化” 策略:
if barstate.islast
// 仅当加载完成且运行至图表最右侧时触发绘制
box.delete(boxMain) // 先销毁旧句柄
line.delete(lineL100) // 清理旧线
// ... 重新创建新对象
所有标签采用 label.style_label_left 右对齐样式,确保在图表最右侧整齐排列,绝不遮挡最新的 K 线实体,同时提供精确至交易所最小报价单位(`format.mintick`)的实时读数。
---
它不是占卜未来的水晶球,而是衡量当下的卡尺。
在充满不确定性的金融市场中, “位置感” 是纪律执行的基石。`Market Compass` 为您提供的不是圣杯,而是一张永远保持更新的 战场态势感知地图 。请将它融入您现有的交易系统中,作为过滤低质量交易机会的第一道关卡。
---
本指标及此说明文件仅供教育及技术分析参考之用,绝不构成任何形式的买入、卖出或持仓建议。金融衍生品及证券交易蕴含巨大风险,过往价格结构及百分位分布不构成对未来走势的绝对保证。您必须结合自身财务状况、风险承受能力及独立研判做出交易决策,盈亏自负。作者不承担任何因使用本指标而产生的直接或间接损失。
---
如果您认可这套价格定位逻辑,欢迎点赞、收藏并关注!
期待您在评论区分享将该框架融入实战交易后的心得体会。
Market Compass - Dynamic Range Framework
Version: 1.0 | Type: Non-Predictive Price Structure Positioning Tool | Author:
The vast majority of trading losses stem not from incorrect directional judgment, but from a lack of "positional awareness" . This indicator addresses this core pain point — it does not tell you whether price will go up or down, but it does tell you "the precise coordinates of price on the map, at this very moment" .
---
This indicator is not a traditional moving average or momentum oscillator. Instead, it is a price percentile range positioning system based on a fixed lookback period . It uses the highest high and lowest low over the most recent N bars (default 252, corresponding to approximately one trading year) as natural boundaries, constructing a dynamic box grid spanning from 0% to 100%.
The grid is not evenly divided. It employs an asymmetric golden ratio and extreme-value anchoring methodology to precisely define 9 key horizontal threshold levels. These levels are cleanly overlaid on the main price chart using colored rectangular bands and real-time right-aligned floating labels:
100% Peak Threshold (Red): The absolute ceiling within the lookback period.
89% Overbought Warning Zone (Orange): Extreme euphoria zone; high probability of bullish exhaustion.
75% Bullish Boundary (Yellow): The bull-bear dividing line; breaking above signals medium-term strength.
62.5% Bull Pivot Threshold (Purple): Secondary retracement support level within an uptrend.
50% Equilibrium Axis (White): The value equilibrium line; a dense area of long-term capital cost.
37.5% Bear Pivot Threshold (Cyan): Secondary retracement resistance level within a downtrend.
25% Bearish Boundary (Light Blue): Breaking below signals a confirmed medium-term bearish trend.
11% Oversold Warning Zone (Light Green): Extreme panic zone; high probability of bearish exhaustion.
0% Floor Threshold (Dark Blue): The absolute floor within the lookback period.
As new bars are generated, the entire framework rolls forward iteratively , always anchored to the most recent price activity range, ensuring the reference coordinates never become obsolete.
---
Traditional price charts suffer from severe perspective limitations , leading traders into frequent misjudgments:
"Absolute Value Illusion" and Anchoring Bias : Is a price of $100 high or low? Discussing absolute price without reference to the recent trading range is meaningless. This indicator converts price into a relative percentile from 0 to 100 , eliminating the distortion of price magnitude and allowing you to objectively assess whether the current price is "relatively high" or "relatively low."
"Range Amnesia" and Recency Bias : The human brain naturally assigns excessive weight to the most recent 5–10 bars, easily forgetting key prior support and resistance structures. Through rolling window calculations, this indicator forcibly and prominently plots the price extremes of the past N bars on the current chart, correcting this cognitive bias.
Mean Reversion and Extreme Magnetic Attraction Theory : Financial market prices have long exhibited a statistical tendency to "revert from extreme values toward the center (50% equilibrium line)" . When price enters the extreme tail regions above 89% or below 11%, statistical probability dictates an inevitable gravitational pull toward the 50% axis. This framework provides precise quantitative刻度 for this "magnetic force."
---
This indicator serves as an excellent auxiliary tool for trend filtering, risk-reward assessment, and dynamic stop-loss/take-profit placement . Do not treat it as an independent entry signal; instead, regard it as a "quantitative foundation for price-action decision-making."
3.1 Three Classic Strategies Based on Market Context
【Trend Following Strategy】— For Strong Directional Markets
When price, after sufficient consolidation, breaks decisively above the 75% Bullish Boundary with a high-volume bullish candle, this serves as a key confirmation that the medium-term trend is shifting from consolidation to strength. If price subsequently retests the 75% level and finds support (forming a long lower wick), it represents an excellent "go with the macro trend, counter the micro pullback" add-on opportunity. In such cases, place your stop-loss below the 62.5% Bull Pivot Threshold.
【Mean Reversion Strategy】— For Range-Bound Markets
When price spikes rapidly above the 89% Overbought Warning Zone and simultaneously exhibits clear exhaustion patterns (such as shooting stars or bearish engulfing), this can be viewed as a short-term selling opportunity. The first target is the 75% level, and the second target is the 50% Equilibrium Axis. Conversely, when price plummets below the 11% Oversold Warning Zone and shows reversal signals, a short-term buying opportunity emerges.
【Breakout-Pullback Confirmation Strategy】— For Key Support/Resistance Transitions
Every percentage threshold possesses dynamic support/resistance properties. When price breaks upward through a given level (e.g., the 62.5% level) and subsequently retests that level on diminishing volume without breaking back below, this confirms that the level has successfully transitioned from resistance to support. This represents a highly favorable "Grade-A Entry Point" (minimal stop-loss, substantial upside potential).
3.2 Dynamic Stop-Loss and Take-Profit Placement Guide
Swing Long Positions : Use the 37.5% Bear Pivot Threshold as your ultimate hard exit line. As long as price remains above this level, you can confidently hold your long position, avoiding premature exits caused by early-stage volatility.
Short-Term Short Positions : Use the 62.5% Bull Pivot Threshold as your hard stop-loss line. Should price stage a strong rally and close above this level, the bearish thesis is invalidated, and you must exit decisively.
3.3 Parameter Adjustment Recommendations (By Trading Timeframe)
Daily Chart (Swing / Medium-to-Long Term) : Keep the default 252 (approximately one trading year), ideal for capturing annual bull-bear transitions.
Weekly Chart (Macro Trend / Position Sizing) : Consider adjusting to 52 (approximately one year of weekly bars) for identifying extreme percentiles within broader cycles.
Hourly / Minute Charts (Intraday / Scalping) : Consider adjusting to 50–100 . Longer lookbacks on lower timeframes cause the framework to become overly rigid, diminishing its short-term relevance.
---
4.1 Optimal Use Cases
Highly Liquid Equity Markets : CSI 300, S&P 500, major index constituents, and liquid individual stocks.
High-Liquidity Commodities and FX : Gold, Crude Oil, EUR/USD, and other major pairs.
Large-Cap Cryptocurrencies : Bitcoin (BTC), Ethereum (ETH), and similar assets.
4.2 Scenarios to Avoid or Use with Caution (Risk Red Lines)
Strictly avoid newly listed stocks with fewer than N bars of history : Although the code includes a built-in adaptive shortening mechanism, new issues are extremely unstable, and their highs/lows are vulnerable to manipulation, rendering the percentile framework nearly worthless.
Use with caution during continuous limit-up/limit-down extreme conditions : In powerful short squeezes or liquidity-driven crashes, price may remain persistently glued above the 100% level or below the 0% level. In such cases, the indicator becomes "blunted" , and you must immediately switch to trend-following tools (such as SAR or moving average systems) for secondary confirmation.
Avoid low-float "pump-and-dump" penny stocks : Sparse trading volume leads to erratic price jumps, causing the computed range to become highly distorted.
---
This indicator strictly adheres to TradingView best practices and contains absolutely no future functions . All signals are computed in real time based on deterministic historical data.
5.1 Adaptive Lookback Core Algorithm
The system first reads the user-defined `lookbackLength` (default 252). However, when the loaded instrument has fewer total bars on the chart than the configured period, the engine automatically triggers a protective mechanism:
effectiveLookback = math.min(i_lookbackLength, bar_index + 1)
This single line ensures the indicator functions from the very first trading day, and the window gradually expands as new bars are added until it reaches the user's desired standard period.
5.2 Nine-Level Linear Mapping (Percentile Segmentation Mathematics)
The process begins by determining the box extremes and range:
periodLow = ta.lowest(low, effectiveLookback) // Floor at 0%
periodHigh = ta.highest(high, effectiveLookback) // Peak at 100%
priceRange = periodHigh - periodLow
The range is then divided using a heuristic blend of Fibonacci ratios and statistically inspired thresholds :
priceL89 = periodLow + priceRange * 0.89 // Extreme warning
priceL75 = periodLow + priceRange * 0.75 // Bullish boundary
priceL625 = periodLow + priceRange * 0.625 // Golden ratio pivot
priceL50 = periodLow + priceRange * 0.50 // Equilibrium axis
// ... Symmetrical lower-level calculations follow the same logic
Note: The selection of 62.5% and 37.5% is derived from a slight integer adjustment to the 0.618 golden ratio, intended to provide cleaner and more memorable reference刻度 than the traditional 61.8%.
5.3 Rendering Engine Optimization (Memory & Performance Management)
To prevent chart lag caused by repeatedly drawing rectangles and lines across numerous historical bars, the engine employs a "lazy deletion with single-instantiation" strategy:
if barstate.islast
// Only triggered when loaded and running at the rightmost edge of the chart
box.delete(boxMain) // Destroy old handles first
line.delete(lineL100) // Clean up old lines
// ... Then create new objects
All labels use the label.style_label_left right-aligned format, ensuring they line up neatly on the far right of the chart without ever obscuring the most recent price bars. Prices are displayed with precision down to the exchange's minimum tick size (`format.mintick`).
---
It is not a crystal ball for predicting the future; it is a caliper for measuring the present.
In the inherently uncertain financial markets, "positional awareness" is the cornerstone of disciplined execution. `Market Compass` does not offer you a holy grail; it offers you an ever-updating situational awareness map of the battlefield . Integrate it into your existing trading system and use it as the first filter to eliminate low-probability trade setups.
---
This indicator and its accompanying description are provided for educational and technical analysis purposes only. They do not constitute, and should not be construed as, any form of investment advice or recommendation to buy, sell, or hold any financial instrument. Trading securities and derivatives involves substantial risk of loss. Past price structures and percentile distributions do not guarantee future results. You are solely responsible for your own trading decisions, taking into account your financial situation, risk tolerance, and independent judgment. Neither the author nor the hosting platform accepts any liability for losses arising from the use of this indicator.
---
If you find this price-positioning logic valuable, please like, bookmark, and follow!
I look forward to hearing how you integrate this framework into your live trading. Feel free to share your experiences and feedback in the comments section below.
Indicator

Smart Money Concepts Liquidity Sweep, Order Block & FVGOVERVIEW
Every Smart Money indicator draws order blocks and tells you they work. This one scores them 0–100 and then forward-tests whether the score is actually true — on your instrument, on your timeframe.
It maps liquidity, detects stop-hunts, builds entry zones from the displacement that follows, confirms them with real order flow, and grades every zone that price returns to. Instead of "here is an order block, trust me", the panel tells you something like:
Tier-A zones returned +0.23R vs +0.08R for a matched control, n=61, t=2.1 — PROVEN
...or, just as usefully, NOT PROVEN. It is built to be able to tell you it doesn't work.
This is a research and framing tool. It is NOT a strategy, NOT a signal service, and NOT a validated edge.
WHY THESE PARTS ARE ONE TOOL (mashup rationale)
The Smart Money / ICT model is a SEQUENCE. Each step is meaningless on its own, and that is why they are combined here rather than sold as separate scripts:
1. LIQUIDITY POOLS — Stops cluster above equal highs (buy-side) and below equal lows (sell-side). Swing points within an ATR tolerance are clustered into a single pool; the more swings, the more stops resting there. A pool is not a signal. It is a magnet and a target.
2. THE SWEEP — Price wicks THROUGH the pool and closes back INSIDE it. That is a stop-hunt, and it is the only part of the sequence that reveals intent. A sweep alone is still not a trade.
3. DISPLACEMENT — An impulsive, ATR-normalised move away from the swept level. This is what separates a SWEEP (reversal) from a RUN (continuation).
4. THE ZONE — Displacement leaves footprints: a FAIR VALUE GAP (a three-bar imbalance) and an ORDER BLOCK (the last opposing candle before the impulse). Where an FVG sits INSIDE an order block, two independent structures agree — flagged as a confluence zone.
5. LOCATION — The zone is then judged on WHERE it sits. Against the VOLUME PROFILE (value area, point of control, and untested "naked" POCs), and against the DEALING-RANGE EQUILIBRIUM. A bullish zone in DISCOUNT is a zone you are being paid to buy; the same zone in premium is not.
6. ORDER FLOW — The question structure cannot answer: did anyone actually show up? Intrabar delta signs each lower-timeframe bar's volume by its own direction. A bullish zone born on NEGATIVE delta is a vacuum, not a footprint — and scores nothing for it.
7. THE ENTRY — Price is never chased. The engine arms only when price RETRACES into a fresh zone, then frames entry / stop / target — the target being THE NEXT OPPOSING POOL OF STOPS, because that is where the next batch of liquidity is resting.
8. THE CALIBRATION — Without it, everything above is folklore.
Remove any one of these and the tool marks noise, chases price, targets nothing, ignores where value actually is, or reports a confidence it has not earned.
THE SCORE (0–100, eight measurable components, no discretion)
Displacement strength ...... impulse body ÷ ATR — the energy behind the zone
Participation (RVOL) ....... volume at formation vs its own recent average
Born from a sweep .......... did a stop-hunt precede it? (the core ICT claim)
Imbalance size ............. FVG height ÷ ATR
HTF alignment .............. does the higher timeframe agree?
Premium / discount ......... bullish zone in DISCOUNT? bearish zone in PREMIUM?
Volume-profile location .... at value, at the POC, or at an untested POC?
Order flow (delta) ......... was the displacement backed by real aggressive flow?
Tiers: A (70+) · B (40–69) · C (below 40). Every weight is an input — if you think the sweep matters more than I do, turn it up, and let the calibration tell you whether you were right.
THE CALIBRATION — AND WHY IT IS HONEST
Every zone trade is paired with a MATCHED CONTROL: the same bar, the same direction, and the SAME R:R — but entered at market with an ATR stop instead of at the zone. This isolates exactly one variable: does entering AT THE ZONE beat entering anywhere else on identical geometry? Under a random walk, this control has zero expectancy, so anything the zones earn is real.
Each tier is tested against its OWN control, because an A-zone may carry a very different R:R from a C-zone, and a trade's hit rate depends on its R:R.
Results are reported as EXPECTANCY IN R, not hit rate. When R:R varies from trade to trade, a hit rate on its own is meaningless: a 6R winner at 20% is +0.4R (excellent), while a 1R winner at 55% is +0.1R (barely worth the commission).
A Welch t-test decides whether the difference is real or luck. The panel does not say "proven" unless t > 1.96.
The panel also answers the one question that matters most: DOES TIER A BEAT TIER C? If the scoring model has any value, A-grade zones must outperform C-grade zones. If they don't, the score is noise — and it will say so.
Conventions are deliberately chosen so the tool cannot flatter itself:
· Both barriers touched on the same bar → the STOP is assumed first.
· Expired trades are marked to market, not counted as wins or losses.
· Everything is logged and resolved on confirmed bars only.
HOW TO USE IT
1. Read the bias, the liquidity map, and the premium/discount shading. Pools above are buy-side, pools below are sell-side, and price usually travels from one to the other.
2. Wait for a SWEEP, then for a zone to be created by the displacement that follows.
3. Do NOT chase. The engine arms an entry only when price RETRACES into a fresh zone.
4. Watch for ABSORPTION at the zone — heavy volume, a small range, price holding. Someone is soaking up the aggression. That is a defended zone, and it is the best live confirmation available.
5. READ THE CALIBRATION BEFORE YOU WEIGHT ANY OF IT. If Tier A is not proven on your instrument and timeframe, a zone is a LOCATION, not a PROBABILITY — treat it as context only.
6. Entry / stop / target and the resulting R:R are drawn on the chart. They are arithmetic, not advice.
Do not tune the weights until the numbers turn green. That is curve-fitting, and the calibration exists to catch it — not to be defeated by it.
ORIGINALITY
The underlying SMC concepts are public and credited below. What is assembled here is the specific synthesis: an eight-component measurable score, the fusion of SMC structure with auction-theory location (volume profile and premium/discount), true intrabar order-flow confirmation, a per-tier matched control, expectancy-in-R reporting, and a significance test that can — and frequently does — return "not proven".
Clean-room implementation. No third-party Pine code is reused.
UNIVERSAL / DATA REQUIREMENTS
Works on any symbol and any timeframe — the engine is ATR-normalised throughout, so it adapts to the instrument rather than assuming point values.
Volume improves the score but is NOT required. On a symbol without real volume, the RVOL, volume-profile and order-flow components neutralise and the panel says so, rather than blanking or pretending.
Intrabar delta requires a timeframe strictly below the chart's. The script AUTO-MAPS this (1m→5s, 3m→15s, 5m→30s, 15m→1m, and so on) because if the intrabar timeframe equals the chart timeframe there is only ONE intrabar — the bar itself — and delta degenerates to ±100% on every bar. Where true intrabar data is unavailable, the script falls back to a close-location proxy AND LABELS IT AS A PROXY in the panel.
NON-REPAINTING
Pools, sweeps, displacement, zones, the volume profile, absorption and entries are ALL computed on confirmed bars only.
Swing points use ta.pivot* and are therefore known only AFTER their confirmation bars. This is why a liquidity pool appears a few bars after its swing. That delay is the honest cost of not repainting, and it is paid deliberately — a level that moves after the fact is worse than no level at all.
The higher-timeframe read uses lookahead_off with a live-bar offset. The calibration harness logs AND resolves on confirmed bars, so its statistics cannot inflate intrabar. Nothing here is drawn and then moved.
HONEST LIMITATIONS — PLEASE READ
Smart Money Concepts is a popular framework, not a proven one. That is precisely why this script measures it instead of asserting it.
The calibration figures are IN-SAMPLE, close-to-close, with NO costs or slippage, and they use overlapping windows. A proven in-sample edge is NOT a guarantee of out-of-sample results.
The rolling volume profile is an APPROXIMATION — each bar's volume is spread uniformly across the bins its range covers. It is not tick data.
Small samples are unreliable. A tier with a low "n" is provisional even if it looks good.
If the edge is near zero, negative, or unstable across timeframes, the honest conclusion is that this model carries no edge on that instrument. The tool is designed to be able to tell you that, and you should believe it when it does.
Nothing here predicts price.
CONCEPT CREDITS
Smart Money / ICT concepts — liquidity pools, stop-hunts, displacement, fair value gaps, order blocks, premium/discount and optimal trade entry — are public trading concepts popularised by Michael J. Huddleston (Inner Circle Trader) and the wider SMC community.
Market Profile, the point of control and the value area — J. Peter Steidlmayer and the CBOT.
Market structure theory — Charles Dow.
Average True Range — J. Welles Wilder.
Wilson score interval — Edwin B. Wilson.
Triple-barrier forward labelling — Marcos López de Prado.
Welch's t-test — B. L. Welch.
The zone-scoring model, the order-flow fusion, the per-tier matched control and the tier calibration are the author's own. Not affiliated with, nor endorsed by, any of the above.
DISCLAIMER
This is a research and educational tool only. It is NOT financial advice, NOT a recommendation, and offers NO guarantee of profitability or accuracy. Indicators describe past behaviour; they do not predict the future. Entry, stop and target output is arithmetic, not advice. Trading carries a risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability for any use of this script. Indicator

Fractal Support & Resistance Zones invincible]Fractal Support & Resistance Zones
Fractal Support & Resistance Zones is an advanced market-structure and price-reaction framework designed to identify, evaluate, and dynamically manage support and resistance zones derived from confirmed fractal pivots.
Unlike traditional support and resistance indicators that simply draw horizontal levels at swing highs and lows, this indicator treats every zone as a dynamic market structure object. Each zone develops through its own lifecycle based on price interaction, independent retests, reaction strength, penetration, estimated buying and selling activity, structural confirmation, trend alignment, and eventual support/resistance role reversal.
The objective is not simply to show where price previously turned.
The objective is to evaluate which zones are still technically relevant, which have gained confirmation, which are weakening, and which may provide better structural trade locations.
---------------------------------------------------------------------------------------------
Fractal-Based Zone Detection
The indicator identifies two independent classes of fractal pivots:
Weak Fractals
Shorter-length pivots designed to capture local price reactions and minor structural turning points.
Major Fractals
Higher-strength pivots based on a larger fractal window. These represent more significant swing highs and swing lows and receive greater importance within the zone-quality model.
Fractal support zones are created from confirmed pivot lows, while fractal resistance zones are generated from confirmed pivot highs.
The detection timeframe can be independently selected, allowing zones from a higher timeframe to be displayed on a lower-timeframe chart.
Higher-timeframe fractal data is requested with lookahead disabled to prevent future data from being intentionally introduced into the pivot calculation.
---------------------------------------------------------------------------------------------
Dynamic Support and Resistance Zones
The indicator creates price zones rather than single horizontal lines.
Markets rarely react from one exact price. Orders, liquidity, and previous positioning are often distributed across a price range. The zone model therefore attempts to represent the broader reaction area surrounding a fractal pivot.
Three zone-width methods are available:
ATR
Zone width is calculated from Average True Range and automatically adapts to market volatility.
Pivot Candle
The structure of the original fractal candle is used to determine the zone width.
Hybrid Candle + ATR
Combines pivot-candle structure with an ATR-based volatility limit.
The hybrid method is designed to prevent unusually large pivot candles from creating excessively wide support or resistance areas.
A minimum tick-based width can also be configured for instruments with very small price movements.
---------------------------------------------------------------------------------------------
Fractal Zone Clustering
Markets frequently produce several nearby fractal pivots around the same price area.
Drawing every pivot independently can create overlapping boxes and unnecessary chart congestion.
The indicator therefore includes a fractal clustering engine.
Nearby same-side fractals may be merged into a common structural zone when:
* They are within the configured ATR merge distance.
* The resulting merged zone does not exceed the maximum permitted ATR width.
* The maximum cluster count has not been exceeded.
* Fresh major zones are not being merged into previously tested or damaged zones when protection is enabled.
The cluster count becomes one component of the zone-quality model.
A cluster does not automatically mean a zone is strong. It simply indicates that multiple independent fractal structures developed around a similar price area.
---------------------------------------------------------------------------------------------
Independent Retest Detection
A major feature of the indicator is the distinction between bars inside a zone and independent zone retests.
If price remains inside a support or resistance area for several candles, those candles are not counted as multiple tests.
A new test is counted only after price:
1. Interacts with the zone.
2. Moves sufficiently away from the zone.
3. Travels the configured ATR reset distance.
4. Returns to the zone again.
This creates a more realistic retest model and avoids artificially increasing the test count during sideways congestion.
The label displays the number of independent tests recorded for each selected zone.
---------------------------------------------------------------------------------------------
ATR-Based Reaction Measurement
After an independent zone retest, the indicator measures how strongly price reacts away from the zone.
Reaction strength is normalized using ATR.
For a support zone, the engine measures upward movement from the reaction anchor.
For a resistance zone, the engine measures downward movement from the reaction anchor.
The strongest reaction generated by the zone is stored as its **Best Reaction ATR**.
Two configurable reaction thresholds are used:
Verified Reaction
The zone has produced the minimum ATR reaction required for technical validation.
Proven Reaction
The zone has generated a stronger ATR reaction and has also accumulated sufficient independent testing.
This prevents a zone from receiving a high structural status simply because price briefly touched it.
The market must demonstrate an actual directional response.
---------------------------------------------------------------------------------------------
Dynamic Zone Status System
Every zone is continuously classified according to its current structural condition.
FRESH
A newly created major zone that has not yet received an independent retest.
Fresh zones may represent relatively untouched structural areas.
WEAK
A zone originating from the shorter weak-fractal detection model.
Weak zones can still produce valid reactions but receive a lower fractal-grade contribution in the quality model.
VERIFIED
A zone that has been tested and remains structurally active.
Reaction behaviour and zone validation contribute dynamically to its score.
PROVEN
A zone that has accumulated multiple independent tests and generated a reaction exceeding the configured Proven Reaction ATR threshold.
Proven zones represent areas with demonstrated historical reaction behaviour.
DAMAGED
Price has penetrated a configurable percentage of the zone.
A damaged zone has not necessarily broken, but deeper penetration reduces its quality score.
BROKEN
Price has invalidated the zone according to the selected break-confirmation method.
Break confirmation can use either:
* Close Beyond Zone
* Full Candle Beyond Zone
Broken zones may optionally remain visible for historical analysis.
FLIPPED SUPPORT / FLIPPED RESISTANCE
A previously broken zone has confirmed a structural role reversal.
Previous support may become resistance.
Previous resistance may become support.
The indicator does not immediately flip a zone when price crosses it. A separate role-reversal confirmation process is required.
---------------------------------------------------------------------------------------------
Zone Damage and Penetration Tracking
Zone quality is not binary.
A support or resistance area may gradually weaken before it completely breaks.
The indicator continuously measures the maximum percentage of zone penetration.
For support, penetration is measured downward through the support area.
For resistance, penetration is measured upward through the resistance area.
When penetration exceeds the configured damage threshold, the zone is classified as ** DAMAGED
Damage also applies a progressive penalty to the quality score.
This means a deeply penetrated zone may remain technically valid while receiving a lower structural ranking.
---------------------------------------------------------------------------------------------
Support and Resistance Role Reversal
The indicator contains a dedicated zone-flip engine.
After a support or resistance zone breaks, the engine monitors whether price moves sufficiently beyond the former zone.
The broken zone must first establish separation from price using a configurable ATR distance.
Price must then return to the previous structural area.
Depending on the selected confirmation mode, the indicator can require:
Zone Reclaim Only
The opposite-side retest itself is sufficient.
Close Away
Price must close a configurable ATR distance away from the zone.
Rejection or Engulfing
The retest can be confirmed through rejection behaviour, an engulfing candle, or a sufficiently strong close away from the zone.
Once confirmed:
* Broken support can become resistance.
* Broken resistance can become support.
The zone is then reset into a new lifecycle as a flipped structural area.
---------------------------------------------------------------------------------------------
Estimated Buy and Sell Activity
The indicator includes an estimated directional volume model.
Because standard TradingView volume does not directly provide true executed bid and ask volume for every market, buying and selling activity is estimated from candle position within the candle range.
A close nearer the candle high allocates a greater portion of volume to estimated buying activity.
A close nearer the candle low allocates a greater portion of volume to estimated selling activity.
The model can use:
* Pivot volume only.
* Pivot volume plus independent retest activity.
Selected zone labels display estimated activity as:
B 64% | S 36%
This should be interpreted as an estimated directional participation model rather than true exchange-level order-flow delta.
---------------------------------------------------------------------------------------------
Multi-Factor Zone Quality Model
Every zone receives a dynamic quality score from 0 to 10.
The score is not based on a single condition.
The model combines several structural factors.
Fractal Grade
Major fractals receive a stronger contribution than weak fractals.
Rejection Wick
The pivot candle's rejection wick is normalized against ATR.
Larger relative rejection can increase the origin score.
Independent Retests
The model evaluates how many genuinely independent zone tests have occurred.
Importantly, unlimited retests do not continuously improve quality.
Excessive testing can weaken a zone.
Reaction Strength
The strongest measured ATR reaction contributes to zone validation.
Estimated Volume Confirmation
Pivot volume participation and directional estimated activity contribute to the score.
Fractal Cluster
Multiple nearby fractals can increase structural confidence.
Freshness
Newer zones receive a greater freshness contribution.
As a zone ages, this component gradually decreases.
The weight of every major quality component can be adjusted by the user.
---------------------------------------------------------------------------------------------
Origin Score and Validation Score
Internally, the quality engine separates zone evaluation into two conceptual stages.
Origin Quality
Evaluates how the zone was created.
This includes:
* Fractal grade.
* Pivot rejection wick.
* Pivot volume participation.
* Fractal clustering.
* Zone freshness.
Validation Quality
Evaluates what price did after the zone was created.
This includes:
* Independent retests.
* Reaction strength.
* Directional estimated activity.
Fresh zones are influenced more heavily by origin quality.
As price begins interacting with a zone, validation behaviour receives greater influence.
This allows the quality score to evolve with market behaviour rather than remaining permanently fixed at zone creation.
---------------------------------------------------------------------------------------------
Retest Exhaustion Penalty
A common assumption is that more support or resistance tests always make a zone stronger.
This indicator does not use that assumption.
Repeated interaction may gradually consume resting liquidity around a price area.
After the configured number of retests, the indicator begins applying an excess retest penalty.
The penalty increases with each additional independent test.
As a result, a heavily tested zone may receive a lower quality score even if it has not formally broken.
---------------------------------------------------------------------------------------------
Congestion Penalty
Price remaining inside a zone for an extended period may indicate balance, absorption, or structural deterioration.
The indicator tracks consecutive bars interacting with each zone.
After the configured congestion threshold, a progressive quality penalty is applied.
This helps distinguish a clean rejection from prolonged price acceptance inside the area.
---------------------------------------------------------------------------------------------
Trend Regime Alignment
An optional EMA-based trend regime is included in the quality model.
Support zones located in an unfavourable bearish regime can receive a counter-trend penalty.
Resistance zones located in an unfavourable bullish regime can also receive a penalty.
The trend filter does not automatically delete zones.
Instead, it modifies their relative quality.
This allows historically valid support and resistance areas to remain visible while acknowledging the current directional regime.
---------------------------------------------------------------------------------------------
Market Structure Break Detection
The indicator includes an independent Market Structure Break, or **MSB**, engine.
Confirmed swing highs and swing lows are detected using a configurable pivot length.
A bullish MSB occurs when price closes above the latest eligible structural high with sufficient momentum confirmation.
A bearish MSB occurs when price closes below the latest eligible structural low with sufficient negative momentum confirmation.
Momentum is normalized using a Z-score calculated from recent price changes.
This reduces the number of minor structural crossings classified as meaningful breaks.
Each structural pivot can generate only one MSB event, preventing repeated labels from appearing after the same swing has already been broken.
---------------------------------------------------------------------------------------------
Zone-to-Structure Confirmation
Market Structure Breaks can also validate previously tested zones.
When a bullish MSB occurs, the indicator searches for a recently touched support zone.
When a bearish MSB occurs, it searches for a recently touched resistance zone.
The most recent eligible zone can receive structural confirmation.
A configurable quality bonus is then applied.
This creates a basic structural sequence:
Zone interaction → Price reaction → Market Structure Break
The intention is to distinguish zones that merely produced a temporary bounce from zones followed by a measurable structural shift.
---------------------------------------------------------------------------------------------
Premium and Discount Trade Location
The indicator uses the latest structural swing high and swing low to estimate the current swing midpoint.
The midpoint represents the 50% equilibrium level of the structural range.
When Premium/Discount grading is enabled:
* Support zones are favoured when positioned in the discount portion of the swing.
* Resistance zones are favoured when positioned in the premium portion of the swing.
This condition contributes to the displayed Trade Grade.
It does not remove zones from the chart.
---------------------------------------------------------------------------------------------
Trade Grade System
Selected zones receive a simplified structural trade grade.
Grade A+
Reserved for high-quality zones with strong alignment between:
* Zone quality.
* Trend regime.
* Premium/discount location.
* Low structural damage.
* Limited retest exhaustion.
Grade A
Strong-quality zones with favourable trend alignment and low damage.
Grade B
Moderate-to-strong structural zones that are not classified as weak fractals.
Grade C
Lower-quality but still technically visible zones.
Grade D
Zones with poor overall structural quality.
The Trade Grade is a contextual ranking system.
It is not an automatic buy or sell signal.
---------------------------------------------------------------------------------------------
Star-Based Quality Display
To make the detailed labels easier to read, the numerical quality model is represented using stars.
★★★★★ = Quality 8.0 or higher
★★★★ = Quality 6.0 to 7.99
★★★ = Quality 4.0 to 5.99
★★ = Quality 2.0 to 3.99
★ = Quality below 2.0
The stars provide a quick visual representation of the underlying 0–10 quality score.
---------------------------------------------------------------------------------------------
Compact Detailed Labels
Selected zones can display compact one-line labels such as:
VERIFIED SUP | B 64% | S 36% | ★★★★ | Tests: 2 | Grade A
The label contains:
* Current zone status.
* Support or resistance classification.
* Estimated buying activity.
* Estimated selling activity.
* Quality stars.
* Independent retest count.
* Structural Trade Grade.
Because displaying a detailed label on every zone can create significant chart congestion, two label modes are available.
Nearest + Strongest
Prioritizes the nearest support, nearest resistance, and the highest-quality remaining zones.
All Visible Zones
Displays labels for every currently visible zone.
The maximum number of detailed labels can also be controlled.
---------------------------------------------------------------------------------------------
Nearest Zone Highlighting
The indicator continuously identifies:
* The nearest active support below price.
* The nearest active resistance above price.
These zones can receive stronger border highlighting.
This makes the most immediately relevant structural areas easier to identify without removing historical zones from the chart.
---------------------------------------------------------------------------------------------
Structural Equilibrium Zone
The latest confirmed structural swing high and swing low are used to calculate a 50% equilibrium area.
The indicator plots:
* Swing origin.
* Swing destination.
* 50% midpoint.
* Configurable equilibrium zone thickness.
Before price interacts with the equilibrium area, the zone is displayed as the current structural midpoint.
After price touches the area, the indicator changes its state to:
Equilibrium touched · wait for structure
This is intended to remind the trader that equilibrium interaction alone is not necessarily directional confirmation.
Additional market structure may be required.
---------------------------------------------------------------------------------------------
Alert Conditions
The indicator provides alert conditions for important zone and market-structure events:
* New fractal support zone.
* New fractal resistance zone.
* Independent zone retest.
* Zone verified by ATR reaction.
* Zone reaching Proven status.
* Zone becoming Damaged.
* Zone break.
* Support/resistance role reversal.
* Bullish Market Structure Break.
* Bearish Market Structure Break.
These alerts can be used to monitor structural changes without continuously watching the chart.
---------------------------------------------------------------------------------------------
Suggested Interpretation
This indicator is designed as a market context and structural analysis tool.
A possible analytical workflow is:
1. Identify the nearest active support and resistance.
2. Review the zone's current status.
3. Check estimated buy/sell activity.
4. Evaluate the quality stars.
5. Review the independent test count.
6. Check whether the zone is fresh, validated, damaged, or exhausted.
7. Evaluate trend alignment.
8. Check premium or discount location.
9. Observe whether price produces a structural break after the zone reaction.
10. Use the Trade Grade as an additional contextual ranking.
No single factor should be interpreted independently.
A five-star zone can still break.
A damaged zone can still generate a reaction.
A weak fractal can still become structurally relevant.
The purpose of the model is to organize multiple price-action variables into a consistent framework.
---------------------------------------------------------------------------------------------
Important Volume Note
The Buy and Sell percentages displayed by this indicator are estimated directional volume statistics.
They are calculated by allocating candle volume according to the closing position within the candle's high-low range.
They do not represent true bid/ask volume, footprint delta, or exchange-level aggressive buying and selling.
The values should therefore be used as a relative activity estimate only.
---------------------------------------------------------------------------------------------
Non-Repainting Considerations
Fractal pivots require confirmation bars.
A zone is created only after the corresponding pivot has been confirmed by the selected fractal length.
Higher-timeframe fractal calculations use `lookahead_off`.
Therefore, historical zones should be interpreted from the point at which the fractal became technically confirmed rather than assuming the pivot was known at the exact swing candle in real time.
Market Structure Break conditions are also evaluated using confirmed price and momentum conditions.
---------------------------------------------------------------------------------------------
Final Note
Fractal Support & Resistance Zones is designed for traders who prefer **dynamic structural zones instead of static support and resistance lines**.
The indicator combines fractal structure, volatility-normalized zone construction, independent retests, reaction measurement, damage analysis, estimated directional activity, structural breaks, trend regime, premium/discount location, and role reversal into a unified zone lifecycle model.
It is intended to help answer three practical questions:
Where is the important price structure?
How has price behaved around that structure?
Is the zone gaining validation, remaining fresh, or gradually losing structural quality?
This indicator is intended for technical analysis and research purposes only. It does not constitute financial advice. Traders should independently evaluate market conditions and apply appropriate risk management.
Indicator

Bedaiwi's Smart PivotsBedaiwi's Smart Pivots is a three-level market-structure indicator that classifies price turning points as Minor, Intermediate, and Major highs and lows.
HOW IT WORKS
Minor Pivots
A Minor High is confirmed when the middle bar of a three-bar formation has a high that is strictly higher than the highs immediately before and after it.
A Minor Low is confirmed when the middle bar has a low that is strictly lower than the lows immediately before and after it.
Equal highs and equal lows are not treated as Minor pivots.
Intermediate Pivots
Intermediate pivots are derived from confirmed sequences of Minor pivots.
An Intermediate High is identified when a higher Minor High is followed by a lower Minor High.
An Intermediate Low is identified when a lower Minor Low is followed by a higher Minor Low.
Major Pivots
Major pivots apply the same hierarchical logic to confirmed Intermediate pivots.
A Major High is identified when a higher Intermediate High is followed by a lower Intermediate High.
A Major Low is identified when a lower Intermediate Low is followed by a higher Intermediate Low.
SYMBOLS AND COLORS
- Red diamond: Intermediate High
- Green diamond: Intermediate Low
- Red exclamation mark: Major High
- Green exclamation mark: Major Low
Optional Minor pivots use the same High and Low color settings.
When the replacement option is enabled, an Intermediate symbol is removed and replaced with an exclamation mark if the same point is later promoted to Major status.
HISTORICAL PLOTTING AND CONFIRMATION DELAY
Pivot identification requires subsequent price information.
A Minor pivot is confirmed only after the following bar closes. Intermediate and Major pivots require additional confirmed pivot sequences, so their confirmation occurs later.
After confirmation, the indicator places the symbol on the historical bar where the relevant high or low occurred. Therefore, a symbol displayed on an earlier bar was not necessarily available in real time on that bar.
Historical placement is used only to show the actual location of the confirmed turning point. It should not be interpreted as a signal that was known on the historical pivot bar.
SETTINGS
Users can:
- Show or hide Minor pivots
- Show or hide Intermediate pivots
- Show or hide Major pivots
- Replace an Intermediate symbol when it becomes a Major pivot
- Customize High and Low pivot colors
PRACTICAL USE
Smart Pivots can help users:
- Study market structure
- Identify significant historical swing highs and lows
- Separate short-term fluctuations from higher-level price structure
- Review possible support and resistance areas
- Add context to discretionary price-action analysis
LIMITATIONS
Smart Pivots is an analytical indicator. It does not place trading orders and does not define entries, exits, stop-loss levels, profit targets, position sizing, or expected returns.
Pivot confirmation is delayed by design because later price action is required. Results may vary between symbols, timeframes, sessions, and data feeds.
The indicator does not identify final market tops or bottoms with certainty. Historical observations do not guarantee future market behavior.
This script is provided for research and educational purposes only. It is not financial or investment advice. Indicator

Adaptive Market Suite [Jayadev Rana]Overview
Adaptive Market Suite is a four-module analysis toolkit that draws on the price chart. Each module is independent: turn any of them on or off, and each has its own settings group. It shows context, not buy or sell arrows. The four modules are an adaptive trend, volatility bands, market structure with order blocks and fair-value gaps, and an order-flow oscillator. You read the confluence and make your own decisions.
Module 1 - Adaptive Trend and Regime
A moving average whose smoothing adapts to Kaufman's efficiency ratio: the net distance price travelled divided by the total path it took to get there. In clean trends the ratio is high and the average speeds up to hug price; in chop it is low and the average slows and flattens. The line is coloured by its slope, and the info panel reports whether the market is trending or ranging from the same ratio.
Module 2 - Expected-Move Bands
Volatility bands around the adaptive basis. Instead of a fixed multiple of range, the band width scales with where the current Average True Range sits in its own recent history (its percentile), so the bands contract in quiet conditions and expand when volatility rises. A nearer pair and a wider pair mark two envelopes.
Module 3 - Liquidity and Structure
Market structure from confirmed swing pivots, labelled as Break of Structure and Change of Character. Because the pivots are symmetric (confirmed on both sides), they are fixed before they are drawn and do not repaint afterward. On a structure break the tool marks the order block behind the move (the last opposite-direction candle before the push) and it tracks fair-value gaps, which are three-bar imbalances. Each zone follows a mitigation lifecycle: it is extended while it is live and greyed once price trades through it, and only the most recent zones per type are kept so the chart stays readable.
Module 4 - Order-Flow Oscillator
A normalised buy and sell pressure read in the indicator pane. For each bar it combines where price closed within the bar's range with how large that bar's volume was relative to its recent average. Sustained closes near the highs on strong volume push the oscillator positive; the mirror pushes it negative. An absorption marker highlights bars with heavy volume but a small range, where effort is not producing movement.
Info panel
An optional compact table summarises the current trend direction, the regime read, the volatility percentile, and the current order-flow side. It is context only.
Inputs
Inputs are grouped per module: General (ATR length); Module 1 (efficiency length, fast and slow smoothing, regime threshold, colours); Module 2 (volatility lookback, base and extra width, colour); Module 3 (swing length, order-block lookback, max zones per type, toggles for structure, order blocks and fair-value gaps, colours); Module 4 (pressure smoothing, absorption threshold, colours); plus an info-panel toggle. Every module has a single enable switch.
Alerts
Bullish and bearish structure break, and the order-flow oscillator crossing above or below zero.
How to use it
Treat it as a confluence map rather than a signal. For example, price reaching an order block near the lower band, with the order-flow oscillator turning up while the adaptive trend is still rising, is a stronger context than any one of those alone. Turn off the modules you do not need: if you only trade structure, disable the other three groups for a clean map. It is intended for liquid instruments and works across timeframes; the demonstration chart is Gold on the 1-hour timeframe.
Limitations
The structure module confirms swings with bars on both sides, so its labels and order blocks appear a fixed number of bars after the pivot forms. That delay is the trade-off that keeps them from repainting. The bands, the oscillator and the info panel read the current bar and update as it forms, like any live calculation. This is an analysis tool, not a strategy: it places no orders, makes no performance claim, and there is no win rate because it does not promise trades.
Disclaimer
For education and research only. This is not financial advice, and past chart behaviour does not predict future results. Test any approach yourself and manage your own risk. Indicator

Auction Regime Router Entropy Gate & Hurst MemoryAuction Regime Router — Entropy Gate & Hurst Memory
What it is
Every structure playbook fails in the wrong regime. Fading the value-area edge works when price is anti-persistent (stretches snap back); riding a breakout works when price is persistent (moves feed on themselves); and nothing structural works when the tape is noise. This tool measures two things — how much structure exists, and what kind it is — and routes to a plain-language answer: FADES VIABLE / BREAKOUTS VIABLE / STAND ASIDE. It decides which of your tools to trust, never buy or sell.
The two measurements (and how they work together)
Permutation entropy (Bandt–Pompe 2002) — the gate. It measures how disordered the recent price sequence is from the frequencies of ordinal patterns (which of the 6 orderings each price triplet takes). High entropy = all patterns equally likely = noise = no structural edge. The gate is self-calibrated: entropy is ranked against its own recent history, so "noisy" means noisy for this symbol and timeframe.
Hurst exponent (Hurst 1951; Mandelbrot) — the router. Memory via diffusion scaling: how the dispersion of K-bar returns grows with K. H > 0.5 = persistent → continuation regime; H < 0.5 = anti-persistent → reversion regime. Research supports the routing: mean reversion is empirically more probable and faster during anti-persistent periods.
The mashup logic is a hierarchy, not a mixture: the entropy gate overrides the Hurst read. If the tape is noise, the router says STAND ASIDE regardless of what H says — because a memory estimate on noise is meaningless.
The honesty steps
A dead zone around H = 0.5 (default 0.45–0.55): near a random walk the memory read is unreliable, so the router says MIXED rather than pretending. Practitioners commonly require a margin before activating a playbook; both thresholds are inputs.
A minimum-dwell filter (the standard anti-chattering design from switched-systems control): a new regime is announced only after it survives a set number of confirmed bars, so the read doesn't flip-flop bar to bar. The cost is that many bars of lag — stated, and adjustable.
Estimates are proxies from bar data with overlapping windows — descriptive of the recent past, not a prediction. The dashboard shows the state, how long it has persisted (regime age), how dominant it has been recently (stability %), and any pending regime with a countdown — nothing more.
How to use it
Add to any liquid symbol/timeframe; defaults suit intraday index futures. The script requests no external data of any kind, so it runs on every plan and every symbol.
Glance at the regime lane — the thin colored strip at the bottom of the pane: blue = continuation, violet = reversion, amber = noise, gray = mixed. The palette is deliberately direction-neutral — no green or red anywhere in regime coding, so nothing can be misread as a buy or sell.
The HTF STACK row shows the raw regime on three higher timeframes derived as multiples of the chart (defaults 3×, 5×, 15× — so a 5m chart reads 15m/25m/75m automatically, adapting to any chart). A ✓ in green = every timeframe agrees on the same actionable regime (strongest context). A ⚠ in amber = a higher timeframe reads NOISE or the opposite regime while the chart claims a playbook (weakest — reduce or wait).
Read the dashboard for detail: REVERSION → your value-area fade / band-reversion tools are in their element; CONTINUATION → your breakout / drive tools are; NOISE → the gate is closed, stand aside; MIXED → no clear routing, reduce. STABILITY shows how settled the read is; PENDING shows a forming regime with a countdown.
Regime-change tags print only on announced (dwell-confirmed) changes; alerts fire on entering each state.
Best used as the selector above your structure toolkit rather than as a standalone display.
What makes it original
Hurst and entropy oscillators exist. What this adds: (1) the hierarchy — a self-calibrated entropy gate that can veto the memory read, instead of two numbers side by side; (2) routing to auction playbooks in plain language (fade vs breakout viability), not a raw statistic; (3) honest dead zones, a minimum-dwell announcement filter, and stability/pending context instead of a binary flip at H = 0.500. It is a decision-hygiene tool for structure traders.
Concept credits
Ordinal-pattern (permutation) entropy — C. Bandt & B. Pompe (2002). Long-memory / rescaled-range analysis — H. E. Hurst (1951); fractal market framing — B. Mandelbrot. Regime-gated strategy selection — standard quantitative practice. Implementation and charting design are the author's own.
Important disclaimer
Research and education only. Not financial advice, not a signal service, not a guarantee of future results. Regime labels are descriptive statistics of recent bars; regimes change without warning and estimates are proxies. Validate independently and manage your own risk. Indicator

Adaptive Structural Trail Order Flow, Imbalance & RegimeAdaptive Structural Trail — Order Flow, Imbalance & Regime
What it is
Adaptive Structural Trail is a single, self-contained market-structure framework that re-clocks the chart by participation instead of time, marks the imbalances that real activity leaves behind, lets order flow decide which of those levels still matter, asks a regime filter whether trending behaviour can be trusted right now, and trails the strongest surviving level as an adaptive stop — all summarised in a plain-language dashboard that tells you, at a glance, whether the picture says ride, wait, or stand aside.
It is designed to be market-agnostic: every raw input (price, volume, and the volatility-index reference) is user-selectable, so the same logic runs on index futures, equities, FX, crypto or commodities without touching the code. Defaults are set for NIFTY index futures; change the volatility symbol and (if needed) the volume source for other instruments.
Why the components are combined (this is one tool, not a bundle)
Each layer measures a different facet of one process — activity creating structure, structure decaying or being defended, and a regime deciding whether to act. They are not independent indicators stacked for visual effect; remove any one and the others lose their meaning:
Delta clock (the substrate). A virtual bar closes only when cumulative signed volume becomes statistically significant (σ × a multiplier). Every downstream reading is therefore spaced by participation, not by the clock — a quiet 10 minutes and a violent 10 seconds are treated differently, which is the whole point.
Imbalance / fair-value-gap detection runs on those virtual bars, so a level is recorded only where genuine activity gapped price, not on arbitrary time bars.
Order-flow lifecycle (charge → decay → breaker/dead). When price returns to a level, delta adjudicates the outcome: absorbed-and-defended levels are reborn as breakers; levels that are surged through are killed. Flow decides what structure survives.
Regime gate (efficiency ratio + volatility burst). This routes everything. The trail is shown and signals arm only where trend behaviour is statistically credible; in range/transition/high-volatility states the tool deliberately stands aside.
Confidence fusion. Structure strength, cumulative-delta slope and flow toxicity (VPIN) are blended into one confidence number, which the dashboard converts into a plain instruction.
That coupling — a volume-significance clock feeding imbalance detection whose survival is adjudicated by order flow and gated by regime, fused into a single trailing level and a decision read-out — is the original contribution here.
How to use it
Add it to any liquid instrument. It is built for intraday timeframes (1–15 min is the sweet spot on index futures).
Read the dashboard top-down: the ACTION banner is the headline (e.g. LONG · ride the trail, RANGE · stand aside). Below it: bias + confidence, market state, the actual trail-stop price, order flow, flow toxicity, volatility context, and a plain "what to do" line.
Treat the coloured trail as a structure-based stop while the market state is a trend; when the state leaves trend, the trail disappears by design.
The imbalance zones show where unfilled activity sits; fresh, tapped and breaker levels are colour-coded (see the on-chart legend).
Edge-calibration panel (bottom-right): for transparency it scores past signals against a regime-matched base rate and reports EDGE = Hit − Base with a 95% confidence interval. Read the Edge column, not the raw hit-rate. This is descriptive of the past on your symbol — not a backtest and not a forward guarantee.
Key-info panel (top-left): instrument, timeframe, the live data source (see honesty note), threshold, ATR and level counts.
Honest note on data (please read)
TradingView exposes no true tick-by-tick aggressor delta and cannot build custom bars, so delta here is a proxy: signed intrabar volume taken from the finest lower timeframe your data plan returns — 1-second where available, otherwise 1-minute — falling back to bar-shape when no lower-timeframe data exists. The live source is shown as "Delta source" in the Key-info panel, so you always know which mode is active. Non-repaint: the delta clock advances and structure/regime/signals resolve only on confirmed bars; the trail line itself updates within the forming bar as a current estimate.
Originality
The novelty is the synthesis and coupling, not any single classical block. A participation clock is used to gate imbalance detection; order flow is used to adjudicate level survival; regime is used to route the entire read; and the whole thing collapses into one trailing level plus a decision dashboard and a self-calibration panel. Every raw input is user-selectable so the framework generalises across markets.
Concept credits
This tool synthesises well-established, publicly documented ideas; credit to their originators:
Information / volume-driven bars & VPIN flow toxicity — Marcos López de Prado; Easley, López de Prado & O'Hara.
Efficiency Ratio (trend vs. noise) — Perry J. Kaufman.
Trade-side classification (tick rule) — Lee & Ready.
Market impact & absorption (square-root law) — Almgren; Tóth & Bouchaud.
Wilson score interval (small-sample proportion CI) — E. B. Wilson.
Imbalance / fair-value-gap and trailing-stop concepts are long-standing, widely used market-structure ideas. The synthesis and the Pine implementation are the author's own.
Exported outputs (for use in other scripts)
Available via input.source() in any other indicator, with clean generic names: Bias Score (signed conviction, ±10), Trail Stop, Trail Direction, Regime State, Confidence, Leading Strength, CVD Slope, Flow Toxicity, Cumulative Delta, Volatility ROC, Volatility Bias.
Disclaimer
For research and education only. This is an analytical tool — not financial advice, not a signal service, and not a guarantee of future results. No indicator has an inherent edge; validate with your own testing, apply realistic costs, and manage risk. You are solely responsible for your trading decisions. Indicator

Liquidity Structure Framework [PakunFX]Liquidity Sequence Framework
Liquidity Sequence Framework (LSF) is a market structure analysis indicator designed to visualize the progression of liquidity events, structure shifts, and Fair Value Gaps (FVGs) within a single analytical framework.
Instead of focusing on individual signals, the indicator organizes multiple market events into a sequential process, helping traders observe how price structure develops over time. The script combines swing structure, liquidity sweeps, trend filtering, and Fair Value Gap detection into a unified charting tool.
Features
External and Internal Swing Structure detection
Liquidity Sweep identification (SSL / BSL)
Bullish and Bearish Structure Shift detection
Automatic Fair Value Gap (FVG) detection
EMA-based trend filter
Premium / Discount (Equilibrium) filter
Configurable setup conditions
Visual sequence tracking with alerts
How it Works
The indicator monitors market structure using external and internal swing highs and lows. When liquidity is swept beyond a previous swing level, a new sequence begins. The script then tracks whether price confirms a structure shift and subsequently forms a Fair Value Gap within a configurable sequence window.
Trend filtering can be applied using Fast and Slow EMA conditions, while optional Premium / Discount and Fair Value Gap requirements allow users to customize how potential setups are displayed.
Display Elements
External Swing High / Low
Internal Swing High / Low
Liquidity Sweep markers (SSL / BSL)
Structure Shift markers
Active Fair Value Gap zones
Fast and Slow EMA
Equilibrium level
Setup markers
Alerts
Alerts are available for:
Liquidity Sweep
Bullish Structure Shift
Bearish Structure Shift
Bullish Sequence Setup
Bearish Sequence Setup
These alerts are intended to notify users when predefined analytical conditions are detected.
Notes
Liquidity Sequence Framework is designed as a market analysis tool. It visualizes structural relationships between liquidity events and price development but does not generate trading recommendations or predict future market direction.
Disclaimer
This script is provided for educational and research purposes only.
All calculations are based on historical price data. The displayed structures, Fair Value Gaps, and sequence conditions are intended to support chart analysis and should not be interpreted as guarantees of future market behavior or trading performance.
Indicator
