AI UltraTrend X Pro V1The AI UltraTrend X Pro V1 is a high-performance, signal-based indicator engineered to identify explosive trend reversals while aggressively filtering out sideways market noise. Built specifically to handle high-volatility environments like BankNifty, this tool excels at capturing large point moves by combining institutional flow tracking with advanced price-action breakouts.
Key Features
Multi-Segment Mastery: While optimized for the fast-paced nature of BankNifty, the logic is universally applicable across Equity, Forex, Commodities, and Crypto.
Optimized for 3m+ Timeframes: Designed for the 3-minute duration and above, providing a perfect balance between early entries and noise reduction.
Hybrid Execution Logic: Unlike standard indicators that rely solely on crossovers, this script uses a dual-trigger system—line crosses and volatility-backed breakouts—ensuring you never miss a gap-up or a sudden trend explosion.
Intraday & Swing Flexibility: Seamlessly transitions between aggressive Intraday scalping and Positional trend following. The indicator maintains its state, allowing users to carry trades or square off at the end of the session based on their own risk profile.
Advanced Anti-Chop Shield: Features a built-in Volume & Volatility filter that identifies "dead zones" (gray signal areas) to prevent the "multiple entries/exits" common in flat markets.
Dynamic Trailing Stop-Loss: Plots a real-time, ATR-based trailing exit (Yellow Line) that locks in profits while giving the trend enough "breathing room" to survive minor pullbacks.
How to Use
Enter CE: Triggered when the signal turns Green and price breaks recent resistance.
Enter PE: Triggered when the signal turns Red and price breaks recent support.
Stay with the Trend: The background remains color-coded (Green/Red) as long as the trend is healthy.
Exit: Close your position when the signal label flips.
Best Settings
Timeframe: 3m, 5m, or 15m.
Chart: Works best on standard Candlesticks or Heikin Ashi for smoother trend following. Indicator

