Market Structure with ATR trailing stop [EDGE]Market Structure with ATR trailing stop — Multi-Timeframe Structure + ATR Trailing Stop.
A precision market-structure tool that goes beyond a simple pivot indicator by combining SMC-style swing detection, multi-timeframe CHoCH/BOS tracking, and a school-standard ATR trailing stop — all adapted automatically to the chart timeframe.
How it works:
The indicator scans pivot highs and lows using an SMC-calibrated Length (automatically picked for the current timeframe or set manually). Each broken pivot is classified as CHoCH (character change, phase start) or BOS (continuation) using your chosen breakout method — Wick, Body, or 2-Close confirmation. The same logic is mirrored across D1, H4, H1 and M5 in a summary table, so you always see whether the higher timeframes agree with the current one.
What it calculates:
- Swing pivots with HH / HL / LH / LL classification (optional labels)
- CHoCH / BOS counter — "UP (C)", "UP (C+1)", "DOWN (C+2)" — showing phase maturity per timeframe
- Trend direction on D1 / H4 / H1 / M5 in one summary table
- ATR trailing stop with EMA basis and one-directional ratcheting
- Live ATR% with a dynamic percentile-based "normal range" window
- Distance to trailing stop in %
Key features:
- Auto Length by timeframe (SMC standard: M5 = 7, H1 = 15, H4 = 20, D1 = 30 …)
- Three breakout modes: Wick (early), Body (default), 2-Close (conservative)
- Auto ATR multiplier and EMA basis per timeframe — sourced from Raschke, Carter, Chandelier Exit, Minervini, Wilder and Weinstein school standards
- Multi-timeframe trend dashboard with CHoCH/BOS phase counter
- Dynamic ATR% range (percentile lookback) — instant read on whether volatility is normal, muted or hot
- Configurable trailing-stop history window (2 or 10 last ranges)
- Optional HH / HL / LH / LL swing labels
- Fully customizable up/down colors
- Built-in alerts: trend flip up, trend flip down, stop touch up, stop touch down
- Disabled on timeframes below 5M with an on-chart notice — the indicator is calibrated for 5M and above
Who it's for:
Traders who want a single, opinionated structure tool that reads the market the same way institutional and SMC playbooks do — with automatic parameters that respect every timeframe, a clean multi-TF dashboard, and a trailing stop built from real trading-school standards rather than arbitrary defaults. 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 PulseWire 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 PulseWire. 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:
PulseWire 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

EVA Ai + POC, Liquidity & Smart Money 1.4.1 EN💎 EVA Ai + POC, Liquidity & Smart Money 1.4.1 PRO EN — SEE WHERE THE MARKET ACCEPTED PRICE
Volume bars below a chart tell you when activity happened. EVA Volume Profile PRO shows where it happened.
The indicator maps traded volume across price, calculates POC and the Value Area, detects HVN/LVN structure, tracks directional volume and builds confirmed BSL/SSL liquidity pools. The result is a clean auction map for traders who use Volume Profile, Smart Money concepts, market structure and liquidity analysis — without flooding the candles with heavy color.
Use it for stocks, crypto and Forex, from scalping and intraday trading to swing analysis. AUTOPILOT adapts the lower timeframe, row density, node thresholds and liquidity-quality filters to the active chart.
This is a market-reading tool, not a LONG/SHORT signal generator. Its job is to show where value sits, where price may accelerate and where confirmed liquidity remains active before you build a trade plan.
━━━━━━━━━━━━━━━━━━━━
⚡ CORE MARKET MAP
• Volume Profile — horizontal volume distribution by price.
• POC — the price row with the highest calculated volume.
• Value Area — the price range containing the selected share of total volume; 70% is the standard target.
• VAH / VAL — upper and lower Value Area boundaries.
• HVN — high-volume acceptance nodes where price may slow, balance or retest.
• LVN — low-volume rejection corridors where price can travel quickly.
• Up / Down Volume — directional volume context classified from lower-timeframe candles.
• Delta — the difference between classified Up Volume and Down Volume across the profile.
• BSL / SSL — confirmed buy-side and sell-side liquidity pools around equal swing highs and lows.
• Liquidity Quality Q — a quality score using relative volume, rejection wick and spacing between confirmations.
• Nearest Targets — closest BSL, SSL, HVN and LVN with ATR distance and live state.
━━━━━━━━━━━━━━━━━━━━
🗺 HOW TO READ THE CHART
START WITH VALUE
Price between VAL and VAH is trading inside accepted value. This is usually a two-sided auction: POC attracts price, HVNs can hold rotation and the center of the profile often produces more noise than its edges.
Holding above VAH signals price discovery above value. Holding below VAL signals price discovery below value. A single breakout is not enough on its own — watch whether the boundary survives a retest and whether directional volume supports the move.
READ THE POC
The bright magenta POC marks the highest-volume price in the selected range. It acts as the profile’s center of gravity.
Price close to POC is usually balanced. Price far from POC may be building a new area of value or preparing a rotation back toward the old one. Context decides which path is active.
READ THE PROFILE SHAPE
Long horizontal rows represent heavier participation. Short rows show low acceptance.
The main histogram uses a restrained neutral palette. A thin neon rail at the profile anchor shows row-level direction: teal for Up Volume dominance, pink for Down Volume dominance. Stronger imbalance produces a brighter rail without recoloring the entire histogram.
HVN — ACCEPTANCE
Blue HVN zones mark local volume peaks. These are areas where the market previously agreed on price. Expect slower movement, consolidation, support/resistance behavior or repeated tests.
An HVN does not disappear after a touch. It represents completed volume structure, not uncollected stops.
LVN — REJECTION AND FAST TRAVEL
Amber LVN zones mark local volume valleys. Price spent less time there, so movement may accelerate through the corridor until it reaches the next HVN, Value Area boundary or active liquidity pool.
LVNs remain part of the calculated profile and update when the selected range changes.
BSL / SSL — CONFIRMED LIQUIDITY
BSL appears above confirmed equal swing highs, where short stops and breakout liquidity can cluster. SSL appears below confirmed equal swing lows, where long stops and sell-side liquidity may sit.
A pool requires at least two comparable confirmed pivots and must pass the adaptive Q filter. The script does not print every high and low as “liquidity.”
Liquidity states:
• FRESH — confirmed and not yet tested.
• TESTED — price entered the zone without completing the full sweep; the zone fades.
• OFF — still calculated but outside the active ATR work radius, so it is hidden from the chart.
• SWEPT — price cleared the far boundary; every drawing for that pool is deleted.
━━━━━━━━━━━━━━━━━━━━
📊 THE CALCULATED DASHBOARD
AUTOPILOT
Shows whether adaptive mode is active and which lower timeframe is selected.
AUCTION
Reports whether price is inside Value Area, above VAH or below VAL.
RANGE / SOURCE
Displays Visible Range, Session HD or Fixed Range and confirms whether calculations use chart candles or lower-timeframe data.
ROWS × STEP
Shows the actual number of profile rows and price increment. You always know the resolution behind the map.
UP / DOWN AND DELTA
Displays directional volume shares and the net profile imbalance.
POC / DIST
Shows POC and the current price distance from it.
NEAREST BSL / SSL
Shows pool price, distance in ATR, Q score and FRESH, TESTED or OFF state.
NEAREST HVN / LVN
Locates the closest acceptance node and fast-travel corridor.
STRUCTURE
Classifies the profile as upper concentration, lower concentration or balanced.
STATUS
Confirms developing mode, closed-bar mode or a safe data fallback.
━━━━━━━━━━━━━━━━━━━━
⚙️ THREE VOLUME PROFILE MODES
VISIBLE RANGE
Calculates only the candles currently visible on the screen. Zoom or scroll and the profile rebuilds around the market structure you are actually studying.
SESSION HD
Creates a separate profile for each selected trading session. Useful for intraday POC, daily Value Area, opening rotations and session-based support/resistance.
FIXED RANGE
Measures one specific impulse, consolidation, breakout leg or accumulation range between two adjustable time markers.
━━━━━━━━━━━━━━━━━━━━
🎯 PRACTICAL READING SCENARIOS
BALANCED AUCTION
Price is inside Value Area and close to POC or an HVN. The market is accepting price. Chasing the middle of the profile offers less structural clarity than waiting for a reaction at VAH, VAL or a nearby liquidity zone.
BULLISH PRICE DISCOVERY
Price holds above VAH, directional volume remains constructive and BSL is active overhead. The bullish auction remains valid while price accepts above value; a return below VAH weakens that read.
BEARISH PRICE DISCOVERY
Price holds below VAL, Down Volume expands and an SSL pool remains below. The bearish auction stays active until price regains the Value Area.
LVN TRAVEL
Price enters an LVN without opposing participation. The low-volume corridor may provide a faster route toward the next HVN, POC, VA boundary or liquidity target.
LIQUIDITY SWEEP
Price clears the far edge of BSL or SSL and the pool disappears. The next question is acceptance or rejection: check candle response, volume, Delta and location relative to VAH/VAL. A sweep alone does not guarantee reversal.
━━━━━━━━━━━━━━━━━━━━
🧠 AUTOPILOT, LOWER TIMEFRAME DATA AND INTEGRITY
AUTOPILOT adjusts lower-timeframe selection, row density, HVN/LVN thresholds, pivot sensitivity, pool width, minimum Q and the visible ATR radius. The developing profile updates as new confirmed microbars arrive.
Lower-timeframe OHLCV improves price allocation inside each chart candle. If the requested intrabar history is unavailable or incomplete, EVA falls back to the complete chart-candle sample rather than silently using a truncated profile.
The script uses the volume supplied by the active symbol’s data feed. On some markets, especially Forex, that may be tick volume. Pine Script cannot access a historical exchange order book or full bid/ask footprint, so EVA does not fabricate either one. The directional rail is an order-flow-style approximation derived from lower-timeframe candle direction.
Confirmed BSL/SSL pools are created from closed pivot events and are not backfilled onto earlier bars. Visible Range and developing profiles recalculate when the viewport or incoming data changes — expected behavior for a dynamic Volume Profile, not a historical trading signal being rewritten.
━━━━━━━━━━━━━━━━━━━━
⚠️ RISK NOTICE
EVA Volume Profile PRO is an analytical PulseWire indicator. It does not execute orders and is not financial advice. Markets involve risk. Every setup requires independent validation, position sizing and risk management.
━━━━━━━━━━━━━━━━━━━━
🔥 READY TO TURN THE LIQUIDITY MAP INTO A COMPLETE TRADE SCENARIO?
EVA AI Plus combines confirmed LONG/SHORT signals, Market Structure, Liquidity Sweeps, Smart Money context, Support/Resistance, Supply/Demand, Fair Value Gaps, Whale Volume, signal-quality filters, AI Advisor explanations, TP/SL, Trail, TP+ and internal statistics in one premium PulseWire workspace.
Open EVA AI Plus, add it to your favorites and request access to the 7-day test drive:
Indicator

Indicator