Market Phase Detector [JOAT]Market Phase Detector
Introduction
Market Phase Detector is an open-source market structure classification engine that continuously identifies whether price is operating in a Bullish Trend, Bearish Trend, or Range state. The classification uses three independent inputs that must align simultaneously before a regime is confirmed, making the output robust against single-factor noise and false positives that plague simpler trend detectors.
The problem Market Phase Detector solves is context. Trend-following entries during range conditions produce whipsaws. Mean-reversion entries during strong trending moves produce losses against the dominant flow. Knowing the regime before interpreting any other signal improves the relevance of every decision made from it. Market Phase Detector makes that determination automatically, updates it bar by bar, and visualizes both the current regime and every structural event that contributed to it — including labeled BOS and CHoCH events with horizontal level lines, live swing extension lines at the right edge, and an institutional-grade dashboard.
Core Concepts
1. Swing Detection and Pivot Tracking
Price structure is derived from pivot highs and lows confirmed using ta.pivothigh() and ta.pivotlow() with a configurable symmetric lookback. The lookback controls sensitivity — a value of 5 requires 5 bars on each side of the pivot to confirm it, producing only the most structurally significant swings. Each confirmed pivot updates the tracked level and resets its broken flag to allow new break detection on the next cycle:
pivHi = ta.pivothigh(high, swingLen, swingLen)
pivLo = ta.pivotlow(low, swingLen, swingLen)
if not na(pivHi)
topLevel := pivHi
topBroken := false
2. Break of Structure vs Change of Character
Two structural event types are distinguished and tracked independently. A Break of Structure (BOS) occurs when price closes through the previous swing extreme in the same direction as the current structural bias — confirming continuation. A Change of Character (CHoCH) occurs when price closes through the previous swing extreme against the current structural bias — signaling a potential regime flip:
bosBull = bullBreak and structureBias == 1
chochBull = bullBreak and structureBias != 1
Every event is labeled directly on the chart with a horizontal line at the break level and a text label (BOS +, BOS -, CHoCH +, CHoCH -). Running counts of each type are tracked and displayed in the dashboard.
3. Three-Factor Regime Gate
The regime classification evaluates all three inputs simultaneously before assigning a state. Structure bias is set by BOS and CHoCH events. The volatility gate compares current ATR to a moving average of ATR multiplied by a contraction threshold — when ATR falls below this level the market is classified as compressed and the regime defaults to Range regardless of structure or momentum. Momentum uses a smoothed rate-of-change that must confirm the structural direction:
if isLowVol
regime := 0 // Range — volatility gate overrides everything
else if strBias == 1 and roc > 0
regime := 1 // Bullish
else if strBias == -1 and roc < 0
regime := -1 // Bearish
else
regime := 0 // Inconclusive — range
A confidence score (1-3) counts how many of the three factors currently agree and is displayed in the dashboard, allowing the trader to distinguish a fully confirmed 3/3 regime from a weaker 2/3 reading.
4. Swing Level Extension Lines
The current unbroken swing high and swing low are extended as dotted horizontal lines to the right edge of the chart with price labels. These serve as the nearest structural reference levels — the next points where a BOS or CHoCH could occur. They are deleted and redrawn each bar using barstate.islast so they remain current without consuming the indicator's line budget:
if barstate.islast and showSwingExt
line.delete(swingHiLine)
swingHiLine := line.new(topBar, topLevel, bar_index + 4, topLevel,
color=color.new(#E65100, 45), style=line.style_dotted, width=2)
5. Regime Background Shading
The chart background is tinted according to the current regime — faint teal for Bullish, faint orange for Bearish, neutral gray for Range. This gives immediate context at a glance without adding visual noise to the price action.
Features
Three-state regime output: Bullish, Bearish, and Range states derived from structure, volatility, and momentum alignment
BOS and CHoCH event labels: Every structural break labeled on-chart with event type, direction, and horizontal level line
Independent BOS and CHoCH counters: Running totals of each structural event type in the dashboard
Swing level extension lines: Dotted right-edge lines at the current unbroken swing high and low with price labels
ATR-based volatility gate: Low-volatility contraction forces a Range classification regardless of structure or momentum
Smoothed momentum confirmation: Rate-of-change must align with structure before a trending regime is confirmed
Confidence scoring (1/3 to 3/3): Quantifies how many of the three classification factors are currently aligned
Regime background shading: Chart background tint reflects the current regime in real time
Institutional dashboard (top right): 15-row table with regime state, confidence, last break direction and age, BOS and CHoCH counts, swing levels, and ATR
Fully configurable colors: Bullish, bearish, and ranging tints plus structure line colors are independently adjustable
All signals confirmed bar only: No repainting — all structural events fire on barstate.isconfirmed
Input Parameters
Structure Detection:
Swing Lookback: Left/right bars required for pivot confirmation (default: 5)
ATR Period: ATR calculation length (default: 14)
Regime Classification:
Volatility MA Length: MA length for ATR comparison (default: 20)
Range Contraction Multiplier: ATR fraction below which the market is classified as ranging (default: 0.7)
Momentum Lookback: Rate-of-change lookback and EMA smoothing period (default: 10)
Display:
Regime Background Shading toggle
Show Dashboard toggle
Show Structure Lines toggle
Show Swing Level Extensions toggle
How to Use This Indicator
Step 1: Read the Current Regime
Check the REGIME row in the dashboard. BULLISH, BEARISH, or RANGE appears in its corresponding color. This is the primary output. Use it to establish directional bias before consulting any other signal source.
Step 2: Check Confidence Score
The Confidence row shows how many of the three inputs align (e.g., 2/3). A 3/3 reading means structure, volatility, and momentum all agree. A 2/3 reading means one factor is diverging. Weight directional decisions higher during full 3/3 alignment.
Step 3: Monitor CHoCH Events
Each CHoCH label marks a structural break against the current bias — a warning that the regime may be shifting. When a CHoCH appears, watch whether subsequent bars confirm a new opposing BOS or whether the previous regime resumes.
Step 4: Use Swing Extension Lines as Forward Reference
The dotted right-edge lines mark the current unbroken swing levels — the nearest structural break zones. Knowing how close price is to these levels frames where the next BOS or CHoCH could occur.
Step 5: Apply Regime as a Filter
Market Phase Detector is designed as a context layer, not a standalone signal generator. Apply the regime output as a filter to your existing tools: only take long signals when the regime is Bullish, only take short signals when Bearish, and step aside or apply mean-reversion logic when Range is active.
Indicator Limitations
Pivot detection confirms swingLen bars after the pivot forms, creating a natural offset between the candle where the swing occurred and when it is labeled. This is intentional non-repainting behavior
The volatility gate may temporarily classify a new trend as Range immediately after a volatility expansion if ATR has not yet risen above the threshold. This resolves within a few bars as ATR normalizes
In slow, grinding markets, momentum may repeatedly lag structure, resulting in extended Range readings during mild trends
Market Phase Detector classifies current market state. It does not predict future price direction or generate entry/exit signals
Originality Statement
Market Phase Detector is original in its three-factor gate requiring independent alignment of structure, volatility, and momentum before any regime is confirmed. This indicator is published because:
The combination of CHoCH and BOS structural logic, an ATR contraction gate, and a smoothed momentum filter into a single lightweight classifier that produces a confidence score is uncommon in published open-source Pine Script v6
Distinguishing BOS from CHoCH within the same indicator — with independent event counts and labeled historical events — provides structural context that standalone trend indicators do not offer
The confidence scoring system (1-3) quantifies the strength of the current regime reading across three independent analytical dimensions, not just a single oscillator value
Swing level extension lines provide live structural reference at the right edge of the chart without requiring the user to manually draw levels or add a separate pivot indicator
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Regime classifications are based on historical price data and do not guarantee any future market behavior. All three factors can produce inaccurate readings in atypical market conditions. Always use proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
Indicator

Market Structure Trend Matrix [BigBeluga]Market Structure Trend Matrix is a comprehensive technical analysis framework engineered for traders who demand precision in identifying market regimes and trend expansions. By integrating automated Market Structure (MS) detection with volatility-adjusted risk parameters, this indicator provides a systematic roadmap for navigating complex price action.
The tool focuses on the Change of Character (ChoCh) —the critical moment when a previous trend structure breaks and a new directional bias begins.
🔵 ARCHITECTURE & CORE LOGIC
Automated Structure Mapping: The engine uses a sophisticated pivot-detection algorithm (MS Length) to scan for institutional-grade swing highs and lows. It ignores minor retail noise, drawing structural lines only when significant supply or demand zones are breached.
The ChoCh Engine: When price crosses a recent pivot high or low, the indicator prints a "ChoCh" label. This represents a fundamental shift in market sentiment, signaling that the current trend has likely terminated and a new cycle has begun.
Infinite Expansion Targets: One of the most advanced features of the Matrix is its ability to project sequential, infinite targets. These levels are not static; they are calculated using Average True Range (ATR) multipliers, meaning they expand and contract based on current market volatility.
Volatility-Anchored Trailing Stop: To ensure professional-grade risk management, the indicator plots a dynamic ATR Trailing Stop . This line acts as a "ratchet" mechanism—it moves closer to price during the trend expansion but stays firm during minor pullbacks, providing a clear exit point if the trend truly fails.
🔵 ADVANCED FEATURES & UPDATES
Target History Control: This latest version includes a Show History toggle. You can choose to keep the chart clean by only displaying the Active Target , or you can enable history to see a visual record of every target hit during the trend, complete with historical percentage labels.
Dynamic Trailing Stop Visibility: The Show Trailing Stop feature allows you to toggle the visibility of the ATR stop line and its associated background fill, giving you full control over the visual "weight" on your workspace.
Percentage Profit Labels: Every time price reaches an expansion target, the script automatically plots a label showing the percentage gain from the initial ChoCh entry point.
Volatility-Adjusted Spacing: Both the trailing stop and the target steps use ATR-based calculations. This ensures that the indicator remains effective across all asset classes—from volatile Cryptocurrencies to stable Forex pairs.
🔵 HOW TO INTERPRET THE MATRIX
Bullish State (Green Matrix): Activated when price breaks above a major Pivot High. The indicator projects upward expansion targets and maintains a trailing stop below the price.
Bearish State (Pink Matrix): Activated when price breaks below a major Pivot Low. The indicator projects downward targets and maintains a trailing stop above the price.
The Target Cascade: As price hits a target, the indicator instantly projects the next level. If price continues to expand, you will see a "cascade" of dashed lines, each representing a deeper extension into the trend.
🔵 APPLICATION IN TRADING
Scalping & Day Trading: Set the Market Structure Length to a lower value (e.g., 5-8) to capture fast intraday pivots and expansion moves on 1m or 5m charts.
Swing Trading: Use a higher length (e.g., 15-20) to identify macro structure shifts on Daily or H4 timeframes, allowing the ATR targets to guide your long-term profit-taking.
Risk-Reward Management: The distance between the ChoCh Entry and the ATR Trailing Stop provides an objective risk measurement, while the sequential targets provide clear reward milestones.
Filtering False Breaks: By using an ATR Multiplier for the trailing stop, the Matrix avoids many of the common "whipsaws" found in standard trend-following systems.
🔵 CONCLUSION
Market Structure Trend Matrix is more than a signal tool; it is a visual framework for objective decision-making. By anchoring your trading to structural pivots and volatility-based targets, you remove the guesswork from trend following. Whether you are looking for a clean "ChoCh" entry or a systematic way to trail your profits during a massive expansion, the Trend Matrix provides the data and clarity required to trade like a professional. Indicator

Phantom Structure Engine [JOAT]Phantom Structure Engine
Overview
Phantom Structure Engine is a comprehensive Smart Money Concepts (SMC) framework built entirely in Pine Script v6 using typed User-Defined Types and methods. It maps institutional price structure across five dimensions simultaneously: swing Break of Structure (BOS), Change of Character (CHoCH), Order Blocks (OB), Fair Value Gaps (FVG), Equal Highs/Lows (EQH/EQL), Liquidity Sweeps, and dynamic Premium/Discount/Equilibrium zones — all rendered with an institutional-grade dark visual palette and managed via object arrays.
Why a Unified SMC Framework?
SMC concepts are deeply interconnected. A BOS creates the context for a valid Order Block. A CHoCH signals a structural regime shift that invalidates existing OBs. A liquidity sweep above an EQH often precedes a reversal into a Discount zone. Displaying these concepts in isolation (as separate indicators) breaks the logical chain between them. Phantom Structure Engine fuses all layers into a single coherent visual, so each element is always read in its correct structural context.
Core Engine — Swing Structure
Two separate pivot engines run concurrently:
- Swing pivots (configurable left/right bars, default 10/10): define the major structure highs and lows used for BOS and CHoCH detection
- Internal pivots (default 3/3): track minor structure shifts for shorter-term intrabar analysis
BOS Detection with Confirmation Counter
Rather than firing on the first close beyond a swing level, the engine counts consecutive closes above the last swing high (or below the last swing low). A BOS only registers when the close count reaches or exceeds the configurable confirmation threshold (default 1, max 5). This suppresses false breaks caused by wicks and momentary spikes while remaining responsive.
- BOS (Break of Structure): Close beyond swing level, structure direction confirmed. Displayed as a horizontal line from the pivot bar to the break bar, with a BOS label.
- CHoCH (Change of Character): BOS that occurs against the prevailing structural direction (e.g., a bullish break when the prior confirmed direction was bearish). Displayed in gold with a dashed line and CHoCH label.
Order Block Detection
When a BOS or CHoCH fires, the engine scans backward (configurable lookback, default 10 bars) for the last opposing candle — a bearish candle before a bullish BOS, or a bullish candle before a bearish BOS. This candle becomes the Order Block zone.
Each OB is drawn with a two-layer box: a wide semi-transparent outer box and a tighter inner highlight. The OB extends forward on every bar and automatically invalidates (turns grey) when price closes through the opposite boundary — the exact behaviour seen when an OB has been mitigated by institutional flow.
Fair Value Gap Detection
A bullish FVG is identified when bar .low > bar .high (a gap in price between the current bar's low and two bars ago's high), indicating that price moved so fast upward that no trading occurred in that range. Bearish FVG is the mirror. FVGs are drawn as dotted-border boxes that extend forward and auto-fill (turn grey) when price returns to close the gap.
Equal Highs / Equal Lows (EQH / EQL)
At each new swing pivot, the engine compares the current pivot value against the previous pivot of the same type. If the absolute percentage difference is less than 0.15%, they are classified as equal and an EQH or EQL label is stamped at the midpoint. These levels represent liquidity pools resting above or below price — targets for institutional sweeps.
Liquidity Sweeps
A sweep is detected when price wicks beyond the last confirmed swing high or low but closes back on the opposite side. This is the classic liquidity grab: price hunts stops above a high (or below a low), then reverses. Sweep labels fire at the wick extreme in gold — one of the highest-probability reversal signals in institutional analysis.
Premium / Discount / Equilibrium Zones
After each confirmed BOS, the engine identifies the full range between the last confirmed swing high and swing low. This range is divided into three zones:
- Premium (top 38.2%): Statistically expensive — short bias in a bearish structure
- Equilibrium (38.2%–61.8%): Fair value — reduce exposure
- Discount (bottom 38.2%): Statistically cheap — long bias in a bullish structure
Previous zones are deleted and redrawn on each new BOS, keeping the chart clean.
Periodic Levels (PDH / PDL / PWH / PWL)
Previous Day High/Low and Previous Week High/Low are fetched via request.security() with lookahead disabled (barmerge.lookahead_off), preventing any future-bar contamination. These levels render as step-line plots and represent the primary reference levels used by institutional order desks at open.
Institutional Funding Candles
Bars where the true range exceeds 1.5× ATR(14) AND volume exceeds 2× the 20-bar volume SMA are highlighted as funding candles. These represent institutional participation bars and are coloured based on the current structural direction: teal (bullish structure), red (bearish structure), gold (neutral).
Dashboard (Top Right)
A compact 2-column, 8-row table displays: current structural direction, active OB count, open FVG count, last confirmed swing high/low values, and current sweep status for both sides.
Inputs Reference
Structure Settings
- Swing Pivot Left/Right Bars (10/10) — major swing sensitivity
- Internal Pivot Left/Right (3/3) — minor structure sensitivity
- BOS Confirmation Closes (1–5) — consecutive closes needed to confirm BOS
- Show BOS Labels / CHoCH Labels / HH-HL-LH-LL labels
Order Blocks
- Show Order Blocks
- OB Lookback Candles (10) — how far back to scan for the OB candle
- Max Active OBs (6) — older OBs are deleted when limit is reached
Fair Value Gaps
- Show Fair Value Gaps
- Max Active FVGs (5)
Premium / Discount
- Show PD Zones / EQH-EQL / Liquidity Sweeps
Periodic Levels
- Show Prev Day H/L / Prev Week H/L
Visual
- Theme: Dark, Light, Auto
- Show Funding Candles
How to Use
1. Apply on any liquid instrument. Allow the warmup period (driven by pivot lookback) before trusting the signals.
2. Read structure direction from the dashboard. BOS labels in teal confirm a bullish shift; CHoCH in gold signals a potential trend reversal.
3. Look for price to pull back into a valid (not invalidated) OB or into the Discount zone before considering long entries. Reverse for shorts.
4. FVG zones often act as magnets — price tends to revisit them before continuing in the BOS direction.
5. Treat Liquidity Sweep labels as potential reversal alerts, particularly when they align with OBs or Discount/Premium zones.
Non-Repainting Design
All BOS, CHoCH, sweep, and FVG signals are gated by barstate.isconfirmed. Periodic levels use close with lookahead_off. No pivot value is read until the required right-bar confirmation period has elapsed. Historical labels never shift position.
Limitations
- SMC is a discretionary framework. This indicator automates detection but cannot replace contextual judgment on higher-timeframe bias.
- In extremely fast-moving markets, FVGs may form and fill within the same session, reducing their relevance as future targets.
- EQH/EQL detection uses a 0.15% price equality threshold — this may need adjustment for very low-priced or highly volatile instruments.
- OBs are detected from the most recent opposing candle before a BOS. On some instruments, the true institutional OB may be further back.
Disclaimer
This indicator is provided for educational and informational purposes only. SMC concepts describe price behaviour patterns and do not guarantee any future market outcome. Always conduct your own analysis and use proper risk management.
Made with passion by officialjackofalltrades
Indicator

Wyckoff Accumulation Phase Map [AGPro Series]Wyckoff Accumulation Phase Map
🟢 OVERVIEW
Wyckoff Accumulation Phase Map is the bullish counterpart of the Wyckoff Distribution Phase Map and completes the AGPro Wyckoff structural cycle. It is a retrospective structural mapping tool that locates and labels the seven core accumulation events — Preliminary Support (PS), Selling Climax (SC), Automatic Rally (AR), Secondary Test (ST), Spring, Last Point of Support (LPS) and Sign of Strength (SOS) — only after a bullish Change of Character (CHoCH) confirms that the prior downtrend has structurally broken. The indicator frames the active trading range as a shaded zone, plots SC and AR horizontal references, tracks the current phase (A, B, C, D, E) in a dedicated info panel, and introduces three accumulation-specific layers absent from the distribution companion: a Spring Quality Score, a Cause-to-Effect markup projection and a rolling volume footprint classifier.
🟢 COMPANION TO THE DISTRIBUTION PHASE MAP
This indicator is intentionally designed as the symmetric counterpart of Wyckoff Distribution Phase Map . The two scripts share a unified AGPro visual language and a CHoCH-gated reveal philosophy, but they operate on opposite market regimes and different event sets:
- Distribution map works on uptrends and draws PSY, BC, AR, UT, SOW and LPSY after a bearish CHoCH.
- Accumulation map works on downtrends and draws PS, SC, AR, ST, Spring, LPS and SOS after a bullish CHoCH.
- Distribution projects a potential markdown line from LPSY.
- Accumulation projects a Cause-to-Effect markup target from SOS.
- Accumulation additionally provides a 0-100 Spring Quality Score, which has no structural equivalent in the distribution schematic.
Both tools are standalone. Users running the full AGPro Wyckoff workflow can apply them together for complete cycle coverage, but neither depends on the other.
🟢 WHAT MAKES IT DIFFERENT
Most Wyckoff scripts on PulseWire react to every elevated swing low during a downtrend and label PS / SC / Spring on every modest dip. The result is a noisy chart, often with contradictory events stacked on top of each other. This indicator takes the opposite approach. During a qualified downtrend, the chart remains completely clean. Rolling trackers silently maintain candidate values for SC, PS and AR in memory, while a live Watching row in the panel shows what the engine is currently monitoring. Events are only drawn on the chart after a bullish CHoCH locks the schematic, at which point PS, SC and AR appear together as a confirmed retrospective bundle. ST, Spring, LPS and SOS then populate as post-CHoCH structure unfolds. A multi-tier expiry system closes both incomplete and fully-played-out accumulations, ensuring the active schematic on screen always reflects current market structure and not stale history.
🟢 METHODOLOGY
The engine runs in three coordinated layers.
Layer one qualifies a prior downtrend. A valid Wyckoff accumulation precondition requires four concurrent factors: structural lower highs and lower lows, a minimum ATR-multiple depth from the lookback-window high, a duration sustained across the full lookback window, and price currently located in the lower portion of that window. All four conditions must hold before any candidate can form.
Layer two rolls candidate values during that qualified downtrend. SC candidate is the running lowest pivot low with elevated or climactic volume. PS candidate is the prior elevated swing low that predates the SC. AR candidate is the highest post-SC swing high that remains within a structurally reasonable distance from SC. Candidates are automatically invalidated if price drifts far above the SC without a structural break or if the candidate ages beyond a configurable maximum.
Layer three watches for a bullish Change of Character, defined as the first bar that closes above the qualified AR candidate. On CHoCH confirmation, PS, SC and AR are snapshotted as labeled events, the trading range is drawn, and the state machine advances to forward detection. ST, Spring, LPS and SOS are then detected in sequence using a combination of price-to-SC, price-to-AR and volume-to-average filters. Volume context is computed against a configurable moving-average baseline with separate climactic, elevated and weak thresholds.
The Spring Quality Score blends four components into a 0-100 rating: penetration depth below SC, volume dry-up on the sweep bar, recovery strength measured by close position within the candle range, and close location relative to SC. The Cause-to-Effect projection draws a symmetrical markup target from the SOS bar using the trading range height.
🟢 SIGNALS AND ALERTS
The indicator fires three categories of alerts, all reserved for confirmed structural events:
- CHoCH Confirmation alert triggers when the structural break locks in, including the resolved SC and AR levels.
- Spring alert fires when the Spring is detected, including the Spring Quality score.
- Sign of Strength alert fires when SOS confirms with climactic volume above AR.
No alerts are emitted during the forming phase. This keeps notification volume low and focused on decisive structural moments.
🟢 KEY INPUTS
Core Engine inputs control swing lookback sensitivity, candidate maximum age, post-CHoCH timeout, prior downtrend lookback, minimum downtrend depth in ATR multiples, and the near-lows threshold used in downtrend qualification. Volume Analysis exposes the moving-average length and three separate multipliers for climactic, elevated and weak volume classification. Visual inputs toggle the trading range zone, SC and AR horizontal levels, the CHoCH dashed break line, the Cause-to-Effect projection, the floating summary label and the keep-historical-events mode, with full control over font size and zone transparency. The info panel can be repositioned to six anchor points and switched between dark and light themes.
🟢 HOW TO USE
Apply the indicator to any liquid instrument and any timeframe. During downtrends, observe the Watching row in the panel to monitor the forming SC candidate. When CHoCH prints, the full PS, SC and AR bundle appears and the trading range is shaded. From that point, use the Next Expected row to track what the engine is waiting for. The Confidence score progresses from 70 at CHoCH to 97 at SOS. The Spring Quality Score becomes populated when a Spring is detected and quantifies the character of the sweep. The Volume Footprint row rolls through Range forming, Supply exhausting, Weak hands shaken, Supply absorbed and Demand in control as the schematic matures. The floating summary label on the right edge of the chart provides an at-a-glance status even when the primary event labels are scrolled off to the left. The indicator works standalone but is designed to complement any market structure, order flow or supply-and-demand workflow.
🟢 LIMITATIONS AND TRANSPARENCY
This tool is a pattern-recognition and labeling engine, not a strategy or a trading signal generator. All events are detected retrospectively after their confirming bar has closed plus the swing lookback period. This is by design to eliminate redrawing. The Wyckoff schematic is a framework, not a deterministic forecast. Not every accumulation completes the full seven-event sequence, and markets frequently fail schematics entirely and resume the prior downtrend. The volume analysis assumes reliable reported volume, so thin or fragmented markets may produce weaker classification. The Spring Quality Score and Confidence score are internal heuristics tied to event progression and are not statistical probabilities. The Cause-to-Effect projection is a classical Wyckoff reference line derived from range height, not a mechanical target guaranteed to be reached. Past schematic completions do not predict future market behavior.
🟢 RISK DISCLOSURE
This indicator is published for educational and analytical purposes only. It does not constitute financial advice, a trading recommendation or an investment solicitation. Trading any financial instrument involves substantial risk, including the potential loss of principal. Past performance does not guarantee future results. Users are solely responsible for their own trading decisions, risk management and independent research. Always backtest thoroughly and trade within a risk framework you understand. Indicator

Wyckoff Distribution Phase Map [AGPro Series]Wyckoff Distribution Phase Map
🔹 OVERVIEW
Wyckoff Distribution Phase Map is a retrospective structural mapping tool built on the classic Wyckoff distribution schematic. It locates and labels the six core distribution events — Preliminary Supply (PSY), Buying Climax (BC), Automatic Reaction (AR), Upthrust (UT), Sign of Weakness (SOW) and Last Point of Supply (LPSY) — only after a bearish Change of Character (CHoCH) confirms that the prior uptrend has structurally broken. The indicator frames the active trading range as a shaded zone, plots BC and AR horizontal references, and tracks the phase state (A, B, C, D, E) in a dedicated info panel with a forming-candidate watchlist before confirmation.
🔹 WHAT MAKES IT DIFFERENT
Most Wyckoff scripts on PulseWire label events reactively on every elevated swing, producing dense, often contradictory signals during ranging or trending markets. This indicator takes the opposite approach. During an uptrend, the chart remains completely clean. Rolling trackers silently maintain candidate values for BC, PSY and AR in memory, while a live watchlist row in the panel shows the forming distribution candidate in real time. Events are only drawn on the chart after CHoCH locks the schematic, at which point PSY, BC and AR appear together as a confirmed retrospective bundle. UT, SOW and LPSY then populate as the post-CHoCH structure unfolds. A two-tier expiry system closes both incomplete and fully-played-out distributions, ensuring the active schematic on screen always reflects current market structure — not stale history.
🔹 METHODOLOGY
The engine runs in two coordinated layers. The first layer tracks higher-high and higher-low sequences to qualify an uptrend and rolls candidate values for the Buying Climax (running maximum swing high), Preliminary Supply (last pre-BC elevated swing high) and Automatic Reaction (running minimum after BC). The second layer watches for a structural break below the last confirmed higher-low, which defines the CHoCH. On CHoCH confirmation, the candidate values are snapshotted as BC, PSY and AR labels, the trading range zone is drawn, and the state machine advances to the forward-detection phase. Upthrust, Sign of Weakness and Last Point of Supply are then detected in strict sequence using a combination of price-to-BC, price-to-AR and volume-to-average filters. Volume context is computed against a 20-period moving average baseline with separate climactic, elevated and weak thresholds tuned for crypto and equities alike.
🔹 SIGNALS AND ALERTS
The indicator fires two categories of alerts. The CHoCH Confirmation alert triggers the moment the structural break locks in, including the resolved BC and AR levels. Event alerts fire for each subsequent UT, SOW and LPSY detection. No alert is fired during the forming phase — alerts are reserved for confirmed structural events, keeping notification noise low. A projected markdown line is drawn forward from LPSY using the trading range height as a symmetrical target, purely as a visual reference point rather than a trade signal.
🔹 KEY INPUTS
Core Engine inputs control swing lookback sensitivity, candidate maximum age and the post-CHoCH timeout window. Volume Analysis exposes the moving average length and three multipliers for climactic, elevated and weak volume classification. Visual inputs toggle the trading range zone, BC and AR horizontal levels, the CHoCH dashed break line, the markdown projection, the confidence halo and the floating distribution summary label, with full control over font size, line widths and zone transparency. The info panel can be repositioned to six anchor points and switched between dark and light themes. A Keep Historical Events toggle allows old schematics to remain on the chart after reset, off by default for a clean view.
🔹 HOW TO USE
Apply the indicator to any liquid instrument and any timeframe. During uptrends, observe the Watching row in the panel to monitor the forming BC candidate. When CHoCH prints, the full PSY, BC, AR bundle appears with the trading range shaded. From that point, use the Next Expected row to track what the engine is waiting for. The confidence score progresses from 70 at CHoCH to 97 at LPSY. The floating summary label on the right edge of the chart provides an at-a-glance status even when the primary event labels are scrolled off to the left. The indicator works standalone but is designed to complement any market structure, order flow or supply-and-demand workflow.
🔹 LIMITATIONS AND TRANSPARENCY
This tool is a pattern-recognition and labeling engine, not a strategy or trading signal generator. All events are detected retrospectively after their confirming bar has closed plus the swing lookback period — this is by design to eliminate redrawing. The Wyckoff schematic is a framework, not a deterministic forecast; not every distribution completes the full six-event sequence, and markets frequently fail schematics entirely and resume the prior trend. The volume analysis assumes reliable reported volume, so thin or fragmented markets may produce weaker classification. Confidence scores are internal heuristics tied to event progression, not statistical probabilities. Past schematic completions do not predict future market behavior.
🔹 RISK DISCLOSURE
This indicator is published for educational and analytical purposes only. It does not constitute financial advice, a trading recommendation or an investment solicitation. Trading any financial instrument involves substantial risk, including the potential loss of principal. Past performance does not guarantee future results. Users are solely responsible for their own trading decisions, risk management and independent research. Always backtest thoroughly and trade within a risk framework you understand. Indicator

SMC Toolkit - CHoCH, BoS, FVG, P/D [AvantCoin]SMC Toolkit - CHoCH, BoS, FVG, P/D
A focused market structure indicator covering the four foundational SMC concepts in a single, configurable tool.
What it shows
CHoCH (Change of Character): marks the first break that reverses the prevailing trend.
BoS (Break of Structure): marks continuation breaks in the direction of the current trend.
FVG (Fair Value Gaps): highlights 3-candle imbalance zones, with automatic tracking of mitigation, time expiry, and structural invalidation.
Premium / Discount: plots the equilibrium of the current swing range, with optional zone shading to identify where price sits relative to the range.
**Settings**
Independent visibility toggles for CHoCH, BoS, FVG, and Premium/Discount, show only what you need.
Swing lookback and break confirmation mode (close or wick) for structure detection.
FVG mitigation mode (first touch or full fill), max extension in bars, and option to hide inactive gaps.
Fully customizable colors, line styles, and opacity for every element.
Built-in alerts for bullish and bearish CHoCH and BoS events.
Design principles
Every rule the indicator uses is documented in the script header. Pivots do not repaint, swings are consumed once broken, and signals are drawn on the bar of confirmation, what you see live is what you see in backtest.
Designed for clarity on any timeframe and any market.
Indicator

Indicator

Indicator

Regime & Structure Engine [JOAT]Regime & Structure Engine
Introduction
Markets do not move randomly — they cycle through defined behavioral states: trending phases where momentum compounds in one direction, and ranging phases where price consolidates before the next impulse. Identifying which state the market is currently in, and detecting when structural breaks signal a transition, is fundamental to any disciplined trading approach. The Regime & Structure Engine is built around that single core principle: before anything else, know your regime.
This indicator unifies three distinct analytical layers into a single overlay system. The first layer is the Hull-EMA Hybrid (HEMA), a custom moving average that resolves the trade-off between smoothness and responsiveness by combining double-weighted EMA calculation with a square-root length final smoothing. The second layer is a three-state confirmed regime engine that uses the relative alignment of three HEMA periods to classify market condition as bull, bear, or neutral — with a mandatory two-bar confirmation to eliminate false transitions. The third layer is a market structure engine based on classical swing pivot logic, capable of identifying Break of Structure (BOS) and Change of Character (CHoCH) events that signal genuine momentum shifts.
All of this is augmented by a Z-score cumulative impulse detector that quantifies the statistical significance of directional momentum streaks, a trend cloud that visually represents regime state through gradient fills, proximity-based bar coloring that encodes distance from the HEMA mid-layer, a configurable alert system, and a compact six-row dashboard. Every signal in this indicator is anchored to confirmed bars only, eliminating any look-ahead repainting.
Core Concepts
1. Hull-EMA Hybrid (HEMA) Moving Average
The foundational calculation of this indicator is the HEMA — a three-step smoothing function that delivers both noise reduction and lag compensation. A standard EMA applies uniform smoothing that creates meaningful lag on higher periods. Hull Moving Averages address lag through weighted differencing but can produce jagged outputs. The HEMA bridges this by constructing the Hull-style weighted difference first, then applying a square-root-period EMA as the final smoother.
f_hema(src, len) =>
ta.ema(2 * ta.ema(src, len / 2) - ta.ema(src, len), math.round(math.sqrt(len)))
Three instances are calculated at lengths 20, 50, and 100, producing a fast, slow, and macro trend layer respectively. The fast layer reacts to short-term price action, the slow layer represents the primary trend, and the macro layer anchors the broader structural bias. When all three are aligned in sequence (fast above slow above macro, or inverse), the trend is considered directionally clean.
2. Three-State Confirmed Regime Engine
Regime classification is determined by the ordinal alignment of all three HEMA layers. A raw bull signal requires hema1 greater than hema2, which must in turn be greater than hema3. The inverse defines raw bear. Any other arrangement is classified as neutral. To prevent rapid regime flipping on borderline conditions, a two-bar confirmation requirement is enforced: the raw signal must hold for at least two consecutive bars before the confirmed regime variable updates.
rawBull = hema1 > hema2 and hema2 > hema3
rawBear = hema1 < hema2 and hema2 < hema3
var int confirmCount = 0
var int confirmedRegime = 0
if rawBull
confirmCount := confirmCount + 1
else if rawBear
confirmCount := confirmCount - 1
else
confirmCount := 0
confirmedRegime := confirmCount >= 2 ? 1 : confirmCount <= -2 ? -1 : 0
This confirmation mechanism is critical in volatile markets where HEMA layers can briefly reorder on a single candle only to revert immediately. The two-bar requirement sacrifices minimal reaction speed in exchange for a meaningful reduction in false regime transitions.
3. Z-Score Cumulative Impulse Detection
Regime direction tells you the structural bias. The Z-score impulse system tells you when that bias is being expressed with statistical force. Rather than measuring a single bar's momentum, this system accumulates consecutive directional closes into a running streak — a cumulative bull or bear pressure counter — then normalizes that streak against its own historical mean and standard deviation.
cumBull = close > close ? nz(cumBull ) + (close - close ) : 0
cumBear = close < close ? nz(cumBear ) + (close - close) : 0
zBull = (cumBull - ta.sma(cumBull, zLen)) / ta.stdev(cumBull, zLen)
zBear = (cumBear - ta.sma(cumBear, zLen)) / ta.stdev(cumBear, zLen)
impulseUp = ta.crossover(zBull, zThresh) and barstate.isconfirmed
impulseDn = ta.crossover(zBear, zThresh) and barstate.isconfirmed
An impulse fires when the Z-score exceeds the user-defined threshold (default: 2.0 sigma). This ensures that only statistically unusual momentum streaks generate signals, filtering out the ordinary ebb and flow of price during low-conviction moves.
4. BOS and CHoCH Market Structure
Market structure tracking is built on classical pivot high/low detection using Pine Script's built-in ta.pivothigh and ta.pivotlow functions. A Break of Structure (BOS) occurs when price closes or wicks beyond the most recent swing high (bullish BOS) or swing low (bearish BOS). A Change of Character (CHoCH) is a BOS that opposes the direction of the prior BOS — indicating a potential regime reversal rather than continuation.
swingHigh = ta.pivothigh(high, swingLen, swingLen)
swingLow = ta.pivotlow(low, swingLen, swingLen)
lastSwingHigh = ta.valuewhen(not na(swingHigh), swingHigh, 0)
lastSwingLow = ta.valuewhen(not na(swingLow), swingLow, 0)
bosUp = barstate.isconfirmed and ta.crossover(close, lastSwingHigh)
bosDn = barstate.isconfirmed and ta.crossunder(close, lastSwingLow)
chochUp = bosUp and lastBOSDir == -1
chochDn = bosDn and lastBOSDir == 1
CHoCH events are particularly significant because they represent the market's first structural evidence of a trend change — not merely a continuation of prior momentum. Distinguishing BOS from CHoCH allows traders to calibrate their response: a BOS in trend direction is a continuation entry opportunity, while a CHoCH warrants reassessment of existing positions.
5. Trend Cloud and Proximity Bar Coloring
The trend cloud fills the space between the HEMA fast and slow layers. The fill color matches the confirmed regime — teal for bull, red for bear, gray for neutral — creating an immediate visual encoding of market state across the chart. Bar coloring is driven by a normalized proximity calculation using the 14-period ATR as a reference distance.
normProx = math.abs(close - hema2) / (atr14 * 3)
barAlpha = math.min(math.round(normProx * 200), 200)
Bars that are far from the HEMA slow layer receive more saturated coloring, while bars trading near the HEMA mid-line are rendered at reduced opacity. This creates an intuitive gradient where extreme dislocations are visually prominent.
Features
HEMA Triple Layer: Three independent Hull-EMA Hybrid instances at periods 20, 50, and 100 provide fast, primary, and macro trend context simultaneously.
Confirmed Regime State: Two-bar confirmation gate prevents false regime transitions on temporary HEMA crossovers, reducing noise on volatile instruments.
BOS Detection: Swing-based Break of Structure signals on both bullish and bearish side, drawn at confirmed bars only with no look-ahead.
CHoCH Detection: Change of Character identification when BOS direction opposes the prior structural break, highlighting potential trend reversal zones.
Z-Score Impulse: Statistically normalized cumulative momentum streaks that fire signals only when directional pressure reaches a configurable sigma threshold.
Gradient Trend Cloud: Dynamic fill between HEMA layers color-coded by regime for instant visual orientation on any timeframe.
Proximity Bar Coloring: ATR-normalized distance from HEMA mid controls bar color alpha, making dislocations visually distinct.
Six-Row Dashboard: Compact table displaying regime, last BOS direction, bull Z-score, bear Z-score, and HEMA layer alignment.
No Repainting: All signals gated behind barstate.isconfirmed — no signals are printed on unfinished bars.
Full Alert Coverage: Seven alert conditions covering BOS, CHoCH, impulse, and regime flip events.
Input Parameters
HEMA Settings:
Fast Length: Period for the HEMA fast layer (default: 20)
Slow Length: Period for the HEMA slow layer (default: 50)
Macro Length: Period for the HEMA macro layer (default: 100)
Source: Price source for all HEMA calculations (default: close)
Regime Settings:
Confirmation Bars: Number of consecutive bars required to confirm a regime change (default: 2)
Structure Settings:
Swing Length: Pivot lookback for swing high/low detection (default: 10)
Show BOS Labels: Toggle BOS annotation labels on the chart (default: true)
Show CHoCH Labels: Toggle CHoCH annotation labels on the chart (default: true)
Z-Score Settings:
Z Lookback: Rolling window for Z-score mean and standard deviation (default: 50)
Z Threshold: Sigma level required to fire an impulse signal (default: 2.0)
Display Settings:
Show Trend Cloud: Toggle the gradient fill between HEMA layers (default: true)
Show Bar Colors: Toggle proximity-based bar coloring (default: true)
Show Dashboard: Toggle the six-row information table (default: true)
How to Use This Indicator
Step 1: Establish Regime Context
Before analyzing any signal, check the dashboard and the trend cloud to identify the confirmed regime. A bull regime (all three HEMA layers in ascending order with a teal cloud) means the structural bias favors long positions. A bear regime (descending alignment with a red cloud) favors shorts. A neutral regime suggests consolidation — reduce position sizing or stand aside. The regime confirmation requirement means the dashboard will update one to two bars after alignment begins, giving you a cleaner entry rather than reacting to the first crossover.
Step 2: Wait for Structure to Break
Within the context of the confirmed regime, watch for BOS events in the trend direction. A bullish BOS during a bull regime is a continuation structure signal — it means price has broken above a prior swing high, suggesting the up-trend is extending. A bearish BOS during a bull regime, especially if classified as a CHoCH, is your first warning that the structure may be shifting. Use the BOS labels on the chart to track the sequence of structural breaks over time.
Step 3: Confirm with Z-Score Impulse
A BOS or CHoCH becomes significantly more actionable when accompanied by a Z-score impulse signal in the same direction. When the cumulative bull streak normalized to 2+ sigma fires at the same time as or immediately following a bullish BOS, the move is backed by sustained directional momentum — not a single large candle. When regime, structure, and impulse all align, the signal quality is at its highest.
Step 4: Manage Position with HEMA Proximity
Once in a position, the proximity bar coloring helps manage exits. Bars that are far from HEMA mid (highly saturated) represent extended conditions — areas where mean reversion risk is elevated. Bars near HEMA mid are in equilibrium. Exits on strength (closing during a high-saturation bullish bar after a BOS continuation trade) allow for locking in gains at points of extension rather than waiting for a reversal to develop.
Indicator Limitations
The two-bar regime confirmation introduces a brief delay relative to the actual HEMA crossover. On fast-moving instruments, this can mean a slightly later entry but provides meaningful protection against false transitions.
BOS detection is based on prior swing highs and lows defined by the swing length parameter. On very low swing length settings, minor highs and lows will be used as structure levels, potentially generating frequent BOS events of less structural significance.
Z-score impulse requires a sufficient lookback to establish a stable mean and standard deviation for the cumulative streak. In the first Z-lookback bars of any chart, signals may be less statistically reliable as the normalization period is not fully seeded.
The HEMA and all derivative signals are calculated on the chart's native timeframe. This indicator does not internally pull higher timeframe data — users who want multi-timeframe regime context should reference signals from higher timeframe chart instances.
Like all trend-following tools, this indicator will produce whipsaw signals in choppy, range-bound markets where neither bulls nor bears sustain momentum long enough to trigger clean regime confirmation.
Proximity bar coloring uses ATR as a normalizer. During volatility regime shifts (e.g., sudden spike in ATR), the alpha thresholds may temporarily misrepresent proximity distance.
Originality Statement
The Regime & Structure Engine is not a repackaging of any single existing indicator. It is a purpose-built synthesis of methodologies that individually exist in various forms but have not been combined in this specific architecture.
The HEMA function (Hull-inspired double-weighted EMA followed by square-root-period smoothing) is a custom construction that differs from both standard HMA and standard EMA in its layering approach and final smoothing step.
The three-state confirmed regime engine with mandatory multi-bar confirmation is an original state machine design. Most indicators display regime as a simple crossover condition; this system enforces a holding period before state transition.
The Z-score cumulative impulse system measures the statistical significance of a directional streak rather than the magnitude of a single bar move. This normalization approach — accumulating consecutive closes and comparing against rolling sma/stdev — is not a standard oscillator pattern.
The combination of HEMA-based regime with classical BOS/CHoCH structural analysis on top of Z-score momentum creates a three-dimensional signal framework that no single publicly available indicator replicates.
The proximity bar coloring system using ATR-normalized distance to the HEMA mid layer as the alpha channel driver is an original visual encoding not found in standard bar coloring implementations.
Disclaimer
The Regime & Structure Engine is provided for educational and informational purposes only. It is a technical analysis tool and does not constitute financial advice. Past behavior of price relative to indicator signals does not guarantee future results. All trading involves risk, including the potential loss of principal. Users are solely responsible for their own trading decisions. Always conduct your own due diligence and consider consulting a licensed financial professional before making any investment decisions.
-Made with passion by officialjackofalltrades
Indicator

AG Pro BOS & CHoCH Auto Detector [AGPro Series]AG Pro BOS & CHoCH Auto Detector
OVERVIEW / WHAT IT DOES
AG Pro BOS & CHoCH Auto Detector is a market structure overlay designed to organize swing-based price action into a more readable workflow. Instead of leaving the chart covered with disconnected pivot labels or generic break markers, this script tracks structural swing progression, identifies when prior highs or lows are broken, and classifies those breaks as either BOS (Break of Structure) or CHoCH (Change of Character). The goal is not to predict the next move, but to help traders read whether price is continuing an existing structure or beginning to challenge it.
The script monitors HH, HL, LH, and LL development using pivot logic, then uses those reference points to detect structural breaks. A break in the direction of the active structure is treated as BOS, while the first meaningful break against the prior directional structure is treated as CHoCH. This distinction matters because many charts show every break in the same visual language, even though continuation and character shift do not carry the same analytical meaning. Here, those events are separated clearly.
A second layer of usefulness comes from presentation discipline. This script is built to keep structural information visible without turning the chart into a wall of labels. Swing density can be reduced, major structures can be emphasized, and the higher timeframe overlay can remain active in the background to keep local execution aligned with broader structure. The result is a structure map that stays informative without becoming visually noisy.
This tool is intended for traders who already use price structure as part of their chart reading and want a cleaner way to monitor continuation versus transition. It can support discretionary workflows around trend continuation, pullback analysis, structure failure, and higher timeframe context, while still remaining transparent about how its signals are formed.
UNIQUE EDGE
Many market structure tools stop at plotting swing points or printing BOS / CHoCH text when a level is crossed. AG Pro BOS & CHoCH Auto Detector is built around a more organized structure engine approach.
Its edge is not based on trying to forecast direction or force trade entries. Its edge is based on classification, hierarchy, and chart readability:
- It separates continuation breaks from character-change breaks instead of treating all structural violations as equivalent.
- It preserves the swing chain context behind each event, so BOS and CHoCH are not isolated labels detached from surrounding structure.
- It allows confirmation mode selection, so the user can decide whether structure breaks require close confirmation or can react to intrabar violations.
- It includes higher timeframe structure context directly on the chart rather than forcing the user to reconstruct that context manually.
- It includes swing-density controls so the visual output can be kept clean even when structure is active.
This makes the script less like a simple labeling utility and more like a workflow layer for structure-based chart reading.
METHODOLOGY
1) Swing Structure Detection
The script uses pivot-based highs and lows to identify structural reference points. Those pivots are then classified into HH, HL, LH, and LL sequences, allowing the chart to reflect whether structure is strengthening, weakening, or transitioning.
2) BOS Logic
When price breaks a prior structural level in the direction of the active trend, the event is labeled as BOS. In practical terms, this represents structural continuation rather than directional reversal.
3) CHoCH Logic
When price breaks against the previously established directional structure, the event is labeled as CHoCH. This is treated as a possible character shift, not as a guaranteed reversal. It highlights that the prior structure has been challenged.
4) Confirmation Mode
Users can choose whether structure breaks are confirmed by candle close or by intrabar price action. Close mode is more conservative and can reduce noise. Intrabar mode is more responsive and may show earlier breaks.
5) Higher Timeframe Overlay
An optional MTF layer allows the script to bring higher timeframe structure context onto the active chart. This can help users avoid reading local swings in isolation when broader structure is still dominant.
6) Visual Hierarchy
The script uses horizontal structure levels, event labels, optional arrows, controlled swing density, and a compact information panel to keep key structure events readable. The design priority is to preserve analytical clarity.
SIGNALS & ALERTS
This script can generate structure-based alerts for the following event types:
- Bullish BOS
- Bearish BOS
- Bullish CHoCH
- Bearish CHoCH
- Any structure break
These alerts are event-driven and tied to the script's structural logic. They are intended to notify the user when a relevant break occurs according to the selected confirmation mode. They are not trade instructions and should be interpreted within the user's broader process.
KEY INPUTS
Swing Pivot Length
Controls pivot sensitivity. Lower values detect swings faster but may produce more noise. Higher values are more selective.
Confirmation Mode
Choose between Close and Intrabar logic for structure break confirmation.
Max Structures to Show
Limits how many structural events remain plotted on the chart.
Swing Label Density
Lets users choose between fuller swing annotation and a cleaner major-structure view.
Max Swing Labels on Chart
Helps prevent excessive label build-up in active market conditions.
Enable MTF Overlay
Adds higher timeframe structure context to the active chart.
MTF Timeframe
Defines which higher timeframe structure layer is projected onto the chart.
Label Size / Panel Font Size / Line Settings
Allow visual tuning without changing structural logic.
LIMITATIONS & TRANSPARENCY
This script uses pivot-based structure logic. That means swing points are confirmed only after the required pivot bars are completed. Because of this, the tool is confirmation-based by design and does not attempt to label unfinished pivots as confirmed structure.
BOS and CHoCH are structural events, not certainty statements. A CHoCH may signal that the prior directional structure is being challenged, but it does not guarantee a lasting reversal. Likewise, a BOS indicates continuation within the script's structural framework, but not guaranteed follow-through.
The higher timeframe overlay is designed to add context, not to replace direct higher timeframe chart review. Users should still interpret local and higher timeframe structure together rather than relying on a single signal state.
This script is best used as a structure-mapping tool within a broader analytical framework. It is not a standalone trading system, not a predictor, and not a substitute for risk management.
RISK DISCLOSURE
This indicator is for chart analysis and educational use. It does not provide financial advice, does not guarantee outcomes, and should not be treated as a complete trading methodology on its own. Market structure tools can help organize price action, but all trading decisions remain the responsibility of the user.
Indicator

BOS Adaptive Structure Average (Zeiierman)█ Overview
BOS Adaptive Structure Average (Zeiierman) is a structure-aware trend framework that blends market structure logic with an adaptive moving average and directional cloud visualization. Rather than treating all price movements equally, the indicator reacts to confirmed Break of Structure (BOS) and Change of Character (ChoCH) events, using them to dynamically adjust the average's responsiveness and directional bias.
The result is a smoother trend tool that does not rely only on price slope, but also incorporates structural confirmation. Alongside the adaptive average, the script tracks live structural highs and lows, scores their relative strength, and visualizes directional bias through a cloud that expands around the average. This creates a more contextual trend model that helps map both current momentum and active market structure.
█ How It Works
⚪ Structure Engine 1: BOS / ChoCH Detection
The first structure engine identifies pivot highs and pivot lows using a configurable pivot length. Once a pivot is established, the script monitors whether the price breaks above the active high or below the active low.
A break above the tracked high triggers a bullish structural event.
A break below the tracked low triggers a bearish structural event.
Each event is labeled either as:
BOS when it continues the current structural direction
ChoCH when it breaks against the prior structure state and signals a regime shift
This state is stored internally and becomes the foundation for the adaptive behavior of the average.
structText(os, isBull) =>
isBull ? (os == -1 ? "ChoCH" : "BOS") : (os == 1 ? "ChoCH": "BOS")
⚪ Adaptive Average Core
At the center of the indicator is a dynamic average that adjusts its response speed using structure activity.
The script converts BOS events into a directional impulse:
bullish BOS → positive impulse
bearish BOS → negative impulse
This impulse is smoothed into:
bosAct = activity strength
bosBias = directional pressure
Those values control how quickly the average reacts and how strongly it gets pushed in the active structure direction. When the structure activity is quiet, the average behaves more slowly. When structure becomes active, it accelerates and leans into the prevailing directional break.
bosImp = bullBos1 ? 1.0 : bearBos1 ? -1.0 : 0.0
bosAct = ta.rma(math.abs(bosImp), 20)
bosBias = ta.rma(bosImp, 20)
alpha = aSlow + (aFast - aSlow) * bosAct
This produces a trend line that is both smoother than the raw price and more structurally aware than a standard moving average.
⚪ Multi-Speed Internal Average Stack
The adaptive average is not built from just one line. Internally, the script calculates five related adaptive components using different multipliers, creating a fast-to-slow response stack around the same structural core.
⚪ Structure Midpoint Anchoring
To keep the average tied to evolving market structure rather than drifting too freely with price, the script also uses the midpoint between the current active structure high and low as an anchor.
This midpoint acts as a stabilizing force. When the structure is well-defined, the internal averages are gently pulled back toward the structural center, helping the line remain more aligned with the active price framework.
mid = na(hi1) or na(lo1) ? na : (hi1 + lo1) / 2.0
anchW = 0.20 * bosAct
⚪ Live High / Low Structure Strength Model
The second structure engine tracks broader live highs and lows using a separate pivot length. These are not plotted as static levels — the script scores them based on the sequence of BOS and ChoCH events generated by Structure Engine 1.
Weights used in the current code:
ChoCH = 1
BOS = 3
These points are accumulated into bullish and bearish buckets for both the live high and live low. The net values are then translated into simple strength labels:
Weak
Medium
Strong
This creates a live read on whether the current high is stronger resistance or the current low is stronger support.
So the indicator is not only tracking structure breaks, but also maintaining a running estimate of how structurally strong the current high and low levels are.
⚪ Directional Cloud Model
This version uses a layered cloud derived from the adaptive average.
The main adaptive line is b3. That line is smoothed and then compared to a short EMA reference of hlc3 to create intermediate cloud layers between the adaptive line and the reference line. This produces a graded visual zone that reflects both slope and price relationship.
█ How to Use
⚪ Follow Trend Bias Through the Adaptive Average
Use the main adaptive line and cloud to quickly read market direction:
Bullish cloud + rising average → uptrend
Bearish cloud + falling average → downtrend
Flat, mixed, or narrow cloud → consolidation/indecision
Because the average reacts to structure (BOS/ChoCH) instead of just price movement, it tends to give a clearer trend read than standard moving averages, especially in structurally driven markets.
⚪ Use BOS / ChoCH for Regime Shifts
The BOS and ChoCH labels are useful for identifying when the structure is continuing versus when it is changing character.
ChoCH suggests a meaningful break against prior structure and may indicate an early regime shift.
BOS suggests continuation in the active structural direction
This makes the indicator useful not only for trend following but also for spotting when a prior directional assumption may be weakening.
⚪ Map Live Support and Resistance Strength
The live High / Low lines and their strength labels help frame the current structure map.
A Strong High suggests overhead resistance is being reinforced by bearish structure.
A Strong Low suggests support is being reinforced by bullish structure.
Weak readings suggest the level is less structurally defended.
This can be useful for filtering breakout expectations, fade setups, or risk placement around active market boundaries.
█ Settings
Fast Response Length – Controls how quickly the adaptive average reacts during active structure conditions. Lower values make the fast side of the average more responsive.
Slow Response Length – Controls the baseline smoothness of the adaptive average when structure activity is low. Higher values slow the line down and reduce noise.
BOS Directional Push – Adds directional pressure to the adaptive average using smoothed BOS bias and ATR. Higher values increase directional drift after structural confirmation.
Pivot Length (Structure Engine 1) – Defines how sensitive the BOS / ChoCH engine is. Lower values generate more structure events; higher values focus on broader swings.
Pivot Length (Structure Engine 2) – Defines the broader live high/low structure map. Higher values create more stable but less reactive levels.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Indicator