Inducement Sweep Strategy [algo_aakash]Inducement Sweep Strategy enters trades only after the classic ICT inducement sequence has fully played out: an external liquidity pool is identified, an internal swing (the inducement) forms in front of it, that inducement is swept with genuine displacement, and price then confirms a Market Structure Shift back in the real direction. Every qualifying setup is scored by the Inducement Quality Index (IQI), a 0-to-100 composite that ranks how convincing the engineered move actually was before an entry signal is ever shown.
Problem Statement
Most public inducement or "sweep and BOS" scripts fire a signal the instant any minor swing is tagged and broken. They do not distinguish between an inducement that formed in front of a meaningful liquidity pool with a violent, high-conviction reversal, and a shallow internal wiggle that happened to get tapped during normal noise. Traders end up manually filtering every alert, checking chart context by hand, which defeats the purpose of automating inducement detection in the first place. This script instead separates structure identification from signal display: the full pipeline runs on every bar, but only setups that pass the quality bar are shown as entries.
Methodology
Two pivot lengths run in parallel. A longer length confirms External Structure — the major swing highs and lows that represent the real liquidity pool the market is engineered toward. A shorter length confirms Internal Structure — the minor swings that sit closer to current price. When a confirmed internal low forms above the most recent confirmed external low (or, for shorts, an internal high forms below the most recent external high), that internal point is flagged as an Inducement Candidate: a level structurally positioned to attract retail stops in front of the real liquidity pool.
The candidate remains active until price wicks through it and closes back on the correct side with a reversal body at least a user-defined ATR multiple in size — this is the Sweep, and the ATR displacement requirement filters out shallow wicks that reflect noise rather than an engineered stop run. Once swept, the script watches for a Market Structure Shift: a close beyond the internal high or low that sat between the external level and the inducement. Only this break confirms the real directional move is underway, and only then does the entry logic activate.
Each confirmed setup is scored by the IQI engine across four factors — displacement strength, sweep freshness, liquidity depth, and rejection wick quality — combined into a single 0-to-100 score. An entry signal is only displayed on the chart when the score meets the user's configured minimum, so lower-quality setups are tracked internally but never clutter the chart or trigger alerts.
If price fails to sweep the inducement within a maximum bar window, breaks the external level before the sweep, fails to confirm the MSS within its own bar window, or fails an optional retest, the setup is invalidated and the pipeline resets automatically. All structure is derived from confirmed pivots only, so nothing in the detection logic repaints.
Signal Workflow
1. Confirm a major external swing high or low using the External Structure Length.
2. Confirm a minor internal swing forming on the inducing side of that external level — this becomes the active Inducement Candidate.
3. Wait for price to wick through the inducement level and close back on the correct side with a reversal body meeting the ATR displacement threshold — this is the Sweep.
4. Wait for a confirmed close beyond the internal high/low recorded between the external level and the inducement — this is the Market Structure Shift.
5. Calculate the Inducement Quality Index from displacement, freshness, depth, and rejection wick quality.
6. If Require Retest is enabled, wait for price to pull back and hold the broken MSS level before confirming.
7. Display the entry signal with its IQI score only if the score meets the configured minimum, and fire the corresponding alert.
Why This Indicator Is Different
Standard inducement or liquidity-sweep-plus-BOS scripts treat every sweep-and-break sequence identically, regardless of how convincing the move actually was.
The Inducement Quality Index is a composite score built specifically around the mechanics of an engineered inducement move rather than a generic volatility or volume filter — it weighs how fresh the sweep was relative to the inducement, how deep the underlying liquidity pool is in ATR terms, how strong the displacement candle was, and how decisively the sweep bar rejected its extreme.
Because setups below the quality threshold are still tracked internally and simply not displayed, the pipeline status label can show a user exactly where an unfolding setup stands without forcing premature signals onto the chart.
The optional retest requirement gives discretionary traders a way to demand confirmation of the broken structure as new support or resistance before treating the setup as valid, without changing the core detection logic.
Inputs
Structure Settings
External Structure Length — pivot length confirming the major swing that anchors the real liquidity pool
Internal Structure Length — pivot length confirming the minor swing used as the inducement candidate
Inducement Settings
Max Bars to Sweep — maximum age allowed for an inducement candidate before it is discarded as stale
Max Bars to Confirm MSS — maximum age allowed between the sweep and the structure shift confirmation
Displacement Filter
ATR Length — period for the ATR used in the displacement requirement
Min Displacement (x ATR) — minimum reversal candle body, as an ATR multiple, required to validate a sweep
Signal Quality
Minimum IQI to Show Signal — setups scoring below this 0-100 threshold are tracked but not displayed
Entry Options
Require Retest Before Entry — waits for a pullback that holds the broken MSS level before confirming the signal
Trade Levels
Show Entry / Stop / Target Lines — visual-only projected levels, not a managed strategy
Reward : Risk Ratio — target distance as a multiple of the stop distance
Level Projection Length — how far right the projected lines extend
Visual Settings
Show Inducement Level, Show Sweep Marker, Show MSS Break Line, Show Pipeline Status Label
Bullish / Bearish / Inducement / MSS / Sweep Marker colors
Alert Settings
Alert: Inducement Identified, Alert: Inducement Swept, Alert: Entry Signal, Alert: Setup Invalidated
Alerts
Alerts are available for:
Bullish Inducement Identified
Bearish Inducement Identified
Bullish Inducement Swept
Bearish Inducement Swept
Long Entry Signal (with IQI score, entry, and stop level)
Short Entry Signal (with IQI score, entry, and stop level)
Setup Invalidated (bullish and bearish, optional)
Practical Usage
Raise the Minimum IQI threshold on lower timeframes or noisy instruments to surface only the most convincing engineered moves.
Enable Require Retest for a more conservative entry style that waits for the broken structure to hold before committing.
Use the pipeline status label to monitor an unfolding setup in real time without needing a signal to already have fired.
The projected trade levels are a visual reference only — position sizing and trade management remain the trader's responsibility.
Combine with a higher timeframe bias tool to only act on Inducement Sweep signals that align with the broader directional context.
Limitations
Structure confirmation requires the full pivot look-right period to elapse before a swing is confirmed, so entries occur after price has already moved past the exact reversal point. This is standard confirmed-pivot behavior and is not repainting.
The IQI score is a relative ranking based on the four factors described above and does not guarantee trade outcomes. It should be used as a filtering aid, not a standalone trading signal.
The displacement filter is ATR-relative; on instruments with unusually low volatility, the ATR multiple may need to be reduced to detect qualifying sweeps.
The indicator does not manage open positions, calculate position size, or provide exits beyond the single visual target line. It identifies potential inducement-based entries only.
Notes
All structure levels and signals are drawn at the bar index of the actual pivot or event, not the confirmation bar, ensuring accurate visual placement.
The state machine for bullish and bearish setups runs independently and concurrently, so both directions can be tracked at the same time on ranging instruments.
For best results combine with Market Structure Break BOS/CHoCH Tracker to cross-check the higher timeframe structural context before acting on a signal.
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 PulseWire 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 PulseWire 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 PulseWire 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 PulseWire 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 PulseWire 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 Structure + Swing Levels [AFD]Market Structure + Swing Levels organizes confirmed swing highs and
swing lows into configurable price Zones. Its default ATR mode sizes each
individual Zone from volatility at the Swing origin Bar; Tick, Point, and
Currency modes provide fixed-distance alternatives. It then describes
confirmed continuation Breaks, direction-changing Shifts, and the initial
direction assignment without trade instructions or predictive claims.
## Publication and license
- Publication type: Open-source.
- Pine version: 6.
- License: Mozilla Public License 2.0 (MPL 2.0).
- The open-source publication setting, this description, and the MPL 2.0
notice in the Pine source header must remain aligned.
The source is available for inspection and modification under MPL 2.0. This
summary identifies the applicable license; the notice in the Pine source
header remains the authoritative license reference.
## Capabilities
- Confirms Swing Highs and Swing Lows using the same selected strength on both
sides of the candidate Bar.
- Shows classifications by default: `H`, `HH`, `EH`, and `LH` for highs, and
`L`, `HL`, `EL`, and `LL` for lows.
- Builds ATR-, Tick-, Point-, or Currency-width Zones around confirmed Swings.
- Merges transitively overlapping same-side Zones into exact-union clusters.
- Evaluates Structure on confirmed Bars using selectable Close or Body
clearance.
- Lets Zone breaks use that Structure rule or an inclusive High/Low Touch of
the far edge.
- Retains broken Zones by default with configurable memory and color.
- Reports current direction, latest Structure event, active Zones, and
nearest-Zone distance in the Dashboard.
- Provides four fixed Structure alert conditions plus an optional combined
dynamic alert that can include Zone breaks.
## How to use it
1. Select a Preset Profile or choose Custom and set Swing Strength. The default
Swing profile uses a strength of 7 Bars on each side.
2. Choose the Zone Width Mode and width appropriate for the chart.
3. Choose how Structure confirms a clearance. Close is the default; Body
requires both the Open and Close to clear the reference.
4. Zone Break Basis follows the Structure rule by default. Touch (High/Low)
instead breaks a Zone when the wick reaches or passes its far edge.
5. Swing High and Swing Low Zone labels start at the oldest Swing Origin
represented by each Zone. Select Right Edge when current-Bar alignment is
preferred.
6. Swing High and Swing Low text have separate color controls. Both default to
white and also color the matching Swing classification labels. Zone Age,
Break, Shift, and Dashboard text also start white.
7. The Dashboard starts with all five rows visible. Disable nearest-Zone
distance when only Direction, Last Event, and Zone counts are needed.
8. Show Broken Zones starts on with a 20-Bar memory. Turn it off for an
active-Zones-only chart.
9. Zone Age starts off. When enabled, its unit starts in Days.
## How to interpret Zone cluster counts
The `×N` suffix is a cluster membership count. `Swing High ×3` means three
confirmed Swing High Zones are represented by that merged cluster.
It does not mean price tested one exact price three times. Zones merge when
their price bands overlap or meet at an edge. Merging is transitive, so one
connected Zone can bridge two other Zones even when those outer Zones do not
directly overlap each other. The displayed cluster preserves the full union of
those connected bands, and `×N` reports how many confirmed Swing Zones
contributed to it.
## Broken Zones
Show Broken Zones is the explicit on/off control:
- On by default — the Zone freezes at its break-confirmation Bar, changes to
Broken Zone Color, and remains visible for the selected Broken Zone Memory.
- Off — a Zone is deleted as soon as it breaks.
- Up to 20 broken Zones are retained. If more accumulate before their memory
expires, the oldest retained Zone is removed first.
This display choice does not change how Zone breaks are detected and does not
change alert behavior.
## Limitations and evidence
- Swings require the selected number of Bars on both sides, so confirmation
occurs after the origin Bar.
- ATR Zone width uses volatility from the Swing origin Bar.
- Currency-width mode creates no Zone when the symbol does not provide a valid
Point Value.
- Active Zones are capped at 40 per side. When the cap is reached, the oldest
active Zone on that side is removed first.
- Hours and Days shown for Zone Age are timeframe-based approximations and do
not correct for session gaps.
- Cluster membership describes connected Zone bands, not repeated reactions at
one exact price.
- Repository checks pass for the working source. PulseWire compilation and
runtime verification of the latest working source have not yet been
recorded.
- This indicator is educational chart context and does not provide trade
instructions. 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 抛物线或均线系统)进行二次印证。
慎用于高度控盘的“庄股”或低成交量仙股 :稀疏的成交导致价格跳跃性极大,计算出的区间极易失真。
---
本指标严格遵循 PulseWire 最佳实践, 完全不包含未来函数 ,所有信号均基于确定性的历史数据实时滚动计算。
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 PulseWire 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