Structure Retest Engine Delta HybridDescription
Structure Retest Engine Delta Hybrid is a price action tool designed to identify structural shifts (CHoCH) and evaluate their retests using a relative volume delta proxy.
While many structure tools focus only on price location, this script adds a momentum-context layer to help judge whether a breakout appears stronger or weaker when price returns to the level.
--- HOW IT WORKS ---
The engine follows a 4-step process before an entry signal is generated:
1. Structure Shift (CHoCH)
The script identifies a Change of Character when price breaks a significant swing pivot from the opposite trend.
2. Breakout Conviction
Using a relative volume delta proxy, the script captures the momentum profile of the breakout bar. Stronger breakout conditions are marked with a "+" or "⚡", while weaker conditions are marked with a "-".
3. Departure Rule
Unlike basic retest scripts, this engine requires price to clearly leave the level area before a retest can be validated. This helps reduce noise from signals that appear during the initial breakout phase.
4. Hybrid Confirmation
When price returns to the level, the script tracks cumulative delta-proxy behavior during the retest. An entry is only triggered if price respects the level and satisfies the selected confirmation mode:
Touch, Close Outside Level, or Engulfing.
--- DELTA SENTIMENT TAGS ---
Entry labels can include sentiment tags to help judge the quality of the retest:
⚡ = stronger breakout context and retest flow supporting the trend
~ = mixed context
? = weaker or opposing retest sentiment
These tags are context markers, not guarantees of continuation or failure.
--- KEY FEATURES ---
Customizable Confirmation
Choose between Touch, COL (Close Outside Level), or ENG (Engulfing) to match your preferred entry style.
Retest Sensitivity
Adjust the ATR-based proximity buffer to define how close price must come to the level to qualify as a retest.
Departure Logic
Requires price to leave the level area before a new retest entry can be considered.
Visual Clarity
Includes optional CHoCH and Entry triangles, dashed break-level lines, floating entry text, and trend-based bar coloring.
Delta Proxy Context
Adds a relative volume delta proxy to estimate breakout conviction and retest sentiment. This is a candle-and-volume efficiency model, not true bid/ask delta or footprint data.
Alerts
Includes separate alert toggles for CHoCH events and entry confirmations.
--- SETTINGS ---
Pivot Length
The number of bars required on each side to confirm a swing point.
Run Away Threshold
Adjusts the sensitivity of the breakout conviction model relative to recent delta-proxy activity.
Confirmation Mode
Selects how the retest must confirm before an entry is printed.
Entry and CHoCH Visual Controls
Triangle size, text size, and text offset can all be adjusted for readability.
DISCLAIMER
This script is for educational and analytical purposes only.
It is a confirmation and context tool, not a prediction engine.
Past performance does not guarantee future results.
Always use proper risk management. Indicator

Imbalance Cartograph [JOAT]Imbalance Cartograph
Introduction
The Imbalance Cartograph is an advanced open-source price imbalance mapping engine that identifies, tracks, and manages Fair Value Gaps (FVGs) and Supply/Demand zones across multiple layers. It goes far beyond basic FVG detection by adding auto-mitigation, volume filtering, transparency fade for aging zones, stacked imbalance detection, confluence highlighting, nearest zone radar, imbalance density scoring, and a comprehensive 15-row dashboard. Every zone is non-repainting and drawn only on confirmed bars.
The core idea is simple but powerful: institutional order flow creates imbalances in price delivery. These imbalances — gaps where price moved too fast for the market to fill, and zones where large orders were placed — act as magnets that price tends to revisit. By mapping all active imbalances and tracking their lifecycle, traders can identify high-probability areas where institutional interest exists.
Why This Indicator Exists
Fair Value Gaps and Supply/Demand zones are among the most discussed concepts in Smart Money methodology, yet most indicators that detect them are simplistic: they draw a box when a gap forms and leave it there indefinitely, with no lifecycle management, no volume confirmation, and no way to assess how many imbalances are clustered near current price.
The Imbalance Cartograph solves these problems by treating imbalances as living entities with a full lifecycle:
Creation: FVGs are detected using the standard three-candle gap pattern, but filtered by volume (only gaps formed on above-average volume qualify by default). Supply/Demand zones are created at swing pivots using configurable pivot lengths.
Aging: Older zones progressively fade in transparency, giving visual priority to fresh zones while keeping historical context visible.
Testing: When price returns to a zone, it transitions from "fresh" to "tested" with a color change, indicating the zone has been challenged but not broken.
Mitigation: FVGs are automatically deleted when price fills the gap completely. Supply zones broken by price can convert to breaker blocks (polarity flip).
Confluence: When an FVG overlaps with a Supply/Demand zone, the overlap area is highlighted as a high-probability confluence zone.
Layer 1: Fair Value Gaps
FVGs represent gaps in price delivery where the market moved so aggressively that it left unfilled space between candles. The indicator detects both bullish and bearish FVGs:
Bullish FVG: Current candle's low is above the candle-two-bars-ago's high, and the middle candle closed above that high. This creates an upward gap in price delivery.
Bearish FVG: Current candle's high is below the candle-two-bars-ago's low, and the middle candle closed below that low. This creates a downward gap.
Each FVG is drawn as a colored box extending forward (default 50 bars) with optional price labels showing the exact gap range.
Volume Filter: When enabled (default), FVGs only qualify if the middle candle's volume exceeds the 20-bar average. This filters out low-conviction gaps that are less likely to act as institutional reference points.
Auto-Mitigation: When enabled (default), FVGs are automatically deleted when price fills the gap. For bullish FVGs, this means price's low touches the top of the gap. For bearish FVGs, price's high reaches the bottom. The indicator tracks mitigation counts for the dashboard.
Stacked Imbalance Detection: When two or more consecutive FVGs form in the same direction, the indicator marks them as "STACKED" with a count. Stacked FVGs indicate sustained institutional pressure — the market is creating gap after gap in the same direction, which is a strong directional signal.
Layer 2: Supply and Demand Zones
Supply and Demand zones are created at swing pivot points detected using ta.pivothigh() and ta.pivotlow() with a configurable pivot length (default 10 bars).
Supply Zones: Created at swing highs. The zone extends from the swing high candle's high down to the candle body (max of open, close). These represent areas where selling pressure overwhelmed buying.
Demand Zones: Created at swing lows. The zone extends from the swing low candle's low up to the candle body (min of open, close). These represent areas where buying pressure overwhelmed selling.
Zone Lifecycle:
Fresh: Newly created zone, bright color, never tested
Tested: Price has returned to the zone but not broken through. Color shifts to indicate the zone has been challenged.
Broken/Breaker: When price breaks through a zone completely, it can optionally convert to a "breaker block" — the zone flips polarity (old supply becomes potential demand, and vice versa). This is a key Smart Money concept.
Overlap Prevention: New zones are checked against existing zones using an ATR-based threshold. If a new zone would overlap with an existing one, it is not drawn, keeping the chart clean.
BOS Lines: When price breaks through a supply or demand zone, a Break of Structure (BOS) line is drawn at the broken level, marking the structural shift.
Transparency Fade: When enabled, older zones gradually become more transparent based on their age in bars. This creates a natural visual hierarchy where fresh zones stand out and old zones fade into the background.
Advanced Features
Imbalance Confluence Detection:
The indicator checks whether any active FVG overlaps with any active Supply/Demand zone. When they overlap, the confluence area is highlighted with a gold-colored marker. These confluence zones represent areas where two independent institutional concepts agree — a gap in price delivery coincides with a structural supply or demand level. These are among the highest-probability zones on any chart.
Nearest Zone Radar:
The indicator continuously calculates the distance from current price to the nearest active zone (supply or demand). The dashboard displays the zone type, distance in ATR multiples, and direction. This gives traders an instant read on how close they are to the next potential reaction area.
Imbalance Density:
The indicator counts how many active FVGs and S/D zones exist within 3 ATR of current price and produces a density score (0-10). High density means price is surrounded by multiple imbalances — a "thick" area where reactions are likely. Low density means price is in "clean" territory with fewer institutional reference points.
15-Row Dashboard
Rows 1-2: Bull FVG and Bear FVG counts with stacked status
Rows 3-4: Supply and Demand zone counts with lifecycle state (Fresh/Tested)
Row 5: Breaker block count
Row 6: FVG fill rate (percentage of FVGs that have been mitigated)
Row 7: Nearest zone type, distance, and direction
Row 8: Imbalance density score and classification
Row 9: Confluence detection status (active/none)
Row 10: Stacked imbalance status
Row 11: Zone age (average bars since creation for active zones)
Row 12: Supply retest count and demand retest count
Row 13: Market bias based on imbalance distribution (more bull FVGs + demand = bullish)
Rows 14-15: Total FVG and zone statistics
Input Parameters
Fair Value Gaps:
Show FVGs (default on), FVG Extend bars (default 50), Max FVGs Displayed (default 15)
Auto-Mitigate FVGs (default on) — delete when price fills the gap
Volume Filter (default on) — only show FVGs with above-average volume
Supply / Demand Zones:
Show Zones (default on), Pivot Length (default 10), Max Zones (default 15)
Show BOS Lines (default on), Convert to Breaker (default on)
Fade Old Zones (default on) — transparency increases with age
Advanced Features:
Show Confluence Zones (default on), Show Stacked Imbalances (default on)
Show Price Labels on Zones (default on)
How to Use This Indicator
Step 1: Identify Active Imbalances
Look at the chart for active FVG boxes and S/D zones. Fresh zones (brighter colors) are more likely to produce reactions than tested or faded zones.
Step 2: Check Imbalance Density
The dashboard's density score tells you whether price is in a zone-rich or zone-poor area. High density (7+) means multiple imbalances are nearby — expect reactions. Low density (0-2) means price is in clean delivery territory.
Step 3: Watch for Confluence
When the dashboard shows "CONFLUENCE ACTIVE," an FVG overlaps with a S/D zone. These are the highest-probability reaction areas. Consider these zones for entries with tight stops.
Step 4: Monitor Stacked FVGs
Stacked FVGs (2+ consecutive gaps in the same direction) indicate strong institutional pressure. The market is not pausing to fill gaps — it is aggressively displacing price. Trade in the direction of stacked FVGs.
Step 5: Use Nearest Zone for Targets
The nearest zone radar tells you how far price is from the next potential reaction. Use this for setting take-profit targets or anticipating where price may stall.
Step 6: Track Mitigation Rate
The FVG fill rate shows what percentage of gaps have been filled. A high fill rate suggests the market is efficiently filling imbalances (range-bound behavior). A low fill rate suggests strong trending where gaps are being left behind.
Limitations
FVG detection uses a standard three-candle pattern. Not all gaps are created by institutional activity — news events and low-liquidity periods can create gaps that lack institutional significance.
Supply/Demand zones are based on swing pivots, which require a lookback period. The pivot length parameter significantly affects zone placement — shorter lengths create more zones, longer lengths create fewer but more significant zones.
Auto-mitigation deletes FVGs when price touches the gap boundary. In some cases, price may wick into a gap without truly filling it. The indicator treats any touch as mitigation.
Volume filtering uses the 20-bar volume average. On instruments with irregular volume patterns (e.g., crypto on weekends), this filter may be too aggressive or too lenient.
The indicator draws on confirmed bars only (barstate.isconfirmed), so zones appear one bar after the pattern completes. This is intentional to prevent repainting.
Imbalance zones show where institutional interest existed historically. They do not guarantee future price reactions.
Originality Statement
This indicator is original in its comprehensive lifecycle approach to imbalance mapping. While FVG detection and S/D zones exist in other scripts, this indicator is justified because:
It treats imbalances as entities with a full lifecycle (creation, aging, testing, mitigation, breaker conversion) rather than static drawings
The volume filter ensures only institutionally-significant FVGs are displayed, reducing noise from low-conviction gaps
Transparency fade creates a natural visual hierarchy that no static-color indicator provides
Stacked imbalance detection identifies consecutive FVGs as a measure of institutional pressure — a concept not available in standard FVG indicators
Confluence detection between FVGs and S/D zones creates a cross-layer analysis that identifies the highest-probability reaction areas
Nearest zone radar and imbalance density scoring provide quantitative measures of the imbalance environment around current price
The combination of FVG lifecycle management, S/D zone tracking with breaker conversion, confluence detection, density scoring, and a comprehensive dashboard creates a unified imbalance analysis system not available in any single existing indicator
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Price imbalances are historical observations about where gaps and zones formed. They do not predict future price movement. While price often revisits imbalances, there is no guarantee that any specific FVG will be filled or that any S/D zone will produce a reaction.
Always use proper risk management. Never risk more than you can afford to lose. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Indicator

SMC Fibonacci Golden Zone OscillatorThe SMC Fibonacci Golden Zone Oscillator is a technical analysis tool that combines the principles of Smart Money Concepts (SMC) with Fibonacci retracement theory. It operates as an oscillator in a separate pane, normalizing the current price to a 0-100 scale within a dynamically identified range (defined by the most recent swing highs and lows).
The script's primary purpose is to provide traders with a clear, visual representation of price's position relative to key Fibonacci levels, with a special focus on the "Golden Zone" (the area between the 50% and 61.8% retracement). It automates the identification of crucial SMC structures like Breaks of Structure (BOS), Changes of Character (CHoCH), and Equal Highs/Lows (EQH/EQL), plotting them directly on the oscillator for enhanced context.
iBOS (Internal Break of Structure)
An iBOS is a Break of Structure on the smaller, internal scale. It signifies that the short-term momentum is continuing in the same direction as the internal trend.
What it looks like on the oscillator: You will see a label iBOS appear as the oscillator line breaks a recent minor peak or trough.
How to use it:
For Entries: If the main trend is up (confirmed by a CHoCH on the Swing structure), you can use an iBOS on the internal scale as a precise entry signal to go long, as it confirms the short-term momentum is with you.
For Confirmation: A series of iBOSs in the direction of the main trend is a strong sign of a healthy, trending market.
iCHoCH (Internal Change of Character)
An iCHoCH is a Change of Character on the smaller, internal scale. It is the earliest possible warning of a potential reversal in the short-term momentum.
Utility & Core Functionality:
Contextual Price Position: It instantly shows whether the current price is in the "Premium" (high), "Discount" (low), or "Equilibrium" (middle) phase of its recent range.
Dynamic Support & Resistance: The script calculates and plots the exact price levels for the 0.50, 0.618, and 0.786 Fibonacci retracements of the current range. These act as dynamic, real-time support and resistance zones.
Reversal Zone Identification: The "Golden Zone" (highlighted between 61.8% and 50%) is a critical area where price often reverses or consolidates before a significant move. The oscillator clearly marks when price enters and exits this zone.
Automated SMC Analysis: It automatically draws and labels BOS, CHoCH, and Swing Points (HH, HL, LH, LL) on the oscillator, helping traders confirm trend strength and potential shifts without manual drawing.
Momentum and Signal Confirmation: It includes a Signal Line (EMA of the oscillator) and a Momentum Line to help confirm the strength and direction of price movements and to generate crossover trading signals.
What it looks like on the oscillator: You will see a label iCHoCH appear as the oscillator line breaks a recent minor trough or peak, going against the immediate internal trend.
How to use it:
For Exits: If you are in a long trade and see an iCHoCH to the downside, it might be a signal to take profits or tighten your stop-loss. It's the first hint that the short-term bullish momentum is faltering.
For Early Reversal Signals: An iCHoCH can sometimes precede a full-scale CHoCH on the Swing structure. Traders can use it as a very early alert that a larger reversal might be coming.
Recommended Timeframes:
This indicator is versatile and can be applied across various timeframes, but its effectiveness increases with higher timeframes due to more reliable structure.
Swing Trading (Ideal): 4-Hour, Daily, and Weekly charts are perfect. The SMC structures and Fibonacci levels formed on these timeframes are more significant and lead to more substantial price moves.
Day Trading: 15-Minute, 30-Minute, and 1-Hour charts work well. A common strategy is to use a higher timeframe (e.g., 4H) to determine the overall trend and key Golden Zone levels, then use a lower timeframe (e.g., 15M) for precise entry signals using the oscillator's crossovers and CHoCH patterns.
Scalping: 1-Minute and 5-Minute charts can be used, but with caution. Market noise on these low timeframes can generate false signals. It's highly recommended to use a higher timeframe for context when scalping.
How to Trade with the Script:
The core trading strategy revolves around identifying price reacting within the Golden Zone or other key Fibonacci levels.
Bullish (Long) Setup-
Identify the Context: Price is in a downtrend, and the oscillator is falling towards the lower end of the pane (0-50).
Entry Zone: Wait for the oscillator to enter the Golden Zone (61.8-50) or the Discount Zone (below 38.2). This indicates price is at a potential support area.
Confirmation Signal: Look for one or more of the following:
A bullish CHoCH (Change of Character) on the oscillator, where it breaks the most recent lower high.
A crossover of the main oscillator line above its Signal Line (EMA).
A bullish candlestick pattern (e.g., hammer, engulfing) on the main price chart at one of the Fibonacci price levels displayed on the right (e.g., the 0.618 or 0.786 price).
Entry: Enter a long position on the confirmation signal.
Stop-Loss: Place a stop-loss below the low of the range (the 0.786 or 1.0 Fibonacci level of that swing) or below the recent swing low on the price chart.
Take-Profit: Target the 50% equilibrium line (midline of the range), the opposite end of the range (the Premium Zone), or a subsequent lower high identified by the script.
Bearish (Short) Setup-
Identify the Context: Price is in an uptrend, and the oscillator is rising towards the upper end of the pane (50-100).
Entry Zone: Wait for the oscillator to enter the Golden Zone (61.8-50) or the Premium Zone (above 78.6). This indicates price is at a potential resistance area.
Confirmation Signal: Look for one or more of the following:
A bearish CHoCH on the oscillator, where it breaks the most recent higher low.
A crossover of the main oscillator line below its Signal Line (EMA).
A bearish candlestick pattern (e.g., shooting star, bearish engulfing) on the main price chart at one of the Fibonacci price levels (e.g., the 0.50 or 0.618 price).
Entry: Enter a short position on the confirmation signal.
Stop-Loss: Place a stop-loss above the high of the range (the 0.236 or 0.0 Fibonacci level) or above the recent swing high on the price chart.
Take-Profit: Target the 50% equilibrium line, the opposite end of the range (the Discount Zone), or a subsequent higher low.
Disclaimer:
Past performance of any trading system or methodology is not necessarily indicative of future results. This script and the accompanying analysis are provided for educational and informational purposes only. The content represents the personal opinions and strategies of the author and is not intended as, and should not be construed as, financial advice, a recommendation, or an offer to buy or sell any financial instrument. Indicator