Judas Swing Detector [algo_aakash]Judas Swing Detector is a session-based reversal indicator that models the institutional Judas Swing as a complete, sequential price event rather than a single false-breakout candle. Instead of flagging every session-open wick that reverses, the script requires a full chain of confirmed conditions — a locked Initial Range, a liquidity sweep beyond it, a rejection close back inside, an optional market structure shift, institutional-grade displacement, and higher-timeframe trend agreement — before a signal is ever scored, drawn, or alerted.
Problem Statement
A Judas Swing is commonly described as "price sweeps one side of the session open and reverses," but that description alone matches an enormous number of ordinary, low-quality wicks. Scripts that flag every such wick generate far more noise than usable signal, because a sweep and a close-back-inside is only the first half of the institutional sequence — it says nothing about whether the reversal has real structural or momentum support, or whether it agrees with the underlying daily trend.
This indicator addresses that gap by treating the Judas Swing as a seven-stage sequence and only surfacing a signal once every enabled stage has been satisfied on confirmed price data, with the overall setup then ranked by a disclosed, weighted confidence score.
Methodology
A session window (London Open, New York Open, or a fully custom session and timezone) drives an Initial Range engine that locks the session's high and low once a configurable opening window (5, 10, 15 or 30 minutes) elapses. The Initial Range is drawn as a transparent box and extends for the remainder of the session.
Once the Initial Range is locked, the script watches for a liquidity sweep: a wick that pierces beyond the Initial Range high or low by at least a minimum ATR-based distance, with the same candle closing back inside the range. This closing-back-inside requirement is what separates a genuine sweep-and-reject from an ordinary breakout continuation.
A confirmed sweep becomes a pending candidate. If Market Structure Confirmation is enabled, the candidate must be followed by a genuine structure shift measured against minor swing pivots that form strictly after the sweep bar: a higher high following a low-side sweep, or a lower low following a high-side sweep. Candidates that do not produce this structure shift within a configurable bar timeout are discarded with no signal created.
A qualifying candidate is then subjected to a Displacement Filter, requiring the confirming candle's body to reach a minimum ATR multiple, and an optional Higher Timeframe Bias check, requiring a fast/slow EMA relationship on a user-selected higher timeframe (e.g. 1H, 4H, Daily) to agree with the reversal direction. Only after every enabled stage passes does the script compute the Judas Confidence Filter score.
The Judas Confidence Filter combines five independently disclosed, user-weighted factors into a single 0-100 score: sweep depth (how far price pierced beyond the Initial Range in ATR units), displacement (the confirming candle's body size in ATR units), HTF agreement (the normalized separation between the fast and slow higher-timeframe EMA, reflecting how decisively the higher-timeframe trend supports the direction), rejection quality (where the sweep candle closed within its own range), and reversal aggression (how few bars elapsed between the sweep and structure confirmation). Weights are user-adjustable and auto-normalized. A signal is only plotted and only triggers alerts if its score meets the Minimum Confidence Score threshold — this is a genuine filtering mechanism that changes what is drawn, not a cosmetic label applied afterward.
Confirmed signals optionally draw an Entry Zone between the 50% and 62% retracement of the confirming displacement candle, reflecting where institutional-style retracement entries are commonly sought after a confirmed reversal, along with a stop-reference line at the sweep extreme. Both extend forward and are visually dimmed once price closes back through the sweep extreme, marking the setup invalidated.
Signal Workflow
Step 1 — the selected session opens and the Initial Range begins building from the session's first 5-30 minutes of price action.
Step 2 — the Initial Range locks; the script now watches for a liquidity sweep beyond either side of that locked range.
Step 3 — a wick pierces beyond the range by a minimum ATR distance and the same candle closes back inside, registering a pending sweep candidate.
Step 4 — if enabled, the candidate must be followed by a market structure shift measured against post-sweep swing pivots, within a bounded bar timeout.
Step 5 — the confirming candle must clear the ATR-based displacement threshold, and if enabled, the higher-timeframe EMA bias must agree with the reversal direction.
Step 6 — the completed sequence is scored by the Judas Confidence Filter across five weighted factors; only scores at or above the minimum threshold are plotted and alerted.
Step 7 — an optional 50%-62% entry zone and stop-reference line are drawn from the confirming candle and remain active until price closes back through the original sweep extreme.
Why This Indicator Is Different
Most public "Judas Swing" or session-sweep scripts fire on the sweep-and-close-back-inside event alone, with no structural or momentum confirmation and no higher-timeframe context.
This script models the full institutional sequence explicitly — session, Initial Range, sweep, rejection, structure shift, displacement, HTF agreement — and only creates a signal after every enabled stage resolves in order on confirmed bar closes.
The Judas Confidence Filter converts five independently disclosed factors, including reversal aggression measured in bars-to-confirmation and rejection quality measured from close position within the sweep candle's own range, into a single adjustable score rather than a binary flag.
Confidence weighting is fully exposed, letting the ranking be tuned toward sweep depth, displacement strength, higher-timeframe agreement, rejection quality, or reversal speed depending on the trader's approach.
The optional 50%-62% Entry Zone models a specific, disclosed institutional retracement convention rather than simply marking the signal bar.
Inputs
Session Engine
Session (London Open / New York Open / Custom)
Custom Session Window
Session Timezone
Initial Range
Initial Range Duration (5/10/15/30 minutes)
Show Initial Range Box
Liquidity Sweep Detection
Minimum Sweep Pierce (x ATR)
Market Structure Confirmation
Require MSS Confirmation
MSS Pivot Length
MSS Timeout (bars)
Displacement Filter
Displacement Threshold (x ATR)
ATR Length
Higher Timeframe Bias
Require HTF Bias Agreement
HTF Timeframe
HTF Fast/Slow EMA Length
Judas Confidence Filter
Minimum Confidence Score
High-Confidence Threshold
Advanced weight sliders for sweep depth, displacement, HTF agreement, rejection quality, and reversal aggression
Entry Zone
Show Entry Zone (50%-62% Retracement)
Entry Zone Extension (bars)
Visual Settings
Show Sweep Markers / Confirmation Arrows / Stop Marker
Label Size
Bullish/Bearish/Initial Range/Elite Score Colors
Status Panel
Show Status Panel
Panel Position
Alerts
Alerts are available for:
Session Started
Liquidity Sweep detected
Bullish Judas Swing confirmed
Bearish Judas Swing confirmed
High-Confidence Judas Swing (Elite grade)
Higher-Timeframe Bias Change
Entry Zone Reached
Practical Usage
Use the status panel's HTF Bias reading as directional context before evaluating an individual Judas signal.
Treat a High-Confidence (Elite) signal as a materially stronger setup than one that merely clears the minimum threshold, since it reflects agreement across all five scored factors rather than a narrow pass.
Raise the Minimum Confidence Score on lower timeframes or noisy instruments to reduce the number of marginal signals generated.
Disable Require MSS Confirmation only if you specifically want to evaluate the sweep-and-rejection event on its own, understanding this removes one of the seven confirming stages.
Combine the alert feed with a broader trade plan, since each alert marks a structural event, not an execution signal.
Limitations
The Initial Range and session logic depend on the chart's intrabar data matching the selected session window; behavior on markets with irregular or 24-hour sessions may differ from traditional FX/futures sessions.
Market structure confirmation depends on minor swing pivots, which require bars to form on both sides before they confirm, introducing an inherent, bounded delay.
Confidence scoring is a relative, disclosed ranking and does not predict the outcome of any individual signal.
The higher-timeframe bias is read via a standard non-repainting security call and reflects EMA relationship only; it is not an independent trend-strength model.
As with any structure-based tool, results will vary across instruments, timeframes, and market regimes.
Notes
This indicator is a session and structure analysis tool intended to organize and score the Judas Swing sequence through a disclosed, multi-stage validation process.
All session state, sweep detection, structure confirmation, displacement, and scoring are evaluated on confirmed bar closes only, so no element of the script repaints once drawn.
The output is intended to support structural analysis and is not a standalone buy or sell recommendation.
Indicator

Market Structure MTF Dashboard v6.3 [SMC]Tired of cluttering your charts with manual lines, missing high-probability setups, and getting trapped by low-volume fakeouts?
Market Structure MTF Dashboard v6.3 is a institutional-grade analytical engine engineered for traders utilizing Smart Money Concepts (SMC) and Price Action. This script completely automates your technical analysis by scanning market structure, validating breaks with raw volume metrics, tracking institutional liquidity sweeps, and filtering micro-noise—all condensed into a beautiful, ultra-compact graphical dashboard.
Whether you trade Crypto, Forex, or Indices, this tool does the heavy lifting in the background, shifting your focus from tedious chart drawing to executing razor-sharp setups.
🛠️ Core Engine Features & Built-in Logic
1. High-Precision Swing & BOS Engine
Dynamic Pivot Detection: Automatically maps swing structure using adjustable left/right structural wings (leftBars / rightBars).
True Break of Structure (BOS): Choose between conservative body-close confirmation (breakByClose) or aggressive wick breaches.
RVOL Filtering: Eliminates low-liquidity fakeouts. A structure break is only considered validated if the breakout candle is backed by expansion volume exceeding the 20 SMA.
2. Smart Money Footprints: Sweeps & FVGs
Liquidity Sweep Tracking: Detects false breakouts at key major highs/lows. If the price spikes past an old extreme but closes back inside the range, the engine instantly highlights a liquidity grab—one of the most powerful reversal signals in trading.
Adaptive Fair Value Gaps (FVG): Tracks institutional inefficiencies. FVGs are dynamically filtered based on a minimum percentage size of the asset price (fvg_min_size) to avoid noise, and they remain live until fully mitigated (tested) by price action.
3. Multi-Timeframe (MTF) Context & Premium/Discount Matrix
HTF Core Scanning: Fetches 4-Hour and Daily structural trends directly in the background.
Equilibrium 0.5 Line: Plots the crucial midline of the 4H trading range.
Value Assessment: Instantly updates whether price is inside the Premium Zone (expensive — look for Shorts) or Discount Zone (cheap — look for Longs) relative to the HTF range.
4. Next-Gen Smart UI (Dashboard Layout)
Real-time Context Trigger (Top Row): Shows active Fibonacci expansion targets (T1 / T2) with exact real-time prices, live unmitigated FVG levels, or flashing institutional confirmations (⚡ SWEEP L / SWEEP H).
Market Sentiment Histogram: A clean visual matrix (🟩/🟥) aggregating multi-timeframe weights to score total buyer vs. seller control.
Chronological Session Tracker: Fully optimized single-row display.
Left tile: Color-coded active session (Asia, London, NY) or overlaps (e.g., LON+NY).
Right tile: Displays the exact local opening time of the upcoming session based on your custom tzOffset. No confusing countdowns—you know exactly when volatility is hitting the clock.
📘 How to Trade It: Official Rules (Trading Rules)
This script is designed to act as an educational market assistant, providing pure mechanical logic and potential structural entry points rather than blind commercial trading signals. For maximum probability, follow these two systematic setups:
🟩 The Institutional Long Setup
HTF Trend Alignment: The 4H matrix block must be green (Bullish structure).
Premium/Discount Context: Current price must be trading in the Discount Zone (below the yellow dashed Equilibrium line).
The Trigger: The dashboard prints a flashing ⚡ SWEEP L: CONFIRMED LONG signal, showing that retail sell-stops were hunted and price recovered.
Targets: Take profit at T1 / T2 prices printed on the dashboard, with the ultimate target being the high of the 4H range.
🟥 The Institutional Short Setup
HTF Trend Alignment: The 4H matrix block must be red (Bearish structure).
Premium/Discount Context: Current price must be trading in the Premium Zone (above the yellow dashed Equilibrium line).
The Trigger: The dashboard prints a flashing ⚡ SWEEP H: CONFIRMED SHORT signal, showing that retail buy-stops were grabbed before a sudden drop.
Targets: Take profit at T1 / T2 short target prices, aiming down toward the low of the 4H range.
📅 Smart Weekend Protection Filter
No more distorted charts or broken session calculations during illiquid market closures.
Forex & Indices: The session tracker automatically freezes on Saturdays and Sundays, displaying a clean ⏸️ WEEKEND status tile.
Crypto Markets: The filter automatically detects asset types, bypassing the weekend pause to ensure continuous 24/7/365 live session mapping.
Disclaimer: Past performance is not indicative of future results. Use proper risk management and treat this tool as a systematic structural assistant to streamline your confluence. Indicator

Breaker Block Identifier [algo_aakash]Breaker Block Identifier is a market structure indicator that converts failed order block retests into scored, non-repainting breaker zones. Rather than flagging every order block that gets invalidated, the script requires a complete sequence of confirmed price events — order block formation, an opposing structure break, a retracement into the invalidated zone, and a failed retest of that zone — before a breaker is created, and then ranks the result with a transparent quality score.
Problem Statement
Order blocks are frequently invalidated by a structure break and later retested, but a retest failing to continue in the original direction is not automatically a tradable breaker block. Many public scripts draw a zone as soon as an order block is broken, without verifying that the subsequent retest actually failed, how deep that retest penetrated, or how convincingly price rejected the zone. This produces a high volume of low-quality zones that require manual filtering by the trader.
This indicator addresses that gap by treating breaker formation as a multi-stage state machine rather than a single condition, and by scoring every candidate that completes the sequence so weak retests can be filtered out programmatically instead of visually.
Methodology
Swing highs and lows are identified with ta.pivothigh/ta.pivotlow using a user-defined bar count on each side, so every structural level referenced by the script is a confirmed pivot, never a forming one.
An order block source candle is located as the last opposite-colored candle at or immediately before each confirmed swing pivot, within a fixed lookback. The candle must exceed a minimum size expressed as a multiple of ATR, and can optionally be required to close on above-average volume. Zone boundaries can be set to the candle body (open/close) or the full wick range (high/low).
Every order block candidate then moves through three internal states. In the Pending state the script waits for an opposing structure break (a close beyond the relevant swing high or low, optionally required to clear the level by a minimum ATR multiple). Once that break occurs the candidate becomes Flipped, and the script waits for price to retrace back into the now-invalidated zone. On entry into the zone the candidate becomes Retesting, and the script tracks the deepest penetration price reaches inside the zone on a bar-by-bar basis.
A Retesting candidate resolves in one of two ways. If price closes back through the zone in its original direction by the confirmation displacement threshold, the retest is judged to have held and the candidate is discarded with no breaker created. If price instead closes through the opposite edge of the zone by the same displacement threshold, and the tracked penetration depth met a minimum percentage of the zone's height (the Retest Qualification Filter), the retest is judged to have failed and the order block is converted into a breaker in the opposite direction of its original bias.
Each confirmed breaker is then scored from 0 to 100 using six independent, user-weighted factors: the displacement strength of the invalidating structure break, the ATR-relative size of the original order block candle, how closely the retest penetration matched a user-defined ideal depth (scored on a curve, so both shallow touches and near-total breaches score lower than a clean mid-zone tag), the wick-rejection ratio of the confirming candle, how quickly the retest resolved relative to the retest window, and the ATR-normalized distance price traveled before returning to retest. The six sub-scores are combined using auto-normalized weights, so a breaker only appears on the chart, gets drawn, and triggers alerts if it clears the configured minimum quality threshold.
Confirmed breakers remain in an Active/Touched state until price closes through the far edge of the zone by the invalidation displacement threshold, at which point the zone is marked invalidated, visually dimmed, and removed after a configurable linger period. A hard maximum-age limit and a per-direction cap on active zone count prevent unbounded object growth.
Signal Workflow
Step 1 — a confirmed swing pivot forms and an order block candidate is registered from the qualifying source candle behind it.
Step 2 — the candidate waits in a Pending state until an opposing structure break (BOS/CHoCH) closes beyond the originating swing level.
Step 3 — once flipped, the candidate waits for price to re-enter the invalidated zone, entering the Retesting state and tracking maximum penetration depth.
Step 4 — the retest resolves: a displacement close back through the zone in the original direction discards the candidate, while a displacement close through the opposite edge with sufficient penetration confirms a breaker.
Step 5 — the confirmed breaker is scored across six weighted factors and only drawn, labeled, and alerted on if it meets the minimum quality threshold.
Step 6 — the active breaker zone extends forward until price closes through its far edge by the invalidation displacement threshold, at which point it dims and is scheduled for removal.
Why This Indicator Is Different
Most public order block or breaker scripts draw a zone the moment an order block is invalidated by a structure break, without separately validating whether the ensuing retest actually failed.
This script models breaker formation as an explicit four-state pipeline (source candle, pending, flipped, retesting) and only creates a zone after the retest resolves against its original direction with a minimum measured penetration depth.
The Breaker Quality Score converts six independently disclosed factors, including retest penetration depth scored on a curve around a configurable ideal value rather than a simple threshold, into a single adjustable ranking rather than a cosmetic label.
Quality-score weighting is fully exposed, allowing the ranking to be tuned toward structure strength, retest precision, wick rejection, confirmation speed, or impulse distance depending on the trader's approach.
Zone fill transparency scales with the quality score, so higher-ranked breakers render more opaque and lower-ranked ones fade into the background without adding separate visual elements.
An optional formation preview renders the retest phase of a candidate before it resolves, giving visibility into why a breaker did or did not form without permanently cluttering the chart.
Inputs
Structure Settings
Swing Pivot Length
Displacement Filter on Structure Break
Structure Break Displacement (x ATR)
ATR Length
Order Block Detection
Use Candle Body for Zone Boundaries
Min Order Block Size (x ATR)
Candidate Expiry (bars)
Volume Confirmation Filter
Volume MA Length
Volume Multiplier Threshold
Breaker Conversion Rules
Retest Window (bars)
Confirmation Displacement (x ATR)
Min Retest Penetration (%)
Quality Score
Filter Breakers by Quality Score
Minimum Quality Score
Ideal Retest Penetration Ratio
Advanced weight sliders for structure break strength, impulse size, retest precision, wick rejection, confirmation speed, and distance traveled
Visual Settings
Bullish/Bearish Breaker Colors
Min/Max Fill Transparency
Show Zone Midline
Show Quality Label
Label Size
Formation Preview toggle and color
Lifecycle & Cleanup
Max Active Breakers (per side)
Invalidation Displacement (x ATR)
Invalidated Linger (bars)
Max Breaker Age (bars)
Info Panel
Show Info Panel
Panel Position
Alerts
Alerts are available for:
Bullish Breaker Block formed
Bearish Breaker Block formed
Structure confirmation on breaker conversion
Price entering an active breaker zone
Breaker invalidated
Practical Usage
Use the info panel's structure bias reading as directional context before evaluating individual breaker zones.
Treat a fresh, high-quality breaker aligned with the prevailing structure bias as a potential continuation zone rather than a standalone entry signal.
Raise the minimum quality threshold on lower timeframes or noisy instruments to reduce the number of marginal zones drawn.
Use the retest penetration and displacement settings together to control how strict the failed-retest qualification is for your instrument and timeframe.
Combine the alert feed with a broader trade plan, since each alert marks a structural event, not an execution signal.
Limitations
Swing pivots require bars to form on both sides before they confirm, so structure breaks and order block placement are inherently delayed by the swing pivot length.
The order block source candle is located within a fixed lookback behind each pivot; if no qualifying candle exists in that window, no candidate is created for that pivot.
Quality scoring is a relative ranking based on disclosed, adjustable factors and does not predict the outcome of any individual breaker zone.
Volume-based filtering depends on the data provider's reported volume and may behave inconsistently on instruments with limited or unreliable volume data.
As with any structure-based tool, results will vary across instruments, timeframes, and market regimes.
Notes
This indicator is a market structure analysis tool intended to organize and rank breaker block formation through a disclosed, multi-stage validation process.
All structure breaks, state transitions, breaker confirmations, and invalidations are evaluated on confirmed bar closes only, so no element of the script repaints once drawn.
The output is intended to support structural analysis and is not a standalone buy or sell recommendation.
Indicator

Change of Character (CHoCH) Alert System [algo_aakash]Change of Character (CHoCH) Alert System is a market structure signal tool focused on a single event: a confirmed shift in directional bias. Rather than labeling every Break of Structure and CHoCH the way many public structure scripts do, this indicator deliberately ignores continuation breaks and limits both the chart and the alert feed to the moments where the prevailing character of the market actually flips.
Problem Statement
Most public CHoCH implementations classify a character change purely on the direction of a swing break, with no measure of how convincing that break actually was. This creates two practical issues for anyone building alerts around structure. Every minor swing wobble can trigger a notification, producing alert fatigue, and there is no way to separate a decisive character change from one that barely closed beyond the swing level. This script addresses both issues with a close-confirmed CHoCH-only detection engine and a built-in confidence grading step applied to every signal.
Methodology
The script maintains a single structure register holding the most recent confirmed swing high and swing low, located with standard pivot detection over a user-defined pivot length. When the adaptive swing filter is enabled, a newly confirmed pivot only replaces the stored swing if its distance from the last opposite-type pivot exceeds a configurable ATR-relative threshold, which keeps insignificant micro-swings out of the structure register before they can influence a signal.
A Change of Character is only evaluated on a confirmed candle close, so nothing in the detection logic repaints once a signal has printed. A bullish CHoCH requires a close above the last swing high while the tracked bias is bearish or undefined. A bearish CHoCH requires a close below the last swing low while the tracked bias is bullish or undefined. A break that occurs while the bias already agrees with the break direction is treated as ordinary continuation and is not flagged.
Two optional filters gate confirmation further. A displacement filter requires the breaking close to clear the swing level by a minimum ATR multiple, removing marginal breaks. A momentum filter requires the breakout candle's body to represent a minimum percentage of its total range, removing breaks driven mostly by wick with little real conviction behind the close.
Once a CHoCH is confirmed, the broken swing level is projected forward on the chart as an active structure line. If a later confirmed close moves back through that level, the structure is marked invalidated and the projection line is dimmed, separately from the detection of any new CHoCH.
Signal Workflow
Track the most recent confirmed swing high and swing low using pivot detection.
Apply the adaptive swing filter to reject pivots too close to the last opposite-type pivot.
On each confirmed candle close, test for a close beyond the stored swing level against the current bias.
Apply the displacement filter to confirm the close cleared the level by a minimum ATR multiple.
Apply the momentum filter to confirm the breakout candle's body-to-range ratio meets the minimum threshold.
Score the confirmed breakout candle on displacement in ATR units and body-to-range ratio to produce a Weak, Moderate, or Strong confidence grade.
Flip the tracked bias, plot the CHoCH label with its grade, and project the broken level forward as an active structure line.
Continue monitoring the active structure line and mark it invalidated if a later confirmed close moves back through it.
Why This Indicator Is Different
Many structure tools plot every Break of Structure alongside every CHoCH, leaving the trader to filter out which events represent an actual change in character.
This script omits BOS events entirely and reports only confirmed CHoCH signals, which are the events that correspond to a bias flip.
Each confirmed CHoCH is scored using two independent factors measured on the breakout candle itself, its ATR-normalized displacement past the level and its body-to-range ratio, rather than being treated as a single undifferentiated event.
The confidence grade is written into the alert message text at the moment the event fires, which requires composing the message dynamically rather than relying on a fixed template.
The swing level broken by a CHoCH remains tracked after the signal fires, so a later close back through that level produces a distinct invalidation alert rather than silently vanishing into the next structure calculation.
Detection is restricted to confirmed candle closes throughout, so the bias, the grade, and the invalidation state cannot change intrabar once printed.
Inputs
Structure Engine
Swing Pivot Length
Adaptive Swing Filter
Filter Threshold (ATR multiple)
Break Confirmation
Displacement Filter
Displacement Multiplier
Momentum Filter
Minimum Body % of Range
ATR Length
Visual Settings
Show Swing Points
Show Structure Projection
Projection Extension
Show Trend Background Wash
Color Candles After CHoCH
Show Confidence Grade
Label Size
Bullish, Bearish, and Projection colors
Status Panel
Show Status Panel
Panel Position
Alerts
Alert: Bullish CHoCH
Alert: Bearish CHoCH
Alert: Bullish Structure Invalidated
Alert: Bearish Structure Invalidated
Alerts
Alerts are available for:
Bullish CHoCH confirmed on a closed candle, with the confidence grade included in the alert message
Bearish CHoCH confirmed on a closed candle, with the confidence grade included in the alert message
Bullish structure invalidated after a confirmed close back below an active bullish level
Bearish structure invalidated after a confirmed close back above an active bearish level
Practical Usage
Use a shorter pivot length on intraday charts to react to structure earlier, combined with the displacement and momentum filters to avoid marginal breaks.
Use a longer pivot length on higher timeframes to isolate structurally significant character changes only.
Treat a Strong-grade CHoCH as a higher-conviction event than a Weak-grade CHoCH when weighing entry timing or position sizing.
Watch for a structure invalidated alert shortly after a CHoCH, since it indicates price has returned through the level that produced the signal.
Use the status panel as a quick reference for the current bias and the most recent CHoCH grade without needing to scan the chart for labels.
Limitations
Swing highs and lows depend on confirmed pivots, which require the full pivot length of bars to close on both sides before becoming available, introducing a disclosed confirmation lag.
The displacement and momentum filters reduce signal frequency by design, which means fewer but more selective CHoCH events compared to unfiltered structure break detection.
Structure invalidation reflects a return through a previously broken level and does not attempt to forecast subsequent price direction.
This indicator identifies structural events only and does not constitute financial advice or a complete trading system on its own.
Notes
All structural state, including the tracked bias, the active levels, and the confidence grade, is evaluated only on a confirmed candle close, so nothing in this script repaints once printed.
The only lag in the system is the standard pivot confirmation lag inherent to pivot-based swing detection, which is disclosed above rather than hidden.
Designed for dark theme charts. On light themes, consider darkening the projection line color for improved contrast.
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 PulseWire 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

Market Structure + CHoCH/MSS/BOS | Xcelerate TradeMarket Structure + CHoCH / MSS / BOS | Xcelerate Trade
A precise market-structure mapper from the Xcelerate Trade team. It auto-detects swing highs / lows, classifies every break of structure as CHoCH (Change of Character), MSS (Market Structure Shift) or BOS (Break of Structure), and labels each pivot as HH / HL / LH / LL. Designed for SMC and price-action traders who want a clean, repaint-aware structural read of the chart.
What you get on the chart
Swing labels: HH (Higher High), HL (Higher Low), LH (Lower High), LL (Lower Low) — auto-placed on every detected pivot.
Break lines: every confirmed break is drawn as a horizontal segment from the swing bar to the breaking bar.
Break tags: each break line gets a label — CHoCH, MSS or BOS — so you can read structure at a glance.
Info table (top-right): current settings (Auto / Manual, TF, L/R, detection method, MSS definition, break validation) and an optional debug panel with trend state, flags, pre-CHoCH levels, last-break details.
Pattern alerts: ready-to-use alertcondition for HH-HL-HH and LL-LH-LL sequences.
Pivot detection — two modes
Williams Fractals (default): classic ta.pivothigh / ta.pivotlow with separate left and right lengths. Configurable in Manual Settings (defaults L = 6, R = 4) or selected automatically per timeframe via Auto Timeframe Settings:
Timeframe L / R
1m
4 / 4
5m
4 / 3
15m
5 / 4
30m+, daily, weekly, monthly
6 / 4
Simple Fractals: SMC-style, symmetric — current bar is a pivot if it's the highest / lowest within simpleFractalPeriod bars on each side. Faster but more frequent than Williams.
You can also force Wait for bar close (default ON) to confirm pivots only on closed bars.
Break validation — 4 modes
Choose how a level is considered "broken":
Close — close beyond the swing level (cleanest, default).
High/Low (wick) — wick beyond the level (most aggressive).
Close beyond buffer (ticks) — close beyond level ± N × mintick.
Close beyond buffer (%) — close beyond level ± X%.
Buffer fields appear conditionally so you can tune the strictness of structure breaks per instrument (forex, indices, crypto, etc.).
Structure classification — CHoCH / MSS / BOS
Trend state is tracked internally (Bullish, Bearish, Neutral). Every confirmed break is then classified:
CHoCH — first break that reverses the trend (bullish CHoCH on a close above the last swing high while bearish; bearish CHoCH on a close below the last swing low while bullish), or the very first break when the trend is still neutral. CHoCH flips the trend and starts a fresh leg.
MSS — first qualifying break in the direction of the new trend after CHoCH, per the MSS definition setting:
First break after CHoCH — any first break in trend direction = MSS, then BOS.
First break >= pre-CHoCH level — MSS only when the broken swing is at or beyond the swing level that existed before the CHoCH. Stricter — protects against premature MSS calls.
HL + >= pre-CHoCH (legacy) — same as above, plus a confirming HL (bull) / LH (bear) is required after CHoCH before MSS can fire.
BOS — every subsequent break in the trend direction after MSS — until the opposite CHoCH occurs and the cycle restarts.
This rule set keeps only one MSS per trend leg, with everything before it being CHoCH and everything after being BOS — exactly how SMC traders read it.
Pre-CHoCH levels (transparent reasoning)
When CHoCH fires, the script captures the swing-high / swing-low that existed before the trend flip (pre_choch_swing_high / pre_choch_swing_low). These are used by the stricter MSS modes and shown in the debug rows of the info table, so you can verify exactly why a break was classified as MSS or BOS.
Last broken swing tracking
For every confirmed break the indicator stores:
lastBreakSwingBarIndex — the bar where the broken swing originally formed (its ID).
lastBreakSwingPrice — the level that was broken.
lastBreakClassification — CHoCH / MSS / BOS.
lastBreakDirection — above swing high / below swing low.
lastBreakDetectBarIndex — the bar where the break passed your validation filter.
These are visible in the debug rows when Show debug rows (table) is on — useful for forensic / journal-style review.
Drawing budget (FIFO)
The indicator caps the number of CHoCH / MSS / BOS line + label pairs at Max CHoCH/MSS/BOS lines + labels (default 400, max ~80% of PulseWire's 500 limit). Older drawings are removed first (FIFO), so you never hit the line cap on long histories.
Alerts
Two ready-to-use alert conditions:
HH-HL-HH Alert — fires when an HH-HL-HH pattern completes.
LL-LH-LL Alert — fires when an LL-LH-LL pattern completes.
Use PulseWire's alert dialog → choose the alert condition by name. Messages include {{ticker}} and {{interval}} placeholders.
Suggested settings (from the Xcelerate Trade team)
Default for most traders: Auto settings ON, Williams Fractals, Wait for bar close ON, Break validation = Close, MSS definition = First break after CHoCH.
Strict structural read (low noise): Break validation = Close beyond buffer (%) with 0.05–0.10%, MSS definition = First break >= pre-CHoCH level.
Aggressive / fast feedback: Simple Fractals with period 2, Break validation = High/Low (wick), Wait for bar close = OFF.
Forensic review: turn ON Show debug rows (table) to see trend state, CHoCH / MSS flags, pre-CHoCH levels and the last-break summary.
Notes & disclaimers
Williams Fractals confirm with a delay equal to the right-length (R bars). This is intentional — pivots are not repainted after confirmation.
Simple Fractals confirm with a delay equal to simpleFractalPeriod bars.
This is an analytical tool — no automated buy / sell labels. Pair with your own execution rules.
Pine Script v6.
Built and maintained by the Xcelerate Trade team. A complete CHoCH / MSS / BOS market-structure read with HH / HL / LH / LL labels, four break-validation modes, three MSS definition modes, an info / debug table and ready alert conditions. 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)
PulseWire 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

[ A L P H A X ] PIVOT - Smart Money StructureAlphaX PIVOT — Smart Money Structure + OTE Pullback Engine: Market Structure Tracking, Optimal Trade Entry Zones, Liquidity Sweep Detection & 7-Layer Confluence Scoring
AlphaX PIVOT is a professional-grade smart money pullback system built around two of the most powerful concepts in institutional price action: market structure and the Optimal Trade Entry zone. Where breakout-based systems enter at the moment of structural displacement — chasing the move after it has already begun — PIVOT waits for the market to pull back into the precise Fibonacci retracement zone where institutional continuation orders are resting, and fires only when a qualified rejection candle confirms within that zone with multi-layer confluence backing. The result is a system that gives you the same directional conviction as a breakout entry at a structurally superior price — buying the pullback into institutional demand after a bullish BOS or CHoCH, selling the pullback into institutional supply after a bearish structure shift — with a stop anchored to the structural swing low or high rather than an arbitrary ATR distance. Designed for precision-entry traders across crypto, forex, gold, and indices on any timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📐 The Core Philosophy — Why Pull Back to OTE?
A Break of Structure or Change of Character tells you that the market has shifted direction at the institutional level. But the bar that breaks structure is rarely the optimal entry — it has already moved aggressively, the risk/reward from entry is reduced, and a pullback is statistically likely before the continuation begins.
The Optimal Trade Entry concept solves this. After a structural displacement move, price almost always retraces into a specific Fibonacci retracement zone — the 61.8% to 78.6% retracement of the displacement leg — before the next move in the structural direction begins. This zone is where institutional orders waiting at discount prices (in a bull structure) or premium prices (in a bear structure) are filled. Entering in the OTE zone means entering where institutions are entering, with the displacement leg already confirmed as the directional signal and the structural swing as the natural stop reference.
PIVOT detects every structural event, computes the OTE zone for the displacement leg in real time, and monitors for qualified rejection entries within that zone — all while running a 7-layer confluence engine that scores every potential entry before it fires.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏗 Market Structure Engine — Tracking BOS & CHoCH
The market structure engine runs a real-time fractal pivot detection system that tracks the most recent confirmed swing high and swing low on every bar, identifies every Break of Structure and Change of Character event, and maintains a live structural trend state.
Pivot detection:
Swing highs and lows are detected using a configurable pivot length (default: 5 bars each side). A pivot is confirmed when the specified number of bars on both the left and right side are lower (for a pivot high) or higher (for a pivot low). This creates confirmation — not just a local high or low, but a genuine fractal swing point.
Break of Structure (BOS):
When price closes above the most recent confirmed swing high while the structure is already bullish, a bullish BOS is detected — confirming the uptrend is intact and continuing. When price closes below the most recent swing low in a bearish structure, a bearish BOS is confirmed. BOS events are continuation signals — the existing structure is reinforcing itself.
Change of Character (CHoCH):
When price closes above a swing high while the structure is bearish, a bullish CHoCH is detected — the character of the market has changed from bearish to bullish. A bearish CHoCH is the inverse. CHoCH events are the highest-quality structural signals — they represent genuine institutional trend reversals and form the trigger for PIVOT's highest-conviction setup type.
Structure break mode:
The Close Only setting (default: on) requires a candle body close beyond the swing level for a BOS or CHoCH to register. When off, any wick touch counts. Body close is the stricter, cleaner mode — it eliminates false structure breaks caused by wick spikes that fail to close through the level, producing fewer but more reliable structural events.
Live swing levels:
The most recent confirmed swing high (plotted as a red dashed line) and swing low (yellow-green dashed line) are maintained on the chart in real time, extending forward until superseded by a new confirmed pivot. These levels represent the current active liquidity pools — the precise levels where the next sweep event is likely to occur.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📦 Structure Leg Box & Equilibrium — The Dealing Range
Every confirmed structure break event spawns a Structure Leg Box — a semi-transparent purple rectangle anchored to the displacement leg that produced the structural event. This box is the visual equivalent of the ANCHOR trend segment box, providing immediate context for the current structural move's price range.
Box construction:
For a bullish structure break, the leg box spans from the previous swing low (the origin of the displacement) to the close that broke structure — capturing the full range of the institutional displacement move. For a bearish structure break, it spans from the previous swing high down to the structure break close.
Equilibrium line:
The midpoint of the structure leg box — the 50% retracement level — is plotted as a purple dotted line extending forward. This is the leg's equilibrium level and the dividing line between discount (below EQ, favorable for longs) and premium (above EQ, favorable for shorts). The Premium/Discount requirement enforces that PIVOT signals can only fire when price is in the institutionally correct zone relative to this level.
Live updating:
The box expands as the trend develops — if price makes new highs in a bull leg, the box top extends upward. The equilibrium adjusts continuously. This ensures the OTE calculations always reflect the full extent of the current structural leg, not just the initial displacement.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 The OTE Zone — Optimal Trade Entry Band
The Optimal Trade Entry zone is a Fibonacci retracement band calculated from the structure leg's high and low — the 61.8% to 78.6% retracement zone (configurable). This is the institutional re-entry zone — the price area where sophisticated traders who missed the initial displacement fill their positions on the pullback.
OTE calculation for bull structure:
OTE Top = Leg High − (Leg Range × OTE Fib Low). Default: Leg High − (Range × 0.618)
OTE Bottom = Leg High − (Leg Range × OTE Fib High). Default: Leg High − (Range × 0.786)
This creates a band in the lower portion of the leg range — price must retrace between 61.8% and 78.6% of the upward displacement before the OTE zone is active.
OTE calculation for bear structure:
OTE Bottom = Leg Low + (Leg Range × OTE Fib Low)
OTE Top = Leg Low + (Leg Range × OTE Fib High)
This creates a band in the upper portion of the leg range — price must retrace between 61.8% and 78.6% of the downward displacement before the OTE zone is active.
Why the 61.8–78.6% zone: The 61.8% (golden ratio) and 78.6% (square root of 0.618) retracement levels are the two most consistently respected Fibonacci levels in institutional price delivery. They represent the deepest pullback levels that remain structurally valid — a retracement beyond 78.6% technically invalidates the structure leg's momentum. Entries within this zone maximize reward (entering near the deepest discount in a bull leg) while minimizing risk (the stop is at the structural swing, not far from the OTE bottom).
OTE zone visualization: A semi-transparent purple box rendered from the leg start bar to two bars beyond the current bar, spanning the OTE top and bottom prices. The zone extends and updates in real time as the leg evolves. The exact OTE band price levels are displayed on the dashboard for immediate reference.
In-OTE detection: The current bar is considered in the OTE zone when the bar's low (for bull setups) reaches within the OTE band, or the bar's high (for bear setups) reaches within the OTE band. This detects the precise moment price has retraced into the optimal entry area.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💧 Liquidity Sweep Detection
The sweep detection engine identifies liquidity grab events relative to recent price extremes, adding an important second dimension to PIVOT's entry context. A sweep is detected when price briefly extends beyond the recent high or low reference level by a minimum ATR depth, then reverses and closes back inside — the classic stop-hunt signature.
Bull sweep: The current bar's low extends below the lowest low of the lookback period (default: 20 bars) by at least the minimum sweep depth (default: 0.1× ATR), and the bar closes above that low and closes bullish (close above open). Sell-side liquidity has been grabbed.
Bear sweep: The high extends above the highest high of the lookback period by at least the minimum depth, and the bar closes below that high and closes bearish. Buy-side liquidity has been grabbed.
Sweep recency: PIVOT accepts sweeps from the current bar or either of the two preceding bars — a three-bar recency window. This accommodates the common scenario where the sweep candle precedes the OTE entry bar by one or two bars, allowing the confluence engine to credit the sweep even when entry occurs slightly after the grab.
Setup B — Sweep + CHoCH: When a sweep occurs within 40 bars of a Change of Character event and price is simultaneously in the OTE zone with a rejection candle, PIVOT's second setup type fires — the Sweep + CHoCH entry. This is the highest-conviction entry type: a CHoCH confirms the structural reversal, the sweep confirms institutional liquidity accumulation, and the OTE entry delivers the optimal price. All three institutional signals converging simultaneously.
Sweep markers (optional): Small orange circles can be plotted above or below bars where sweeps are detected. Off by default — sweeps count toward confluence scoring regardless of whether markers are displayed — but enabling them provides visual awareness of every liquidity event on the chart.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🕯 Rejection Candle Confirmation
Every PIVOT entry requires a qualifying rejection candle within the OTE zone — the candle that demonstrates price has touched the OTE level and been rejected back in the structural direction.
Bull rejection (Bullish Rejection or Engulfing):
Bullish Rejection — the bar closes bullish (close above open) and the close-to-low distance represents more than 55% of the bar's total range. The lower wick consumes the majority of the bar's range — buyers overwhelmed sellers that pushed into the OTE zone
Bullish Engulfing — a bullish close that fully engulfs the prior bearish candle — closing above the prior open while the prior candle was bearish. Confirms a clean reversal of the pullback momentum
Bear rejection (Bearish Rejection or Engulfing):
The mirror conditions — a bearish close with the high-to-close distance exceeding 55% of range, or a bearish engulfing of the prior bullish candle.
Why candle confirmation is essential: The OTE zone being touched is a necessary but not sufficient condition for entry. Price can drift through the OTE zone on low momentum without producing a genuine reversal. The rejection candle requirement ensures that the OTE touch produced a visible institutional response — not just a passive drift through the zone.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 The 7-Layer Confluence Engine
Every potential entry is evaluated across seven independent confluence layers. The default minimum is 5 of 7 — a high-quality gate that blocks setups where several dimensions of confirmation are missing.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Layer 1 — Market Structure Direction
Awards 1 point when the current structural trend agrees with the signal direction — bullish structure for longs (structure == 1), bearish for shorts. This is also a hard prerequisite enforced in the setup conditions — no PIVOT signal can fire without the structural trend being established in the signal direction. Structure is simultaneously a confluence layer and a foundational entry requirement.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Layer 2 — OTE Zone Touch
Awards 1 point when the current bar is within the OTE retracement band for the active leg direction — the 61.8–78.6% retracement zone. Also a hard prerequisite in the setup conditions. Ensures the entry is at the institutionally optimal retracement depth, not at an arbitrary price within the leg range.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Layer 3 — Premium/Discount Zone
Awards 1 point when price is in the correct zone relative to the leg equilibrium — below EQ (discount) for bull entries, above EQ (premium) for bear entries. The PD Zone layer enforces the institutional entry positioning principle: buy when price is cheap relative to the leg's fair value, sell when expensive. A valid OTE touch in the wrong PD zone (above EQ for a bull entry) carries a fundamental positioning problem — this layer blocks it.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Layer 4 — HTF Bias
Awards 1 point when the higher timeframe EMA structure (default: 60-minute, 21/55 EMA) agrees with the signal direction, using the same strict condition as SURGE and ANCHOR — the HTF fast EMA must be above the slow EMA and the HTF close must be above the fast EMA for a bull vote. A bull OTE entry against a bearish HTF is a counter-trend trade; this layer ensures PIVOT's signals align with the macro institutional flow.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Layer 5 — Liquidity Sweep
Awards 1 point when a qualifying sweep has occurred within the three-bar recency window in the correct direction. A sweep before or coinciding with the OTE entry dramatically increases the probability that the pullback is a genuine institutional accumulation event rather than a mechanical retracement. When the Sweep Filter is disabled, this layer is not available for scoring — the total achievable score drops to 6 of 6 in that configuration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Layer 6 — Rejection Candle
Awards 1 point when a qualifying bull rejection or bullish engulfing candle (long) or bear rejection or bearish engulfing candle (short) is present on the current bar. This is the candle confirmation layer — confirming that the institutional response to the OTE touch is visible and decisive on the current bar.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Layer 7 — ADX + Volume Expansion
Awards 1 point when both the ADX filter and the volume expansion filter pass simultaneously. ADX confirms the market has directional strength rather than ranging. Volume exceeding the moving average confirms genuine institutional participation on the entry candle rather than a low-activity drift through the OTE zone. Both conditions must be true for the single layer point — they are evaluated jointly.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏷 Two Setup Types — A and B
PIVOT fires signals through two distinct setup configurations, each representing a different institutional entry scenario. Both can be enabled simultaneously.
Setup A — OTE Pullback:
The foundational PIVOT setup. Fires when the market structure is established (BOS or CHoCH has confirmed), the displacement leg is active, price pulls back into the 61.8–78.6% OTE zone, a rejection candle forms within the zone, and the full confluence stack meets the minimum score. This is the highest-frequency setup type — it captures the standard institutional pullback sequence following any qualifying structure event.
Setup B — Sweep + CHoCH:
The premium PIVOT setup. Requires all Setup A conditions plus a Change of Character within the lookback window (40 bars) and a qualifying liquidity sweep within the three-bar recency window. The sequence is: liquidity sweep (stop hunt) → CHoCH (structural reversal confirmation) → OTE pullback (optimal entry). When all three institutional events converge simultaneously in the OTE zone with a rejection candle, this is among the highest-conviction setups available in the entire AlphaX indicator suite.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Structural Stop Loss Placement
PIVOT uses structurally anchored stop placement — the stop is placed beyond the most recent confirmed swing low (for bull entries) or swing high (for bear entries), plus a small configurable ATR buffer (default: 0.25× ATR).
Why this is the correct stop for OTE entries: The OTE entry is made on the premise that the structural swing low (bull) or high (bear) will hold — it is the key level whose violation would invalidate the entire structural thesis. If price closes through the swing low after a bull OTE entry, the structure leg is negated, the displacement was a false break, and the position thesis is fundamentally wrong. The structural swing is therefore not an arbitrary stop choice — it is the precise price at which the trade is provably wrong.
This produces stops that adapt naturally to the leg size: large legs with distant swings produce wider stops and wider profit targets; tight legs with nearby swings produce tighter, higher-precision entries. The risk/reward is computed dynamically as `(close − slGuide) × TP Reward (R)`.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Live Dashboard
The 16-row real-time dashboard displays the complete internal state across four sections.
STRUCTURE
Market Struct — current structural trend: ▲ BULLISH, ▼ BEARISH, or — NEUTRAL
PD Zone — current position relative to leg equilibrium: ◧ DISCOUNT, ◧ PREMIUM, or — EQ
Leg EQ — the exact leg equilibrium price (50% of the structure leg range) in real time
OTE Band — the current OTE zone bottom and top prices. Updates live as the leg expands
FILTERS
HTF Bias — higher timeframe EMA alignment: ▲ BULL, ▼ BEAR, or — FLAT
ADX — live ADX value with ✓ or ✗ pass/fail
Session — ✓ ACTIVE or ✗ OFF
LEVELS
Swing Hi — the most recent confirmed fractal swing high price. This is the current sell-side liquidity level and bear structural reference
Swing Lo — the most recent confirmed fractal swing low. The current buy-side liquidity level and bull structural stop reference
CONFLUENCE
Bull Score — live 0–7 confluence score. Background highlights yellow-green when threshold is met
Bear Score — live 0–7 score. Background highlights red when threshold is met
Live confluence label: During BUILDING and active leg phases, a small label near the OTE zone on the last bar shows B x/7 · S x/7 in real time — identical to ANCHOR's live score display — so you can monitor confluence building without dashboard attention.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Chart Visual System
Structure Leg Box (purple, semi-transparent) — the dealing range of the current displacement leg from structural origin to current price extreme. Adapts as the leg evolves
OTE Band Box (purple, deeper tint) — the 61.8–78.6% retracement zone of the current leg, extending two bars beyond the current bar for forward visibility
Leg Equilibrium Line (purple dots) — the 50% midpoint of the structure leg, continuously updated
Swing High Line (red dashed) — the most recent confirmed fractal swing high
Swing Low Line (yellow-green dashed) — the most recent confirmed fractal swing low
▲ Small Triangle (BOS Bull) — bullish Break of Structure, semi-transparent yellow-green
▲ Large Triangle (CHoCH Bull) — bullish Change of Character, bright yellow-green, larger size
▼ Small Triangle (BOS Bear) — bearish Break of Structure, semi-transparent red
▼ Large Triangle (CHoCH Bear) — bearish Change of Character, bright red, larger size
● Circle (optional, orange) — sweep detection markers when Show Sweep Markers is enabled
▲ Large Triangle (bull signal) — PIVOT long entry. All conditions confirmed
▼ Large Triangle (bear signal) — PIVOT short entry
Live confluence label — B x/7 · S x/7 near the OTE zone on the current bar
SL Guide (red dotted circles) — structural stop loss level below/above the swing reference
TP Guide (yellow-green dotted circles) — dynamically computed reward target based on R multiple
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 How to Trade with AlphaX PIVOT — Step by Step
Step 1 — Identify the Structural Context
Check the dashboard Market Struct row. ▲ BULLISH or ▼ BEARISH tells you the directional bias. — NEUTRAL means no structure is established — no setup can develop
Note the Swing Hi and Swing Lo levels on the dashboard. These are the current liquidity pools and structural stop references
Check HTF Bias — does the higher timeframe agree with the current structure? HTF alignment is worth 1 confluence point and significantly improves setup quality
Step 2 — Watch for a Structure Event
A large bright ▲ CHoCH triangle below the bar marks a bullish Change of Character — the highest-priority structural event. The structure leg box and OTE zone will draw immediately
A smaller ▲ BOS triangle marks a bullish Break of Structure — confirmation the trend is continuing
After either event, the Structure Leg Box and OTE Band are drawn in real time. Note where the OTE zone sits in absolute price terms from the dashboard's OTE Band row
Step 3 — Wait for the OTE Pullback
After the displacement, watch price retrace toward the OTE zone. The purple OTE box on the chart gives you the exact price boundaries
Check PD Zone on the dashboard — for bull entries, you want ◧ DISCOUNT to confirm price is below the leg equilibrium when it enters the OTE
Watch the live B x/7 score label near the OTE zone. As price approaches the zone, the score builds in real time
Step 4 — Enter on the PIVOT Signal
A ▲ triangle at the OTE zone confirms all conditions — structure direction, OTE touch, PD zone, HTF bias, sweep (if applicable), rejection candle, and ADX/volume
The SL guide is plotted below the structural swing low (bull) — your structural invalidation level
The TP guide is plotted at the computed reward target based on your configured R multiple
For Setup B signals (Sweep + CHoCH), all three institutional events have converged — this is the highest-conviction PIVOT entry available
Step 5 — Manage and Exit
At the TP guide level, take partial or full profit
If a new CHoCH fires in the opposite direction during the trade, the structure has reversed — this is the exit signal for any remaining position
If price retests the OTE zone again during the same structural leg without triggering a new signal (cooldown active), wait for the cooldown to clear and assess whether the fresh confluence score still meets the minimum
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Identifying Low-Quality Conditions — When Not to Trade
Stand aside when:
Market Struct shows — NEUTRAL — no structural direction is established. Without a confirmed BOS or CHoCH, the leg box and OTE zone have no directional context. Wait for a structural event to occur before looking for OTE entries
HTF Bias opposes structure direction — a bullish current timeframe structure against a bearish HTF is a counter-trend setup. These carry significantly lower success rates. The HTF alignment layer will not score, reducing the confluence count
Price is in the wrong PD zone for the setup direction — a bull entry above the leg equilibrium (premium) or a bear entry below (discount) means entering when price is institutionally expensive relative to the leg's fair value. The PD zone filter blocks these when enabled
Score is at 4/7 and the minimum is 5/7 — the setup is present but not enough layers confirm. Do not force entries when confluence is borderline
Structure events (BOS/CHoCH) are flipping rapidly in both directions — alternating bull and bear structure events in quick succession indicate a choppy market with no clean trend. The OTE zones will be constantly resetting without producing completed pullback sequences
OTE zone is very close to the swing low (bull) or swing high (bear) — when the OTE band and the structural stop reference are nearly at the same price, the risk/reward is poor. The stop would be just below the OTE entry. Reduce position size or pass the setup
The ideal PIVOT setup:
CHoCH event followed by a clean displacement leg with a well-defined leg box
Price retraces into the OTE zone while in discount (bull) or premium (bear)
A qualifying sweep has occurred within the last three bars
HTF Bias aligned with structure direction
Rejection candle forms within the OTE zone
Confluence score at 6/7 or 7/7
ADX confirms trending and volume is expanding
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Key Features
📐 Real-time market structure engine — fractal pivot detection with configurable sensitivity, tracking BOS and CHoCH events with body-close confirmation mode
📦 Structure Leg Box — automatically drawn from the structural origin to the current price extreme, expanding in real time as the leg develops
🎯 Optimal Trade Entry zone — 61.8–78.6% Fibonacci retracement band computed from the structure leg, rendered as a live OTE box and displayed with exact price levels on the dashboard
⚖ Leg Equilibrium line — 50% midpoint of the structure leg acting as the dynamic PD zone divider, plotted continuously and updated as the leg grows
💧 Liquidity sweep detection — identifies stop-hunt events relative to the recent price range with configurable ATR depth and three-bar recency window
🏅 Two setup types — Setup A (OTE Pullback after any BOS/CHoCH) and Setup B (Sweep + CHoCH + OTE — the highest-conviction institutional entry pattern)
🕯 Dual candle confirmation — bullish/bearish rejection candles and engulfing candles both qualify, ensuring the OTE touch produced a genuine institutional reversal response
🧠 7-layer confluence engine — Market Structure, OTE Touch, PD Zone, HTF Bias, Liquidity Sweep, Rejection Candle, and ADX + Volume Expansion all scored independently
📊 Live confluence label near OTE zone — B x/7 · S x/7 displayed in real time on the current bar without requiring dashboard reference
🎯 Structural stop loss — placed beyond the confirmed swing low (bull) or swing high (bear) plus ATR buffer, anchored to the genuine structural invalidation level
💹 Dynamic TP target — computed as `risk × R multiple`, adapting to leg size rather than using a fixed ATR distance
📡 HTF EMA bias filter — strict dual-condition HTF alignment (EMA crossover + price above fast EMA) for maximum higher timeframe conviction
🕐 Session filter — restricts signals to configurable active trading hours
📊 16-row live dashboard — Structure, Filters, Levels, and Confluence sections updated in real time
🔔 6 alert conditions — long/short entry, bull/bear CHoCH, sweep low, sweep high
🎨 Fully cohesive dual-tone color system — yellow-green for all bullish elements, red for all bearish, purple for structural reference levels and OTE zone, orange for sweeps
⚙ Fully configurable — pivot length, structure break mode, OTE Fibonacci levels, sweep depth and lookback, setup types, confluence minimum, HTF timeframe and EMAs, ADX, volume filter, session, SL buffer, TP reward multiple, and all colors are independently adjustable
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Settings Reference
Structure Engine
Pivot Length (bars each side) — fractal sensitivity. 3 for scalping, 5 for standard intraday (default), 7+ for swing trading
Structure Break: Close Only — when on, requires a candle body close beyond the swing level (default: on). Off = wick touch counts
Show Active Swing Levels — toggle swing high and swing low dashed lines
Show BOS / CHoCH Markers — toggle all structure event triangles
CHoCH Only (hide BOS markers) — when on, only CHoCH events are marked. BOS events still update structure but are not labeled
Structure Leg & OTE
Show Structure Leg Box — toggle the displacement leg dealing range box
Show Leg Equilibrium (50%) — toggle the leg midpoint line
Show OTE Band (62–79%) — toggle the Fibonacci retracement entry zone box
OTE Fib Low — lower Fibonacci level of the OTE band (default: 0.618)
OTE Fib High — upper Fibonacci level of the OTE band (default: 0.786)
Require Premium / Discount — when on, longs require discount positioning, shorts require premium (default: on)
Liquidity Sweep
Enable Sweep Filter — when on, Layer 5 scores the recent sweep and Setup B becomes available
Show Sweep Markers — toggle optional orange circle markers at sweep detection bars
Min Sweep Depth (xATR) — minimum wick extension beyond the reference extreme to qualify as a sweep (default: 0.1)
Sweep Reference Lookback — bars used to define the recent high/low reference for sweep detection (default: 20)
Entries & Confluence
Setup A · OTE Pullback — enable standard OTE pullback entries after BOS or CHoCH
Setup B · Sweep + CHoCH — enable the premium sweep + reversal + OTE setup type
Min Confluence Layers (of 7) — minimum score required for a signal (default: 5)
Show Entry Signals — toggle signal triangles
Show Confluence Label — toggle the live B/S score label near the OTE zone
Signal Cooldown (bars) — minimum bars between consecutive signals (default: 8)
Filters
HTF Trend Filter — toggle the higher timeframe EMA alignment requirement
HTF Timeframe — the higher timeframe for EMA data (default: 60-minute)
HTF Fast / Slow EMA — EMA periods on the HTF (defaults: 21 / 55)
ADX Trend Filter — toggle the ADX strength requirement (default: off)
ADX Length / ADX Minimum — ADX parameters (defaults: 14 / 18)
Volume Expansion Confirm — when on, entry candle volume must exceed the moving average by the minimum multiplier
Min Volume vs Avg — minimum volume ratio for the expansion filter (default: 1.1)
Volume Avg Length — SMA length for the volume baseline (default: 20)
Session Filter — toggle active hours restriction (default: off)
Active Session — configurable session window
Exit Guidance
ATR Length — lookback for ATR calculation (default: 14)
Show SL / TP Guides — toggle stop and target dotted circle plots
SL Buffer Beyond Swing (xATR) — additional ATR buffer beyond the structural swing stop reference (default: 0.25)
TP Reward (R) — take profit distance as a multiple of the risk from entry to stop (default: 2.0)
Display
Show Dashboard — toggle the full dashboard panel
Dashboard Position — Top Left / Top Right / Bottom Left / Bottom Right
Colors
Bull / Bull Bright — yellow-green family for bullish signals, fills, and labels
Bear / Bear Bright — red family for bearish signals, fills, and labels
Sweep / Alert — orange for sweep markers and alerts
Equilibrium / OTE Band — purple for structural reference levels and OTE zone
SL Guide / TP Guide — stop and target circle colors
Bull / Bear Label Text — text color for signal labels
Dash Text / Dash BG / Dash Header / Dash Section / Dash Frame — full dashboard color control
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alert Conditions (6 total)
Entry Alerts
Pivot Long Entry — all conditions confirmed for a long OTE setup. Signal label fired
Pivot Short Entry — all conditions confirmed for a short OTE setup
Structure Alerts
Pivot Bull CHoCH — bullish Change of Character detected. Watch for OTE pullback in discount zone
Pivot Bear CHoCH — bearish Change of Character detected. Watch for OTE pullback in premium zone
Sweep Alerts
Pivot Sweep Low — sell-side liquidity swept below recent lows. Potential long setup developing
Pivot Sweep High — buy-side liquidity swept above recent highs. Potential short setup developing
All alert messages are formatted as const strings for clean webhook and notification platform integration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Recommended Settings by Instrument & Timeframe
The default configuration is optimized for XAUUSD on M5–M15 , with general suitability for major forex pairs and crypto on the same timeframes:
Pivot Length at 5 — the classic fractal sensitivity for intraday gold and forex. Balances signal frequency with structural significance
Close Only on — body close structure breaks eliminate the vast majority of wick-based false breaks on gold and volatile instruments
Setup B (Sweep + CHoCH) on — the highest-quality setups on gold involve a sweep before the CHoCH, making this setup type particularly effective on XAUUSD
HTF at 60-minute — the standard intraday reference for M5–M15 trading
ADX filter off by default — the OTE + rejection candle requirements already provide strong quality filtering without needing ADX as an additional gate
For other instruments or timeframes, adjust:
M1–M3 scalping — reduce Pivot Length to 3, increase Cooldown to 5, reduce TP Reward to 1.5, use tight session filter
H1–H4 swing trading — increase Pivot Length to 7–10, set HTF to Daily or Weekly, increase TP Reward to 3.0–4.0, increase SL Buffer to 0.5
Crypto (BTC, ETH) — increase Sweep Depth to 0.2–0.3× ATR for the wider wicks typical of crypto, consider enabling ADX filter at 20
Indices (NAS100, US30) — use Pivot Length 5–7, enable Session Filter to 09:30–16:00, enable ADX filter
More signals — lower Min Confluence to 4, disable PD Zone requirement, enable Setup A only, reduce Cooldown
Ultra-selective entries only — raise Min Confluence to 6 or 7, require Setup B only, enable ADX filter, enable Volume Expansion
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👥 Who This Is For
🎯 OTE and Fibonacci pullback traders — PIVOT is the definitive quantitative implementation of the Optimal Trade Entry framework. Every component — structure detection, leg computation, Fibonacci zone rendering, and rejection confirmation — is automated and scored
🏦 Smart money concepts and ICT methodology traders — PIVOT encodes the CHoCH → displacement → OTE pullback sequence that forms the core of ICT's entry model. The Sweep + CHoCH setup type specifically captures the stop hunt → reversal → optimal entry sequence
🥇 Gold (XAUUSD) and forex traders — the default settings are calibrated for intraday gold trading, where OTE pullbacks after CHoCH events are among the most consistent institutional patterns available
📊 Traders who want structure-defined risk — the structural stop placement means every trade has a stop at a genuinely meaningful level — the swing that would invalidate the structure thesis — rather than an arbitrary ATR distance
🧠 Systematic traders who want to quantify OTE entries — the 7-layer scoring system removes subjectivity from OTE trading. Every potential entry is scored objectively against the same seven criteria on every bar
📈 Traders who want to enter later at a better price — PIVOT's entire philosophy is about waiting for the pullback. If you consistently enter at breakouts and then watch price retrace before continuing, PIVOT is the solution — it waits for that retracement and enters at the optimal Fibonacci level within it
⚠ Traders who struggle with stop placement — the structural swing reference + ATR buffer produces a stop that makes structural sense. You are not guessing where to put the stop — the market's structure tells you exactly where it belongs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Notes
All signals are confirmed on bar close — the indicator is non-repainting by design. Pivot detection, structure break logic, OTE zone calculation, and confluence scoring all finalize on confirmed bars only
The pivot detection has an inherent offset of pivotLen bars — a pivot is only confirmed after pivotLen bars have passed on both sides. This is standard behavior for fractal-based pivot systems and is not repainting — it is the mathematical requirement for confirming the fractal pattern
The Structure Leg Box and OTE Zone are redrawn only on the last bar for chart cleanliness. Historical bars retain signal markers and BOS/CHoCH labels but do not show outdated box overlays
The CHoCH window for Setup B (40 bars) means a Sweep + CHoCH setup can fire up to 40 bars after the CHoCH event, as long as the OTE zone is still valid and all other conditions are met. On slower timeframes this window covers a wider clock-time range — adjust if needed
The confluence label near the OTE zone is drawn only on the last bar. It is a real-time awareness tool, not a historical indicator
Maximum 500 labels, 500 lines, and 80 boxes are rendered. On very active charts, the oldest markers may be removed by PulseWire's limits
The session filter is off by default — PIVOT's structural approach is timeframe and session-agnostic. Enable the session filter for instruments where specific sessions (London, NY) produce more reliable structure events
The TP guide is computed dynamically as risk × R multiple. On bars where the swing reference and current price are very close (producing near-zero risk), the fallback is ATR × R multiple
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Disclaimer
This indicator is a technical analysis and visualization tool intended for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. All signals are generated from historical and real-time price data using mathematical calculations — their accuracy or profitability is not guaranteed. Past performance of any signal type does not guarantee future results. Always conduct your own analysis, use proper risk management, and consult a licensed financial advisor before making any trading decisions. The author accepts no responsibility for any losses incurred from the use of this indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Built for traders who know that the move has already started — and who want to enter it at the precise price where the institutions who created the move are still adding to their position. Indicator

Order Blocks with Volume [Quantum Algo]Order Blocks with Volume
OVERVIEW
This indicator finds order blocks — the candles where a directional move originated before price broke market structure — and measures the buy and sell volume that traded inside each one. Every zone is drawn as a box that extends forward until price returns to it, and each active zone is labelled with its total volume and its buy/sell split, so you can tell at a glance which blocks were built on heavy participation and which were not.
It is built entirely from price and volume on the chart you apply it to. There is no repainting of confirmed zones: detection runs only on closed bars.
HOW DETECTION WORKS
1. Market structure. Confirmed swing highs and swing lows are located using a pivot of configurable length (Swing Length). A larger value isolates more significant structure and produces fewer, larger zones.
2. Break of structure. When a candle closes above the most recent confirmed swing high (bullish) or below the most recent confirmed swing low (bearish), the indicator treats it as a break of structure and looks for the order block that produced the move.
3. The order block candle. Starting from the breakout, the script steps back over the impulse candles and marks the last opposite-close candle before the move began — the last down-close candle for a bullish block, the last up-close candle for a bearish block. This is the origin of the displacement and the level price often revisits.
4. Zone range. The block is drawn from that candle using either its full high-to-low range (Wick) or its open-to-close body (Body).
VOLUME ENGINE
For each order block candle the indicator estimates how much of the traded volume was buying versus selling, using where the candle closed within its own range:
- Buy volume is weighted by how close the candle closed to its high.
- Sell volume is weighted by how close it closed to its low.
This split is shown two ways:
- Buy / Sell volume bars: two horizontal bars anchored at the left of the zone — buy on the top half, sell on the bottom half — with lengths proportional to each side. The Volume Bar Length setting controls how long they can extend (they are automatically kept inside the zone).
- Volume label: written inside the zone on the right edge, showing the total volume of the block and the buy% / sell% balance.
Volume strength is the block's volume divided by the average volume over a configurable baseline (Volume Baseline Length). It is used by the optional filter below to keep only the heaviest blocks.
ZONE LIFECYCLE
- Active. A live zone extends to the current bar and shows its volume bars and label.
- Mitigation. When price first trades back into a zone, the 50% line marks the equilibrium and an alert can fire.
- Invalidation. A zone is invalidated when price moves through its far edge. The source can be a wick touch or a candle close (Invalidation Source).
- Breaker. If "Flip Broken Zones to Breaker Blocks" is on, an invalidated zone is kept and re-coloured as a breaker, since broken support can act as resistance and vice versa.
- Historic. If "Keep Invalidated Zones (Historic)" is on, finished zones are frozen at the bar they died, re-coloured neutral, and their volume bars and text are removed to keep the chart clean.
- If neither option is on, invalidated zones are removed.
To avoid clutter the indicator will not stack a new zone on top of an existing active zone in the same area, limits the number of active zones per side, and automatically drops any zone older than the drawing range.
ON-CHART ELEMENTS
- Coloured boxes: bullish and bearish order blocks (and a neutral colour for breaker/historic).
- Two inner bars per active zone: buy (top) and sell (bottom) volume.
- A dotted line through the middle of active zones: the 50% mitigation / equilibrium level.
- Text inside active zones: total volume and buy% / sell%.
SETTINGS
Structure & Detection
- Swing Length — pivot length used to define structure. Higher = larger, more significant zones.
- Impulse Lookback (bars) — how far back to search for the origin candle after a break of structure.
- Zone Range — Wick (full range) or Body (open-to-close).
- Max Active Zones / Side — cap on simultaneously active zones per direction.
Invalidation
- Invalidation Source — Wick (a high/low piercing the zone) or Close (a candle closing beyond it).
- Flip Broken Zones to Breaker Blocks — keep and re-colour broken zones as breakers.
- Keep Invalidated Zones (Historic) — freeze finished zones instead of deleting them.
Volume Engine
- Show Volume Label — write volume and buy/sell% inside active zones.
- Show Buy / Sell Volume Bars — draw the proportional buy/sell bars.
- Volume Baseline Length — averaging length used to rate volume strength.
- Volume Bar Length (bars) — maximum length of the buy/sell bars.
Filters
- Only Show High-Volume Zones — hide blocks below the strength threshold.
- Min Volume Strength (x avg) — threshold as a multiple of average volume.
- Filter Oversized Zones — skip blocks taller than the ATR limit.
- Max Zone Height (ATR x) — the height limit, in multiples of ATR.
Style
- Bullish Zone, Bearish Zone, Buy Volume, Sell Volume, Breaker / Historic, Text — colours.
- Zone Extension (bars) — how far active zones project past the current bar.
- Show 50% Mitigation Line — toggle the equilibrium line.
ALERTS
Alerts are raised through the alert() function for two events: an order block being tapped (mitigation) and an order block being broken (breaker formed). To use them, create an alert on the indicator and choose the "Any alert() function call" condition.
HOW TO USE
Order blocks mark areas where significant orders were likely placed. Traders commonly watch for price to return to an un-mitigated block and react there, and use the buy/sell volume split and strength to judge how meaningful a block is — a block built on high, one-sided volume is generally treated as more significant than a thin one. Combine the zones with your own confirmation and risk management; this tool highlights levels, it does not generate buy or sell signals.
DISCLAIMER
Nothing here is financial advice or a guarantee of any outcome. Past behaviour of price around order blocks does not predict future results. Always do your own research and manage risk. Indicator