Structural Flow Decoder [JOAT]Structural Flow Decoder
Introduction
The Structural Flow Decoder is an advanced open-source market structure analysis indicator that combines Break of Structure (BOS) detection, Change of Character (CHoCH) identification, nested pattern recognition, and multi-timeframe confluence into a unified structural analysis system. This indicator helps traders identify trend direction, structural shifts, and momentum changes by analyzing how price breaks through swing highs and lows across multiple timeframes.
Unlike basic trend indicators that use moving averages, this system analyzes actual market structure - the sequence of higher highs, higher lows, lower highs, and lower lows that define trends. Break of Structure signals trend continuation, Change of Character signals potential reversals, nested patterns reveal internal structure, and multi-timeframe alignment confirms institutional conviction. The indicator is designed for traders who understand that market structure precedes price and that structural breaks reveal directional intent.
Why This Indicator Exists
This indicator addresses a critical need in technical analysis: the ability to identify trend changes before they're obvious. Market structure analysis reveals when institutions are shifting positioning. By combining multiple structural methodologies, this indicator reveals:
Break of Structure (BOS): Price breaks swing high/low in trend direction - confirms continuation and momentum
Change of Character (CHoCH): Price breaks swing high/low against trend - signals potential reversal or consolidation
Nested Structure: Internal patterns within larger structure - reveals micro-trends and entry timing
Multi-Timeframe Confluence: Higher timeframe structure alignment - confirms institutional participation
Momentum Shifts: RSI and MACD crossovers at structure breaks - adds confirmation layer
Trend Strength Analysis: Quantifies structural conviction - distinguishes strong from weak trends
Each component provides a different lens on market structure. BOS shows continuation, CHoCH shows reversals, nested structure shows timing, MTF alignment shows conviction, and momentum shows acceleration. Together, they create a comprehensive view of structural flow.
Core Components Explained
1. Break of Structure (BOS) Detection
Break of Structure occurs when price breaks a swing high in an uptrend or swing low in a downtrend. It confirms trend continuation:
// Bullish BOS: Price breaks above previous swing high
if pivotHigh > lastSwingHigh and bullishStructure:
line.new(lastSwingHighBar, lastSwingHigh, bar_index, pivotHigh,
color=COLOR_BULL_STRUCTURE, width=3, style=line.style_solid)
label.new(bar_index, pivotHigh, "BOS ↑")
The indicator identifies BOS using swing detection:
Detects swing highs and lows using pivot lookback (default 5 periods)
Compares current swing to previous swing in same direction
Draws solid lines connecting swings when BOS occurs
Labels breaks with "BOS ↑" or "BOS ↓" for clarity
BOS signals that the trend is intact and institutions are pushing price in the established direction. Multiple consecutive BOS indicate strong trending conditions.
2. Change of Character (CHoCH) Detection
Change of Character occurs when price breaks a swing high in a downtrend or swing low in an uptrend. It signals potential trend reversal:
// Bullish CHoCH: Price breaks above swing high while in downtrend
if pivotHigh > lastSwingHigh and not bullishStructure:
line.new(lastSwingHighBar, lastSwingHigh, bar_index, pivotHigh,
color=COLOR_CHOCH_BULL, width=3, style=line.style_dashed)
label.new(bar_index, pivotHigh, "CHoCH ↑")
bullishStructure := true
CHoCH is more significant than BOS because it represents structural shift:
Breaks counter-trend swing points
Signals potential trend reversal or major consolidation
Drawn with dashed lines to distinguish from BOS
Flips internal trend state when detected
CHoCH doesn't guarantee reversal, but it warns that the previous trend is weakening. Confirmation from other factors (volume, momentum, higher timeframe) increases reliability.
3. Nested Structure Analysis
Nested structure reveals internal patterns within the larger trend. It uses shorter lookback periods to detect micro-structure:
The indicator tracks internal swings using a separate period (default 3 bars vs 5 for main structure). This reveals:
Internal BOS within larger trends - shows momentum acceleration
Internal CHoCH before main CHoCH - early warning of reversals
Pullback structure in trends - identifies entry opportunities
Consolidation patterns - shows when to wait
Nested structure is drawn with thinner dashed lines to distinguish from main structure. It provides entry timing within the larger trend context.
4. Multi-Timeframe Confluence
The indicator requests structure data from a higher timeframe (default 60-minute) and compares it to current timeframe:
= request.security(syminfo.tickerid, "60",
)
Multi-timeframe analysis reveals:
Whether current timeframe structure aligns with higher timeframe
Institutional conviction (HTF structure = larger positions)
Confluence zones where both timeframes show same direction
Divergence warnings when timeframes conflict
The dashboard displays HTF alignment status (Bullish/Bearish) and confluence state (Synced/Divergent). Trading in direction of HTF structure with current timeframe confirmation produces highest win rates.
5. Momentum Shift Detection
The indicator integrates RSI and MACD to detect momentum shifts at structural breaks:
rsi = ta.rsi(close, 14)
= ta.macd(close, 12, 26, 9)
momentum_bull = ta.crossover(rsi, 50) and macdHist > 0
momentum_bear = ta.crossunder(rsi, 50) and macdHist < 0
Momentum shifts are marked with "M+" (bullish) or "M-" (bearish) labels. When momentum shifts align with structural breaks, it confirms the move. Momentum divergence from structure warns of potential failures.
6. Trend Strength Classification
The indicator quantifies trend strength based on consecutive structural breaks:
Explosive: 3+ consecutive BOS in same direction
Active: 1-2 consecutive BOS
Weak: No recent BOS or mixed signals
Strength classification appears in the dashboard and influences background gradient intensity. Strong trends show vibrant colors, weak trends show muted colors.
Visual Elements
BOS Lines: Solid thick lines (cyan for bullish, magenta for bearish)
CHoCH Lines: Dashed thick lines (cyan for bullish, magenta for bearish)
Internal Structure: Thin dashed lines showing nested patterns
Swing Point Labels: "H" and "L" markers at pivot highs/lows
Momentum Labels: "M+" and "M-" at momentum shifts
Gradient Background: Color intensity based on trend strength
Gradient Candles: Strong moves in bright colors, weak moves in muted colors
Dashboard: Real-time structure state and confluence metrics
The dashboard displays 8 key metrics:
1. Structure Flow (Bullish/Bearish)
2. Flow Strength (Explosive/Active/Weak)
3. HTF Alignment (Bullish/Bearish/Off)
4. Confluence (Synced/Divergent)
5. Momentum (Strong/Neutral/Weak)
6. MACD Signal (Bullish/Bearish)
7. Last Pivot price level
Input Parameters
Structure Analysis:
Detection Period: Swing lookback for main structure (default: 5)
Break of Structure: Enable/disable BOS detection
Change of Character: Enable/disable CHoCH detection
Nested Patterns: Enable/disable internal structure
Nested Period: Swing lookback for internal structure (default: 3)
Momentum Shifts: Enable/disable RSI/MACD labels
Higher Timeframe:
Multi-Timeframe Sync: Enable/disable HTF analysis
HTF Period: Higher timeframe to analyze (default: 60 minutes)
Confluence Filter: Require HTF alignment for signals
Visualization:
Directional Zones: Show gradient backgrounds
Pivot Markers: Show H/L labels at swings
Strength Histogram: Show trend strength bars
How to Use This Indicator
Step 1: Identify Current Structure
Check the dashboard for Structure Flow. Bullish structure = look for longs, Bearish structure = look for shorts. This is your directional bias.
Step 2: Wait for Structural Confirmation
In bullish structure, wait for BOS (break above swing high) to confirm continuation. In bearish structure, wait for BOS (break below swing low). Don't trade against structure.
Step 3: Watch for Change of Character
CHoCH signals potential reversal. When CHoCH occurs, structure flips. Wait for confirmation BOS in new direction before entering. Don't trade immediately on CHoCH.
Step 4: Use Nested Structure for Timing
Internal structure shows pullback completion. Enter when internal BOS occurs in direction of main structure. This provides precise entry timing.
Step 5: Confirm with Higher Timeframe
Check HTF Alignment in dashboard. "Synced" = both timeframes agree (best setups). "Divergent" = conflict (avoid or reduce size).
Step 6: Add Momentum Confirmation
Look for M+ labels in bullish structure or M- labels in bearish structure. Momentum + Structure = highest probability setups.
Best Practices
Trade in direction of structure - don't fight it
BOS confirms trend, CHoCH warns of change - respect both
Multiple BOS in same direction = strong trend, ride it
CHoCH requires confirmation - don't reverse immediately
Nested structure provides entries within larger trend
HTF alignment is critical - always check confluence
Momentum divergence from structure = warning sign
Explosive strength = trending conditions, use breakout strategies
Weak strength = ranging conditions, use mean reversion
Structure works on all timeframes - scale appropriately
Indicator Limitations
Structure analysis works best on trending markets with clear swings
Choppy, sideways markets produce frequent false CHoCH signals
Swing detection requires sufficient volatility - low volatility reduces reliability
CHoCH doesn't guarantee reversal - it signals potential change
Multiple CHoCH in short period indicates consolidation, not trend
HTF data may repaint on lower timeframes - use confirmed bars
Nested structure can be noisy in ranging markets
The indicator shows structure state, not future direction
Momentum shifts can occur without structural confirmation
Technical Implementation
Built with Pine Script v6 using:
Pivot-based swing detection with configurable lookback
State machine tracking for bullish/bearish structure
Nested structure analysis with separate period
Multi-timeframe security requests with proper gap handling
RSI and MACD momentum calculations
Trend strength quantification system
Dynamic gradient backgrounds based on strength
Real-time dashboard with 8 structural metrics
The code is fully open-source and can be modified to suit individual trading styles and preferences.
Originality Statement
This indicator is original in its comprehensive structural integration approach. While individual components (BOS, CHoCH, swing detection) are established concepts, this indicator is justified because:
It synthesizes BOS and CHoCH detection with nested pattern analysis in a unified system
The multi-timeframe confluence detection provides institutional conviction measurement
Momentum shift integration (RSI + MACD) adds confirmation layer to structural breaks
Trend strength quantification distinguishes explosive from weak structural flows
Nested structure analysis reveals micro-patterns within macro-trends for entry timing
The gradient visualization system shows structural conviction through color intensity
Real-time dashboard presents 8 metrics simultaneously for holistic structural analysis
Each component contributes unique information: BOS shows continuation, CHoCH shows reversals, nested structure shows timing, HTF shows conviction, momentum shows acceleration, and strength shows quality. The indicator's value lies in presenting these complementary perspectives simultaneously with unified classification and visual hierarchy.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Market structure analysis is a tool for understanding price behavior, not a crystal ball for predicting future movement. BOS does not guarantee continuation. CHoCH does not guarantee reversal. Past structural patterns do not guarantee future structural patterns. Market conditions change, and strategies that worked historically may not work in the future.
The structural states displayed are analytical constructs based on current market data, not predictions of future price movement. Structure alignment does not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Fibonacci Structure Engine [WillyAlgoTrader]📐 Fibonacci Structure Engine is an overlay indicator that combines automatic Fibonacci retracement from live market structure with Smart Money Concepts (BOS/CHoCH detection), weighted confluence scoring, premium/discount zone classification, and context-filtered engulfing pattern entries — creating a complete structure-to-Fibonacci-to-entry workflow where every component feeds into the next.
The core idea: Fibonacci levels are only meaningful when drawn from the correct swing points. This indicator automates the entire process: it detects swing highs/lows with ATR-filtered pivot detection, identifies structure breaks (BOS) and trend reversals (CHoCH), anchors Fibonacci retracement levels from the structure-defined swing, trails the live edge as price extends, locks it when a confirmed pivot arrives, scores the confluence between current price and Fibonacci levels, and generates entry signals when engulfing patterns occur at high-confluence zones in the correct structural context.
Most Fibonacci tools on PulseWire require manual drawing — you select the swing high and low, and the levels appear. The problem: selecting the wrong swing, forgetting to update after a new structure break, or drawing from a minor swing that doesn't reflect the current trend leg. This indicator solves all three: the Fibonacci anchors update automatically on every structure break, trail the live edge as price extends, and lock when a confirmed pivot arrives — always reflecting the most relevant swing for the current market structure.
🧩 WHY THESE COMPONENTS WORK TOGETHER
Fibonacci retracement levels alone are static S/R lines. Structure detection alone tells you trend direction. Engulfing patterns alone fire everywhere. Confluence scoring alone has nothing to score against.
This indicator chains them into a dependency pipeline:
ATR-filtered swing detection → HH/HL/LH/LL classification → BOS/CHoCH structure breaks → Fibonacci anchor from structure swing → Live edge trailing + pivot locking → Fib level calculation → Confluence scoring (price vs Fib levels) → Premium/Discount zone classification → Engulfing pattern detection in structural context → Entry signal with cooldown
The swing detection feeds the structure engine — without confirmed pivots, no BOS/CHoCH can fire. The structure breaks anchor the Fibonacci levels — without a break, there's no swing to draw from. The Fibonacci levels feed the confluence scorer — without levels, there's nothing to score proximity against. The confluence score plus the premium/discount zone filter the engulfing patterns — without context, engulfing patterns produce too many false entries. And the signal cooldown prevents clustering from this entire chain.
Removing the structure detection breaks the Fibonacci anchoring. Removing the ATR filter floods the structure with noise swings. Removing the confluence scoring allows entries at non-Fibonacci prices. Removing the premium/discount filter allows bullish entries in premium (where sells should occur). Each component eliminates a specific failure mode.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Structure-anchored Fibonacci with live edge trailing.
The Fibonacci engine uses a 4-phase lifecycle:
Phase 1 — Anchor on structure break: When a BOS or CHoCH is detected:
— Bullish break: top = current high (live, will trail), bottom = most recent swing low (locked)
— Bearish break: bottom = current low (live, will trail), top = most recent swing high (locked)
This instantly draws Fibonacci levels from the break point.
Phase 2 — Trail live edge: As price extends beyond the initial break, the live edge (top for bull, bottom for bear) updates to the new extreme. Fibonacci levels recalculate continuously to reflect the current move. This captures the full extent of the breakout without waiting for a pivot confirmation.
Phase 3 — Lock on pivot: When a confirmed swing high (for bullish trailing) or swing low (for bearish trailing) is detected by the pivot engine, the live edge locks to that confirmed pivot. The Fibonacci levels stop updating and represent the confirmed swing range.
Phase 4 — Update on new swings: When a new confirmed swing arrives that differs from the current locked anchor, the Fibonacci levels update to the new structure — always reflecting the most recent confirmed swing.
This lifecycle means the Fibonacci levels are always relevant: immediately reactive after a break (phases 1–2), then structurally confirmed once a pivot is detected (phases 3–4).
2️⃣ ATR-filtered pivot detection with noise suppression.
Standard ta.pivothigh/ta.pivotlow detects every local extreme, including minor fluctuations that don't represent real swing points. The ATR filter requires:
— For a swing high: the distance from the pivot high to the most recent swing low ≥ ATR × multiplier (default 0.5)
— For a swing low: the distance from the most recent swing high to the pivot low ≥ ATR × multiplier
This ensures only swings of meaningful size (relative to current volatility) are used for structure detection and Fibonacci anchoring. The multiplier is configurable: lower (0.2–0.3) for more granular structure, higher (0.8–1.0) for only major swings.
3️⃣ BOS / CHoCH structure detection with bias tracking.
The indicator tracks a persistent structureBias variable (+1 bullish, −1 bearish, 0 neutral):
— BOS (Break of Structure) : close breaks above the most recent swing high while bias is already bullish (or below swing low while already bearish) — trend continuation
— CHoCH (Change of Character) : close breaks above swing high while bias was bearish, or below swing low while bias was bullish — trend reversal
Each break requires: barstate.isconfirmed + the swing level hasn't been broken before (tracked via lastBrokenHigh/lastBrokenLow). Structure lines are drawn from the swing point to the break bar with configurable style (solid/dashed/dotted) and width.
4️⃣ Weighted confluence scoring (0–100).
The indicator measures how close the current price is to each Fibonacci level (within ATR × tolerance) and assigns weights by Fib importance:
— 0.236 → weight 1.0 (minor level)
— 0.382 → weight 1.5 (shallow retracement)
— 0.500 → weight 2.0 (equilibrium)
— 0.618 → weight 2.5 (golden ratio — highest weight)
— 0.786 → weight 1.5 (deep retracement)
Swing highs/lows within tolerance add +1.0 each. Total weight × 10 = confluence score (capped at 100). Classification: Strong (≥ 60), Moderate (≥ 30), Weak (> 0), None (0).
The tolerance is ATR-based (default 0.3× ATR) — on a volatile instrument, the "near" zone expands proportionally. On a quiet instrument, it tightens. This prevents false confluence readings from both too-tight and too-loose proximity checks.
5️⃣ Premium / Discount zone classification.
Using the 0.500 Fibonacci level as the equilibrium:
— Premium : close > Fib 0.500 — price is above equilibrium (expensive relative to the swing)
— Discount : close ≤ Fib 0.500 — price is below equilibrium (cheap relative to the swing)
This classification is used as a context filter for engulfing patterns: bullish engulfing patterns are only marked when price is in discount or at a confluence zone. Bearish engulfing patterns are only marked in premium or at a confluence zone. This prevents the most common engulfing failure mode: bullish patterns at the top of a range and bearish patterns at the bottom.
6️⃣ Context-filtered engulfing pattern detection.
The engulfing pattern detection requires:
— Current candle body > EMA(body, 14) — above-average body size (not a doji)
— Previous candle body < EMA(body, 14) — smaller previous candle (setup for engulf)
— Current candle fully engulfs previous candle's body
— Context filter: in premium/discount zone OR confluence weight ≥ 1.5
Bearish engulfing (▼): marked when price is in premium or near a Fib level — a reversal pattern at resistance. Bullish engulfing (▲): marked when price is in discount or near a Fib level — a reversal pattern at support.
7️⃣ Dual-path entry signals with cooldown.
Two entry paths:
— Engulfing + Structure + Confluence : engulfing pattern in context + structure bias aligned + confluence weight ≥ 1.5
— CHoCH (trend reversal) : any confirmed CHoCH — strong reversal signal, no additional confluence required
Both paths subject to signal cooldown (default 5 bars) to prevent clustering. Buy/Sell signals are displayed as labels (off by default — enable in Visual Settings).
8️⃣ Golden Zone + Target Zone visualization.
Two highlighted zones drawn as semi-transparent boxes:
— Golden Zone (0.500 – 0.786): the highest-probability retracement area. Where most retests find support/resistance.
— Target Zone (−0.500 – −0.618): the Fibonacci extension target for the next leg. Where price typically reaches after a confirmed retracement entry.
Both zones extend rightward by the configurable extension (default 20 bars) and update with Fibonacci level changes.
9️⃣ Seven configurable Fibonacci levels.
Individually toggleable: 0.236, 0.382, 0.500, 0.618, 0.786, −0.500, and Target (−0.618). Each drawn with distinct line styles — 0.618 is the thickest and most opaque (golden ratio emphasis), 0.236 is the thinnest (minor level). A dotted reference line connects the swing low to swing high showing the measured move.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Pivot detection: ta.pivothigh/ta.pivotlow with configurable lookback. ATR filter removes minor swings (swing size must exceed ATR × multiplier).
Step 2 — Swing tracking: Most recent two swing highs and two swing lows stored with bar indices. Each new swing is compared to previous → HH/HL/LH/LL classification.
Step 3 — Structure detection: Close breaks above swing high → BOS (if bias already bullish) or CHoCH (if bias was bearish). Same logic inverted for bearish breaks. Structure bias updated.
Step 4 — Fibonacci anchoring: On break → live edge set at current extreme, locked edge at swing. Live edge trails with price. Locks when confirmed pivot arrives. Updates on new swings.
Step 5 — Level calculation: fibLevel = swingHigh − (swingHigh − swingLow) × ratio for each ratio. Extension targets use negative ratios.
Step 6 — Confluence scoring: For each Fib level, check if |close − level| ≤ ATR × tolerance. Add weighted score. Include swing level proximity. Cap at 100.
Step 7 — Entry logic: Path A: engulfing in context + bias + confluence ≥ 1.5. Path B: CHoCH. Both respect cooldown.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator — Fibonacci levels and structure labels appear automatically
2. HH/HL/LH/LL labels show market structure
3. BOS/CHoCH labels show structure breaks and reversals
4. Yellow-shaded Golden Zone (0.500–0.786) = highest-probability retracement area
5. ▲/▼ arrows = engulfing patterns in structural context
6. Enable Buy/Sell Signals in Visual Settings for entry labels
👁️ Reading the chart:
— 🟢 HH / HL labels = bullish structure (higher highs, higher lows)
— 🔴 LH / LL labels = bearish structure (lower highs, lower lows)
— 🟢 "BOS" line + label = bullish break of structure (continuation)
— 🔴 "BOS" line + label = bearish break of structure
— 🟢🔴 "CHoCH" = Change of Character (trend reversal)
— 🔵 Horizontal lines = Fibonacci levels (0.236–0.786)
— 🟡 Shaded box (upper) = Golden Zone (0.500–0.786)
— 🟡 Shaded box (lower) = Target Zone (−0.500 to −0.618)
— 🟢 ▲ = bullish engulfing in discount / Fib zone
— 🔴 ▼ = bearish engulfing in premium / Fib zone
— 🟢 "BUY" / 🔴 "SELL" = confirmed entry signals (when enabled)
🔧 Tuning guide:
— Too many structure labels: increase Swing Length (12–20) or increase ATR Multiplier (0.7–1.0)
— Missing swings: decrease Swing Length (5–8) or decrease ATR Multiplier (0.2–0.3)
— Confluence too strict: increase Confluence ATR Tolerance (0.4–0.5)
— Too many engulfing signals: they self-filter by premium/discount — increase ATR Filter to reduce swing count
— Signal clustering: increase Signal Cooldown (8–15 bars)
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Swing Detection Length (default 10): pivot lookback — higher = larger swings
— ATR Swing Filter (default On): minimum swing size as ATR multiple
— ATR Filter Multiplier (default 0.5): how large swings must be
— Signal Cooldown (default 5): bars between consecutive signals
📐 Fibonacci:
— Show Fibonacci Levels (default On)
— Fib Extension Bars (default 20): rightward line extension
— Individual level toggles : 0.236 (off), 0.382, 0.500, 0.618, 0.786, −0.5, Target −0.618
— Confluence ATR Tolerance (default 0.3): proximity threshold
🏗️ Structure:
— BOS / CHoCH (default On): show structure break lines and labels
— Swing Labels (default On): HH/HL/LH/LL on pivots
— Engulfing Signals (default On): context-filtered patterns
🎨 Visual:
— Buy/Sell Signals (default Off): enable for entry labels
— Structure line style (Solid/Dashed/Dotted) and width (1–4)
— Auto / Dark / Light theme
🔔 Alerts
— 🟢 BUY / 🔴 SELL — ticker, price, TF, confluence score, SL, TP
— 🔵 BOS — structure break with direction
— 🟡 CHoCH — trend reversal with direction
All support plain text and JSON webhook format. Bar-close confirmed.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All structure breaks and signals require barstate.isconfirmed. Pivot detection uses equal left/right lookback (swingLen/swingLen) — pivots are confirmed swingLen bars after the actual high/low. Fibonacci levels update on confirmed pivots and structure breaks only.
— 📐 The Fibonacci anchor system has two states per edge: live and locked . A live edge trails with price (capturing the full move after a break). A locked edge is confirmed by a pivot. You'll see the Fibonacci levels shift on bar close as the live edge updates — this is by design, not repainting. Once the pivot locks, levels stabilize.
— ⚖️ The 0.618 level carries the highest confluence weight (2.5) because it is the golden ratio — the most statistically significant Fibonacci retracement level. The 0.500 carries weight 2.0, while the extreme levels (0.236, 0.786) carry 1.0–1.5.
— 📊 Buy/Sell signals are off by default . The indicator is designed primarily as a structure + Fibonacci analysis tool. Enable signals in Visual Settings when you want automated entry detection.
— 🔄 CHoCH signals do not require confluence — they represent a structural trend reversal, which is inherently a high-conviction event. Engulfing-based entries require confluence weight ≥ 1.5 + correct structural bias.
— 📏 The Golden Zone (0.500–0.786) is the area where most successful retests occur . The Target Zone (−0.500 to −0.618) is the area where the next impulse leg typically reaches. Both are highlighted with semi-transparent boxes.
— 🛠️ This is a structure analysis and Fibonacci visualization tool , not an automated trading bot. It maps market structure, draws Fibonacci levels, scores confluence, and identifies high-probability entry zones — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Indicator

Smart Confluence█ SMART CONFLUENCE (SC)
Multi-Factor SMC Trading System
Smart Confluence combines multiple market structure signals into a single confluence score . When enough signals align, it generates BUY/SELL setups with precise Entry Zones, Stop Loss, and 3 Take Profit levels — all fully automated.
Free and Open Source.
█ THE CONCEPT: WHY CONFLUENCE MATTERS
No single indicator is reliable on its own. A CHOCH can fail. An Order Block can break. A sweep can be a fakeout. But when 4-6 different signals all agree at the same time — that's when the probability is in your favor.
Smart Confluence requires a core trigger (CHOCH, Sweep, or EQ-Grab) PLUS enough confirmations to reach the minimum confluence threshold before any signal fires. This eliminates most false signals.
█ CORE FEATURES
1. Market Structure Detection
Automatic Swing High/Low identification with Change of Character (CHOCH) — the moment a downtrend breaks above the last swing high (bullish) or an uptrend breaks below the last swing low (bearish). CHOCH is worth 2 confluence points.
2. Liquidity Sweeps
Detects stop-hunt patterns where price sweeps below recent lows (or above recent highs) and reverses. These sweeps indicate smart money collecting liquidity before the real move. Worth 2 confluence points.
3. EQH/EQL (Equal Highs/Lows)
Identifies liquidity pools where multiple swing points cluster at the same price level. When price sweeps through these clusters (EQ-Grab), it signals institutional order flow. Worth 3 confluence points (configurable).
4. Order Blocks & Fair Value Gaps
Order Blocks — The last opposing candle before a strong move — institutional supply/demand zones. +1 point when price is inside.
FVGs — Price imbalances (gaps between candles) that act as magnets. +1 point when price is inside.
5. Premium/Discount Zones
Calculates where price is relative to the current range. Buy in discount (<50%), sell in premium (>50%). OTE (Optimal Trade Entry) bonus for the 62-79% retracement zone. Up to +3 confluence points.
6. Confirmation Filters
Volume — High volume confirms institutional activity (+1-2 points)
RSI Divergence — Momentum exhaustion = strong reversal signal (+2 points)
EMA Trend Filter — Price vs EMA21/50/200 alignment (+1-2 points)
ATR Volatility — High volatility confirms market activity (+1 point)
HTF Trend — Higher timeframe trend agreement (+1 point)
Candlestick Patterns — Engulfing, Hammer, Shooting Star (+1 point)
█ AUTO-TIMEFRAME ADAPTATION
All parameters auto-adjust to your chart timeframe: Swing Length, Cooldown, OB Lookback, Min Confluence, HTF selection, SL Buffer, Min R:R, EQ Tolerance, EQ Age, Setup duration, S/R Cluster. Supports 1m to Monthly.
█ S/R ZONE DETECTION
Automatic Support/Resistance zones built from clustering multiple sources: Swing points, Order Blocks, FVGs, EQH/EQL levels, HTF levels. Each zone gets a strength score (1-5). Only shows the strongest zones.
█ ENTRY / SL / TP SYSTEM
Entry Zone — Based on active Order Block or FVG. Falls back to current candle range.
Stop Loss — 4 modes: Entry-Based, Swing, ATR, or SMC (below OB/FVG). R:R filter ensures minimum reward.
Take Profit — 4 modes: Structure (next swing), Fixed R:R, ATR-based, or Hybrid (structure if available, else R:R).
Partial TP — Configurable distribution (50/30/20, 33/33/34, 40/40/20, 60/30/10).
█ DASHBOARD
Compact dark-themed info panel showing: Mode (Auto/Manual + TF), Trend direction, HTF confirmation, Premium/Discount zone, S/R levels with strength, Bull/Bear confluence scores, Active setup details (direction, R:R, SL, Entry, TP1-3), SL/TP mode, Partial distribution.
█ ALERTS (8 CONDITIONS)
BUY Signal — Full confluence with valid R:R
SELL Signal — Full confluence with valid R:R
Bullish CHOCH — Trend reversal detected
Bearish CHOCH — Trend reversal detected
EQH Grab — Liquidity pool swept (bearish)
EQL Grab — Liquidity pool swept (bullish)
Bullish Sweep — Stop hunt detected
Bearish Sweep — Stop hunt detected
█ PRO VERSION
The PRO version (Smart Confluence Pro) adds:
Signal Profile Presets — Scalping, Intraday, Swing, Position, Aggressive, Conservative, SMC Pure
Asset Auto-Detection — Crypto, Forex, Stock, Futures with 8 scaling factors
A/B/C Signal Grading — Quality scoring based on Zone, HTF, Volume, Session, Divergence
Risk Management — Account size, risk %, position sizing, custom partial distributions
Session Filter — London, New York, Asia sessions with overlap detection
Funding Rate — Crypto perpetual funding rate as contrarian confluence
Trailing Stop Loss — Break-Even + Trail TP modes
Trade Management Alerts — TP1/TP2/TP3 hit, SL hit, Trailing updates, Setup expiry
14+ Alert Types — Including A-Grade only alerts
█ NON-REPAINTING
All signals require confirmed bars (barstate.isconfirmed for EQH/EQL). Signal confirmation waits for the next candle. HTF data uses lookahead=barmerge.lookahead_off. No future data leakage. No repainting.
█ WORKS ON
Crypto, Forex, Stocks, Futures, Indices — any timeframe from 1 minute to Monthly.
█ DISCLAIMER
This indicator is for educational and informational purposes only. It does not constitute financial advice. Always do your own research and manage your risk. Past performance does not guarantee future results. Trading involves substantial risk of loss.
Indicator

Structural SVM Ranker [LuxAlgo]The Structural SVM Ranker indicator is a market structure tool that utilizes a linear Support Vector Machine (SVM) algorithm to classify and rank structural breaks based on volume, momentum, and price magnitude. By assigning a score from 0 to 100 to every Break of Structure (BOS) and Change of Character (CHoCH), it aims to help traders differentiate between high-conviction structural shifts and low-probability price action.
🔶 USAGE
The indicator identifies key pivot highs and lows to map out the market structure. When price closes beyond these levels, a structural break is identified and assigned a score based on the quality of the move.
BOS (Break of Structure): Represented by solid lines, these indicate a continuation of the current local trend.
CHoCH (Change of Character): Represented by dashed lines, these indicate a potential reversal in the trend direction.
SVM Score: Displayed on labels and the dashboard. A higher score suggests the break occurred with significant relative volume, strong RSI momentum, and a meaningful price distance beyond the pivot level.
Traders can use the SVM score to filter trade quality. For example, a "CHoCH" with a score above 70 indicates a high-conviction reversal backed by volume and momentum, whereas a score below 30 might suggest a "fakeout" or a weak structural shift.
🔶 DETAILS
The core of the script is a linear classification logic inspired by Support Vector Machines. It takes three primary features into account to determine the "strength" of a break:
Relative Volume: Compares current volume to its 20-period average to ensure the break is supported by market participation.
RSI Momentum: Measures the distance of the RSI from its midpoint (50) to confirm trend strength.
Break Distance: Measures how far the price closed beyond the structural level, normalized by the Average True Range (ATR).
These features are multiplied by user-defined weights and then passed through a Sigmoid function to produce a normalized score between 0 and 100.
🔶 SETTINGS
🔹 Market Structure
Pivot Lookback: Determines the number of bars required to confirm a pivot high or low.
Show BOS/CHoCH: Toggles the visibility of structural break lines and labels.
🔹 SVM Ranking Parameters
Relative Volume Weight: Adjusts the influence of volume on the final score.
RSI Momentum Weight: Adjusts the influence of RSI deviation from 50 on the final score.
Break Distance Weight: Adjusts the influence of the price distance beyond the pivot (relative to ATR).
ATR Length: The period used for the ATR normalization of the break distance.
🔹 Dashboard
Dashboard: Toggles the visibility of the real-time ranking table.
Position: Moves the dashboard to different corners of the chart (Top Right, Bottom Right, Bottom Left).
Size: Adjusts the scale of the dashboard text.
Indicator

Market Structure Volume Profiles [Kioseff Trading]Hello traders and friends!
Introducing: "Market Structure Volume Profiles".
This script combines market structure with volume profiling and CVD to show how volume develops inside each structural changes of the market.
Instead of building one continuous profile across a session, this script creates a new volume profile for each completed BoS or CHoCH, allowing you to study the internal auction of each behavioral regime independently.
🔹Features
Detects and displays BoS and CHoCH
Builds a dedicated volume profile for each new structure
Displays profiles in Stacked or Split mode
Optional Mini Profile mode for a compact structure profile view
Shows buy-side and sell-side volume distribution
Displays POC for each profile
Optional extended POC and naked POC tracking
Displays Value Area (VA) for each completed structure
Tracks and plots CVD by structural leg
Optional market structure candle coloring
Optional structure statistics label
Uses lower timeframe data to build more detailed internal volume distribution
🔹How it works
This script tracks market structure and recalculates volume profiles for each structural change.
Whenever price confirms a Break of Structure (BoS) or Change of Character (CHoCH), the volume accumulated during that completed leg is organized into a profile. This allows you to examine how volume was distributed throughout the move, where the heaviest participation occurred, and whether buying or selling dominated the leg.
Rather than asking only where price moved, this script helps answer:
where volume concentrated during the move
whether the move was supported by participation
where value developed inside the structural range
how buy and sell volume were distributed across price
Each profile is built from lower timeframe data so that the structural leg can be broken into price levels and analyzed internally.
🔹What it shows
🔸Market Structure
The script identifies major structural events and labels them as:
BoS
CHoCH
Profiles to be tied directly to meaningful structural transitions.
🔸Volume Profile by Structure
Each completed structural leg gets its own profile, showing:
buy volume at each level
sell volume at each level
total participation across the leg
the internal shape of the auction
This makes it easier to compare continuation legs against reversal legs.
You can color BoS and CHoCH generated profiles distinctly. Making it easier to trach where each profile sits inside broader market action.
🔸Point of Control (POC)
The script can display the POC of each structural profile, showing the price level with the highest traded volume during that leg.
The script can also display the Value Area for each profile, helping identify where the majority of volume was concentrated during the structural move.
🔸CVD
The script tracks Cumulative Volume Delta throughout the current structure and plots it in the pane.
CVD can be reset by:
CHoCH
BoS + CHoCH
Day
Week
This makes it possible to study delta behavior in a structural context rather than only in a session-based one.
🔸Structure Stats
Optional structure statistics can be displayed, including:
Range
High
Low
Buy volume
Sell volume
Delta
Return
This gives a summary of the completed structural move.
🔸Why use it
This script is designed for traders who want to combine:
market structure
volume profiling
delta/CVD
auction logic
Because profiles are anchored to structure instead of session time, they can help reveal differences between:
strong continuation legs
weak continuation legs
reversal legs
imbalanced breakouts
balanced rotations
🔸Mini Profiles
The indicator has two separate drawing methods for each VP.
The detailed profile is used when the structural move has enough bar data to create a detailed profile.
When not enough data exists, a mini profile is used. You can select only to use mini profiles if you prefer the style.
The internal logic to calculate each volume profile is similar. However, the detailed profile "scrunches" when not enough bar data exists to calculate it on - that's when mini profile takes over.
🔸Split Profile
You can also choose to show split volume profiles.
This is more similar to how a delta profile is shown. This is a styling preference only.
Rows Limit
Detailed profiles can use up to 500 rows.
Higher values were giving a "response too large" error, so I restricted the max to 500.
🔹Summary
That’s about it!
The goal of this script is simply to combine market structure with volume profiles and CVD so you can see how volume develops inside each structural move instead of across arbitrary time windows.
By anchoring profiles to BoS and CHoCH, you can study how participation builds during continuations, reversals, and rotations - and get a better feel for how each move was actually formed internally.
Hope you find it useful (:
Thank you guys and thank you PulseWire! Indicator

Zero Lag Kalman Structure [BOSWaves]Zero Lag Kalman Structure - Adaptive Trend Filtering with Deviation-Based Structure Detection
Overview
Zero Lag Kalman Structure is a precision trend identification system that tracks directional price movement through a zero-lag-compensated Kalman filter ribbon, where deviation-based structural levels dynamically form at volatility-normalized extremes and persist as active support and resistance zones until price invalidates them.
Instead of relying on fixed moving average crossovers or static support/resistance lookbacks, trend state, level formation, and break detection are determined through Kalman velocity tracking, ATR-normalized deviation measurement, and swing-based structure identification.
This creates adaptive trend boundaries and structural zones that reflect actual price conviction rather than arbitrary historical levels - contracting the ribbon during trending conditions when directional certainty is high, forming fresh levels during deviation extremes when price has meaningfully separated from the Kalman baseline, and incorporating BOS/CHoCH detection to reveal whether market structure is continuing or reversing.
Price is therefore evaluated relative to a filter that adapts to momentum velocity rather than conventional lagging averages.
Conceptual Framework
Zero Lag Kalman Structure is founded on the principle that meaningful structural zones emerge when price deviates from its statistically optimal estimated path by a volatility-significant margin, and that trend context is best captured by a filter engineered to eliminate the lag inherent to traditional smoothing methods.
Conventional support/resistance tools identify levels through historical pivot lookbacks, which ignore the dynamic nature of price conviction and the statistical state of the current trend. This framework replaces static pivot logic with Kalman-anchored deviation measurement informed by actual filter velocity and error covariance state.
Three core principles guide the design:
Trend direction should be captured by a velocity-aware Kalman filter with active lag compensation, not by lagging moving averages.
Structural levels must form at statistically significant deviation extremes, normalized to current volatility rather than fixed price distances.
Market structure breaks and character changes should be identified through swing-based logic tied to the same price data the filter operates on.
This shifts trend and structure analysis from static indicator crossovers into adaptive, filter-anchored confidence zones.
Theoretical Foundation
The indicator combines Kalman filter estimation theory, zero-lag error compensation, ATR-normalized deviation measurement, deviation zone persistence modeling, and swing pivot structure detection.
A Kalman filter baseline provides statistically optimal price estimation by balancing process noise and measurement noise parameters, while a velocity tracker within the filter captures directional momentum. Zero-lag compensation applies the residual error between current price and the filter estimate back onto the output, reducing phase delay. Deviation measurement identifies when price has separated from the filter by an ATR-scaled threshold, triggering level creation at the extreme point once price snaps back. BOS/CHoCH detection uses pivot highs and lows to identify structural breaks and character changes.
Four internal systems operate in tandem:
Kalman Filter Engine : Computes error-covariance-weighted price estimates with integrated velocity tracking, Kalman gain adaptation, and zero-lag correction applied to each bar.
Ribbon Construction System : Runs six parallel Kalman instances with incrementally increasing process noise to produce a multi-layered trend ribbon whose spread and color reflect directional strength.
Deviation Level Formation Logic : Monitors ATR-normalized distance from the Kalman estimate, records extreme highs and lows during deviation events, and creates persistent zone boxes upon mean reversion.
Market Structure Detection : Tracks swing pivot highs and lows using configurable lookback, identifies crossovers of those pivots, and classifies each break as either a BOS continuation or a CHoCH reversal depending on prior structural trend.
This design allows the trend filter, structural zones, and structure labels to operate as a unified system rather than independent overlapping indicators.
How It Works
Zero Lag Kalman Structure evaluates price through a sequence of filter-aware and deviation-driven processes:
Kalman State Initialization : On the first bar, filter state initializes with estimate equal to source price, zero velocity, and unit error covariance to establish a clean starting condition.
Prediction Step : Each bar predicts the next estimate by advancing the prior estimate by the velocity component weighted by the velocity weight parameter.
Velocity Tracking : A separate exponential tracker computes price-change velocity using a 95/5 blend of decayed prior velocity and current bar price change.
Kalman Gain Calculation : Gain is computed from current error covariance and measurement noise, controlling the balance between trusting the filter model versus reacting to new price data.
Estimate Update : The filtered estimate updates using the Kalman gain applied to the innovation - the difference between current price and the predicted estimate.
Zero-Lag Correction : Residual lag error between price and estimate is computed, then multiplied by the zero lag factor and current Kalman gain, and added back to the estimate to compress phase delay.
Ribbon Smoothing : The zero-lag estimate passes through a 0.8/0.2 exponential blend each bar to produce the final ribbon line, providing continuity without reintroducing significant lag.
Ribbon Color Gradient : The spread between the fastest and slowest ribbon lines is normalized by ATR to produce a ribbon strength value, which drives a color gradient between the configured bullish and bearish colors.
Deviation Monitoring : Each bar, the distance between close and the main Kalman line is measured in ATR units. When this exceeds the deviation threshold, the system begins tracking the extreme high or low of that deviation event.
Level Creation on Snap-Back : Once price returns inside 50% of the deviation threshold after an extended move, a new zone box is created centered on the tracked extreme, with width scaled to the level width ATR parameter.
Level Management : Active levels extend forward each bar. Broken levels - where price closes beyond the zone boundary - are deleted. When the level count reaches the configured maximum, the oldest level is removed to make space.
Retest Detection : Depending on the selected retest method, the system either monitors price interaction with zone boundaries or price proximity to the main Kalman line, applying cooldown periods to prevent signal clustering.
BOS/CHoCH Detection : Pivot highs and lows are tracked using the swing lookback parameter. Crossovers of the most recent pivot high trigger bullish structural breaks, and crossunders of the most recent pivot low trigger bearish structural breaks. The prior structural trend determines whether each break is classified as continuation (BOS) or reversal (CHoCH).
Together, these elements form a continuously updating trend and structure framework anchored in Kalman estimation theory.
Interpretation
Zero Lag Kalman Structure should be interpreted as a filter-anchored trend state with deviation-driven structural memory:
Ribbon Direction : The relative positioning and color of the six-line ribbon communicates directional trend bias. Bullish gradient color with spread above zero reflects upward trend conviction; bearish gradient with inverted spread reflects downward conviction.
Ribbon Spread Width : A widening spread between the fastest and slowest Kalman lines indicates strong directional momentum. A compressing spread suggests trend deceleration or potential transition.
Resistance Zones (Red) : Created at extreme highs where price deviated significantly above the Kalman line before snapping back, marking areas where price showed unsustainable separation to the upside.
Support Zones (Green) : Created at extreme lows where price deviated significantly below the Kalman line before recovering, marking areas where price showed unsustainable separation to the downside.
Zone Persistence : Active zones extend forward until broken by a close beyond the zone boundary, treating them as live structural reference until price demonstrably invalidates them.
BOS Labels : Dashed lines with "BOS" text mark continuation breaks of prior swing structure in the direction of the established trend.
CHoCH Labels : Dotted lines with "CHoCH" text mark counter-trend breaks of prior swing structure, signaling potential trend character changes.
▲ / ▼ Retest Signals : Small directional arrows identify price retesting either a deviation zone boundary or the main Kalman line, depending on the selected retest method.
Colored Candles : Bar coloring reflects the current ribbon gradient state for immediate directional reference across the entire chart history. Note: The original chart candles must be disabled in chart settings for the trend-colored candles to display properly.
Ribbon gradient strength, zone validity, and structural trend classification outweigh isolated price movements or individual bar reactions.
Signal Logic & Visual Cues
Zero Lag Kalman Structure presents two categories of structural interaction signals:
BOS / CHoCH Events : Labeled lines appear when price crosses a tracked swing pivot. BOS signals continuation of existing structure; CHoCH signals the first counter-trend structural break, indicating potential trend change.
Retest Signals (▲ / ▼) : Arrows appear when price interacts with an active deviation zone boundary (Levels mode) or touches the main Kalman line after sufficient separation (Kalman Line mode), confirmed by cooldown period to prevent rapid repeat signals.
Alert generation covers deviation level creation, BOS and CHoCH events, Kalman line retests, and support/resistance level retests for systematic monitoring across instruments and timeframes.
Strategy Integration
Zero Lag Kalman Structure fits within structure-aware and trend-following analytical frameworks:
Filter-Confirmed Directional Bias : Use ribbon color and spread direction as the primary trend filter before evaluating entries, favoring positions aligned with ribbon gradient.
Deviation Zone Re-entries : Use active support and resistance zones as high-probability re-entry reference areas when price returns to a level from the correct side.
BOS/CHoCH Context Alignment : Treat BOS events as continuation confirmation within established trends; treat CHoCH events as early warning of structural regime change requiring reassessment.
Retest-Based Entries : Use Kalman line or zone retests as lower-risk entry points within an established trend after initial separation has confirmed directional conviction.
Zone Invalidation as Exit Logic : Use level deletion events - where price closes beyond a zone boundary - as structural evidence that the prior support or resistance thesis is no longer valid.
Multi-Timeframe Structure Layering : Apply higher-timeframe deviation zones and BOS/CHoCH context to filter lower-timeframe entry signals for improved precision.
Technical Implementation Details
Core Engine : Kalman filter with error covariance tracking, Kalman gain adaptation, and integrated velocity model
Lag Correction : Zero-lag factor applied multiplicatively with current Kalman gain to preserve filter responsiveness at the correction stage
Ribbon System : Six parallel Kalman instances with linearly incremented process noise, blended via gradient fill
Level Formation : ATR-normalized deviation threshold with extreme tracking, snap-back detection, and box-based zone persistence
Structure Detection : Pivot high/low crossover logic with trend state tracking for BOS/CHoCH classification
Retest Logic : Dual-mode detection supporting zone boundary interaction and Kalman proximity, each with configurable cooldown
Visualization : Gradient ribbon fills, persistent zone boxes, labeled structure lines, and signal arrows
Performance Profile : Optimized for real-time execution with per-bar level management across all timeframes
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Short-term structure tracking with responsive deviation settings for intraday scalping
15 - 60 min : Intraday trend context with balanced deviation threshold and level persistence
4H - Daily : Swing-level structure identification with ATR-normalized zones carrying multi-session significance
Suggested Baseline Configuration:
Process Noise (Q) : 0.01
Measurement Noise (R) : 0.5
Zero Lag Factor : 1.0
Velocity Weight : 0.5
Ribbon Spread : 0.003
Deviation Threshold (ATR) : 1.5
Level Width (ATR) : 0.25
Maximum Levels : 6
Level Extend Bars : 50
Swing Lookback : 5
Retest Method : Kalman Line
Retest Cooldown : 50
Show Ribbon : Enabled
Show Deviation Levels : Enabled
Show BOS / CHoCH : Enabled
These suggested parameters should be used as a baseline; their effectiveness depends on the asset's volatility profile, structural characteristics, and preferred signal frequency, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Filter too reactive to noise : Increase Measurement Noise (R) to make the Kalman gain more conservative and smooth the estimate more aggressively.
Filter too slow to respond : Increase Process Noise (Q) to allow faster adaptation to genuine price movements, or increase Zero Lag Factor to strengthen lag correction.
Levels forming too frequently : Increase Deviation Threshold to require greater ATR-normalized separation before a level is created.
Levels forming too rarely : Decrease Deviation Threshold to trigger level creation at more moderate deviations.
Zones too wide or too narrow : Adjust Level Width multiplier to scale zone thickness proportionally to current ATR.
Too many active levels cluttering the chart : Reduce Maximum Levels so older zones are removed sooner, keeping only the most recent structural reference.
BOS/CHoCH signals too frequent : Increase Swing Lookback to require more significant pivot formations before a structural break is recognized.
BOS/CHoCH signals too infrequent : Decrease Swing Lookback for faster swing detection and more responsive structural classification.
Retest signals clustering : Increase Retest Cooldown to enforce greater bar separation between consecutive retest events.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets with clear directional phases where Kalman velocity remains consistently signed
Instruments with regular mean-reversion behavior where deviation extremes produce reliable structural zones
Swing and position trading approaches where BOS/CHoCH context informs multi-bar directional bias
Structure-based strategies that benefit from ATR-normalized level placement over fixed-point lookback methods
Reduced Effectiveness:
Choppy, range-bound markets with frequent shallow deviations that trigger premature level creation
Extremely low volatility environments where ATR normalization compresses zones to negligible significance
News-driven or gapped markets with discontinuous price behavior that bypasses zone boundaries without interaction
Markets with highly irregular volatility profiles where ATR scaling produces inconsistently sized zones
Consolidation and sideways price action where trend-following and structure-based methodologies inherently struggle due to lack of sustained directional conviction
Integration Guidelines
Confluence : Combine with volume analysis, higher-timeframe trend context, or momentum oscillators to confirm deviation zone significance
Ribbon Alignment : Trust structural breaks and retest signals occurring in the direction of the current ribbon color gradient
Zone Side Discipline : Treat deviation zones as directional only - approach support zones from above for bullish entries, resistance zones from below for bearish entries
CHoCH Awareness : Reduce directional exposure when CHoCH events occur against the prior established structural trend until a confirming BOS in the new direction appears
Velocity Respect : During periods of high Kalman velocity as reflected by wide ribbon spread, expect price to sustain moves further from the filter before meaningful retests occur
Level Invalidation Response : When a zone is broken, treat the break as structural confirmation of the new directional move rather than a retest opportunity
Disclaimer
Zero Lag Kalman Structure is a professional-grade trend filtering and structure analysis tool. It uses Kalman estimation theory with zero-lag compensation and ATR-normalized deviation measurement but does not predict future price movements. Results depend on market conditions, volatility characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates volume context, higher-timeframe bias, and comprehensive risk management. Indicator

Pattern Recognition Signals | ProjectSyndicatePattern Recognition Signals automatically identifies and validates high-probability, non-repainting Double Top and Double Bottom patterns. It filters for structural quality, calculates adaptive take-profit and stop-loss zones based on Average Daily Range (ADR), and presents a complete statistical breakdown on a non-intrusive dashboard to provide a quantifiable edge.
🧠 NRP Multi-Wave Detection — identifies classic Double (W/M) and Triple (W/M) patterns using a non-repainting pivot engine, ensuring signals are confirmed and stable.
🎯 ADR-Adaptive TP/SL Zones — automatically calculates and plots TP1, TP2, and SL zones based on a percentage of the 10-day ADR, allowing the strategy to dynamically adapt to any asset's volatility.
🎨 Direction-Matched Colors — Bullish pattern labels are colored green to match the TP zones, and Bearish labels are colored red to match the SL zone, providing instant visual confirmation of trade direction.
📊 Full Performance Dashboard — provides a complete statistical overview, including the real-time ADR10 value, total signals, win rates for TP1/TP2, and a log of the last 10 trade outcomes.
✅ Advanced Quality Control Filters — user-configurable inputs for Max Pattern Bars, Max Pattern Height (% of ADR10), and Min Bars Between Signals eliminate low-quality or excessively large patterns and prevent over-signaling.
🔔 Comprehensive Alerts — get a single, detailed alert per signal—including the symbol, timeframe, entry price, SL, TP1, and TP2—formatted for easy integration with automated trading systems.
🔧 Fully Customizable — control everything from pivot lengths and pattern quality filters to the colors and extension of all zones, labels, and dashboard elements.
🎯 Why this algo is unique: Standard ZigZag and pattern indicators are notorious for repainting and providing subjective signals with no statistical backing. This algorithm provides an objective, fully-gated, non-repainting signal engine. It doesn’t just draw a pattern; it builds a complete, quantifiable trading framework around it with adaptive risk management (ADR-based zones) and a dashboard to prove its historical performance on the chart you are trading.
🚀 Apply to Gold (XAUUSD), Forex, Crypto, and Indices on any M5/M10/M15/M30/H1. The ADR-based system and extensive quality filters allow it to adapt to anything from M5 scalping to H4 swing trading.
🎯 How to use this? Use the dashboard to understand the strategy's recent performance on the current asset/timeframe. Adjust the TP/SL and pattern filter percentages to match your risk tolerance. Consider taking trades that align with the higher-timeframe trend for higher probability setups.
⚠️ IMPORTANT NOTICE: This indicator is designed to identify statistically-backed pattern signals. It should NOT be used as a standalone signal for entering trades. Always use it in conjunction with your own trading strategy, price action analysis, and other technical indicators to confirm trade setups and manage risk. Indicator

Adaptive Pivot Structure [WillyAlgoTrader]Adaptive Pivot Structure (APS) is an overlay indicator that maps market structure in real time by detecting swing pivots, classifying structural breaks (BOS / CHoCH), tracking missed reversal levels, and projecting a dynamic Fibonacci grid between the last confirmed pivot and the live forming extreme.
Most pivot-based tools plot swing points with a fixed delay and leave the trader to interpret structure manually. APS automates the full workflow: it detects pivots, grades their strength against ATR, identifies whether the structure is continuing (BOS) or reversing (CHoCH), keeps track of levels that price skipped over, and stretches a Fibonacci retracement grid that updates bar-by-bar as the current swing extends — giving you an always-current picture of where price sits within the swing.
🔍 WHAT MAKES IT ORIGINAL
APS combines five analytical layers into a single coherent overlay that would otherwise require multiple separate indicators:
1. ATR-graded pivot detection. Every swing high and low is measured against the current ATR to classify it as Strong (swing > 1.5× ATR) or Weak. You can filter the display to show only strong pivots, only weak ones, or all — allowing you to strip noise on lower timeframes while keeping full detail on higher ones.
2. Automated BOS / CHoCH classification. The indicator continuously compares each new pivot high to the previous pivot high, and each new pivot low to the previous pivot low. When a higher high forms in an existing uptrend, the script labels it as a Break of Structure (BOS ↑) — trend continuation. When a higher high forms after a downtrend, it labels a Change of Character (CHoCH ↑) — potential reversal. The same logic applies in reverse for bearish breaks. This removes the subjectivity of manually drawing and labeling structure shifts.
3. Missed reversal tracking. When two consecutive pivots form on the same side (e.g. two pivot highs without an intervening pivot low), the "missed" pivot low between them is flagged with a ◇ marker and extended as a dotted horizontal level until price breaks it. These missed levels often act as hidden support/resistance that conventional pivot tools ignore entirely.
4. Live (potential) pivot tracking. Instead of waiting for full confirmation (which inherently lags by N bars), APS tracks the running extreme since the last confirmed pivot and plots it in real time as a "potential next pivot" with a dashed zigzag extension. This gives you immediate visual feedback on how far the current swing has traveled and where the Fibonacci grid is anchored — without pretending the pivot is confirmed.
5. Dynamic Fibonacci grid. A full Fibonacci retracement (0, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0 — with optional 1.272 and 1.618 extensions) is drawn between the last confirmed pivot and the live pivot. The grid redraws every bar as the live extreme moves, so the retracement levels always reflect the current swing range. The OTE (Optimal Trade Entry) zones at 0.236–0.382 and 0.618–0.786 are highlighted with a fill to make them easy to spot at a glance.
⚙️ HOW IT WORKS
Pivot detection:
Pivots are identified using ta.pivothigh() and ta.pivotlow() with a user-defined lookback (Pivot Length). A pivot high is confirmed when the bar has N lower highs on both sides; a pivot low when the bar has N higher lows on both sides. This means confirmed pivots appear with a delay of N bars — this is inherent to the standard pivot detection algorithm.
Strength grading:
Once a pivot is detected, the script measures the absolute price distance from the previous pivot to the current one. If this distance exceeds 1.5× the current ATR value, the pivot is classified as "Strong"; otherwise "Weak." A minimum swing size filter (Min Swing Size, expressed as an ATR multiple) lets you suppress insignificant swings entirely.
Structure logic:
The indicator maintains a running structure direction variable. When a new pivot high exceeds the previous pivot high and the current structure is already bullish, it triggers a BOS ↑. If the structure was bearish, it triggers a CHoCH ↑ (reversal). Mirror logic applies for lows. This follows standard Smart Money Concepts methodology.
Missed pivot logic:
Between any two consecutive same-side pivots, the indicator records the highest high or lowest low that occurred in the gap. This "missed" extreme is marked and extended as a horizontal level. The level is automatically removed from the chart when price closes through it — keeping only active levels visible.
Live pivot:
After each confirmed pivot, the script starts tracking the running high (if expecting a pivot high next) or running low (if expecting a pivot low). This value updates every bar and serves as one anchor of the Fibonacci grid. A "▲?" or "▼?" label and a dashed line show where this potential pivot currently sits.
Fibonacci grid:
The retracement is calculated between the lower and upper anchor of the current swing (using the confirmed pivot on one side and the live extreme on the other). All seven standard ratios are drawn as horizontal lines from the earlier pivot's bar index to 5 bars into the future. The 0.5 and 0.618 levels are drawn thicker and in a highlight color for emphasis.
⚠️ REPAINTING BEHAVIOR — IMPORTANT
This indicator is designed as a live analysis tool , not a backtesting signal generator. The following elements will change on the current bar:
— The Live Pivot marker moves as the running extreme updates
— The Fibonacci grid redraws as the live anchor moves
— BOS/CHoCH labels based on pivots inherit the standard pivot detection delay
Confirmed pivots themselves do not repaint — once a bar is no longer within the pivot lookback window, its pivot status is final. The alert system includes a "Confirmed Only" toggle (on by default) that restricts alerts to bar-close events, ensuring no repainting alerts reach your trading bot.
📖 HOW TO USE
Reading the chart:
— ▲ / ▽ labels at swing lows = confirmed pivot lows (filled = Strong, outline = Weak)
— ▼ / △ labels at swing highs = confirmed pivot highs (filled = Strong, outline = Weak)
— ◇ markers = missed reversals (cyan for missed lows, orange for missed highs)
— Dotted horizontal lines from ◇ markers = active missed levels (auto-removed when broken)
— "BOS ↑/↓" yellow labels = Break of Structure (trend continuation)
— "CHoCH ↑/↓" green/red labels = Change of Character (potential reversal)
— Purple dashed line with "▲?" or "▼?" = live potential pivot (updates every bar)
— Fibonacci lines with OTE zone fills = dynamic retracement grid
Suggested workflow:
— Use CHoCH labels as early warning of trend reversals — then look for entries in the Fibonacci discount/premium zones
— Use BOS labels to confirm trend continuation — look for pullback entries at 0.618–0.786 retracement
— Watch the dashboard's "Fib Zone" readout: Discount (below 38.2%) favors buys, Premium (above 61.8%) favors sells, Equilibrium suggests waiting
— Missed reversal levels act as hidden S/R — watch for reactions when price revisits them
Timeframe guidance:
— Scalping (1–5min): Pivot Length 3–5, Min Swing 0.5 ATR, Strong Only filter
— Intraday (15min–1H): Pivot Length 5–10, default settings
— Swing (4H–Daily): Pivot Length 10–20, show all strengths for full context
⚙️ KEY SETTINGS REFERENCE
— Pivot Length (default 5): bars left/right for pivot detection — lower = faster but noisier
— ATR Length (default 14): period for strength grading and minimum swing filter
— Min Swing Size (default 0.0): minimum swing as ATR multiple — increase to filter small moves
— Pivot Strength Filter (default All): show All / Strong Only / Weak Only
— Max Active Levels (default 10): maximum missed-reversal horizontal lines displayed
— Show Live Pivot (default On): toggle the real-time potential pivot tracker
— Show Fibonacci Grid (default On): toggle the dynamic retracement overlay
— Show Extensions (default Off): add 1.272 and 1.618 extension levels
— Show Fib Zone Fill (default On): highlight OTE zones (0.236–0.382 and 0.618–0.786)
— Alerts: Confirmed Only (default On): restrict alerts to bar-close confirmation — recommended for bots
📊 Dashboard
The info panel (adjustable to any chart corner) displays:
— Current market structure (Bullish / Bearish / Ranging)
— Last confirmed pivot type and price
— Live pivot direction and price
— Number of active missed-reversal levels
— Last PH and PL values
— Fib Zone classification (Premium / Discount / Equilibrium) with percentage
— Current timeframe and indicator version
⚠️ DISCLAIMER
— This tool is intended for live chart analysis and structure mapping — it is not a standalone entry/exit signal system.
— The live pivot and Fibonacci grid are designed to repaint by nature — they track the forming swing in real time. Do not use them for backtesting.
— Past pivot patterns and structure shifts do not guarantee future price behavior.
— Always combine structural analysis with proper risk management and additional confluence. Indicator
