SAMS Early Morning Range LinesThis indicator maps the premarket / early-morning range (EMR) and uses that range as a reference for regular-session structure and breakout signals.
What it plots
EMR high / low (green / red): the high and low printed during the 04:00–09:30 America/New_York window. These levels persist into the regular session.
Previous-day RTH range (Rumer Box): prior regular-session high and low, with a light purple fill between them. The prior RTH range is only updated after a full RTH session has printed.
Premarket bands (RTH only): optional ±% envelopes around the EMR high and EMR low. Default is 0.03%. Use these as a buffer around the premarket extremes instead of treating the raw high/low as a single line.
Sessions are defined in Eastern time (America/New_York) so DST is handled by TradingView’s session engine.
Signals
Signals fire only after the EMR session ends and only if EMR high and low exist.
Buy: first valid break of EMR high
Sell: first valid break of EMR low
Re-Buy: after a sell, price recrosses back up through EMR low
Re-Sell: after a buy, price recrosses back down through EMR high
Only one primary buy and one primary sell are allowed per day unless a re-entry flips the state.
Signal modes
Crossover Candle — close crosses the EMR level.
First Fully Crossed — the bar’s low crosses above EMR high (buy) or the bar’s high crosses below EMR low (sell). Stricter than a close-only cross.
Open Confirmation — the cross is detected on the current bar, then confirmed on the next bar if open continues in the breakout direction relative to the prior close. Reduces same-bar fakeouts.
Default mode is Open Confirmation.
Alerts
On a confirmed signal the script fires a once-per-bar-close alert:
SAMS_EMR_BUY / SELL / RE_BUY / RE_SELL
plus ticker, interval, and close.
Create alerts from the indicator with “Any alert() function call”.
Suggested use
Use EMR high/low as the first overnight auction box. The previous-day RTH box is context for whether the open is inside, above, or below yesterday’s cash range. Bands are for traders who want a small buffer instead of a hard level. This is a level + confirmation tool, not a standalone strategy. Combine with your own risk rules, size, and higher-timeframe bias.
Notes
Works best on intraday charts that include premarket data (1–15 minute is typical). If the symbol or session settings omit 04:00–09:30 ET prints, EMR high/low will be incomplete. Past session levels and signals are not a guarantee of future results. 지표

Breakout Retest Signals [algotim]Overview
Breakout Retest Quality Signals is a price-structure indicator designed to distinguish ordinary level breaks from breakouts that produce a meaningful retest.
The script does not treat every cross of a swing level as a valid breakout. A confirmed swing high or low first establishes the structural reference. Price must then close beyond that level by a minimum ATR-adjusted distance. Once the breakout qualifies, the script creates a volatility-scaled zone around the broken level and monitors the following price action for a retest.
The central purpose of the indicator is to evaluate the quality of that retest rather than simply marking every touch of the broken level.
Problem Statement
A basic breakout indicator can produce signals whenever price moves marginally above or below a previous high or low. Likewise, a basic retest indicator may treat any return to the broken level as confirmation.
Those approaches do not distinguish between a decisive breakout followed by a controlled rejection and a weak breakout followed by deep penetration of the level.
This script addresses that problem by separating the setup into three stages:
**structural breakout -> volatility-scaled retest zone -> retest quality evaluation**
This makes the retest itself part of the signal validation process.
Methodology
1. Confirmed structural levels
The script uses confirmed pivot highs and pivot lows to establish the most recent structural reference points.
A pivot is confirmed using the configured swing length, so the structural levels are not based on unconfirmed turning points.
2. ATR-qualified breakout
A bullish breakout occurs when price crosses above the most recent confirmed pivot high.
A bearish breakout occurs when price crosses below the most recent confirmed pivot low.
The breakout must also exceed the configured minimum breakout strength, measured as a multiple of ATR:
**Bullish displacement = close - broken high**
**Bearish displacement = broken low - close**
The displacement must be at least the user-defined ATR multiple.
This prevents small crosses around a structural level from automatically becoming breakout events.
3. Dynamic breakout zone
After a qualified breakout, the script creates a zone around the broken structural level.
The zone width is calculated from ATR rather than from a fixed number of ticks or points:
**Zone width = ATR x Zone Width Multiplier**
This allows the same methodology to account for different volatility conditions.
For a bullish breakout, the broken level becomes a potential support area.
For a bearish breakout, the broken level becomes a potential resistance area.
4. Retest monitoring
After the breakout, the zone remains active while the script waits for price to return to it.
The retest is only considered during the configured retest window. The zone also has a maximum lifetime so that an old breakout does not remain active indefinitely.
This creates an explicit state sequence rather than evaluating every bar independently:
**Breakout detected -> zone active -> retest pending -> retest evaluated -> confirmed or invalidated**
5. Retest Quality Engine
The primary differentiating component is the Retest Quality Engine.
When price enters the breakout zone, the script measures how deeply price penetrates the zone before moving back in the breakout direction.
Penetration is normalized against the width of the zone, allowing the measurement to remain related to the current volatility regime.
The resulting quality score favors relatively shallow and decisive rejection while assigning lower quality to deeper penetration.
The score is then compared with the user-defined minimum quality threshold.
This means that touching the zone alone is not necessarily enough to generate a signal.
6. Rejection confirmation
When the rejection-candle option is enabled, the retest must also close back outside the zone in the original breakout direction.
For a bullish setup, price must reject the zone and close back above it.
For a bearish setup, price must reject the zone and close back below it.
This additional condition separates a retest rejection from a simple penetration of the breakout area.
Signal Workflow
Bullish workflow
1. A confirmed pivot high establishes a structural resistance level.
2. Price crosses above that pivot.
3. The close must exceed the pivot by at least the configured ATR displacement.
4. A bullish breakout zone is created around the broken level.
5. The script waits for price to return to that zone.
6. Penetration depth is measured relative to the zone width.
7. The Retest Quality Engine converts the penetration into a quality score.
8. If the score meets the minimum threshold, the retest can qualify.
9. When rejection-candle confirmation is enabled, price must close back above the zone.
10. A bullish confirmation is then displayed.
Bearish workflow
1. A confirmed pivot low establishes a structural support level.
2. Price crosses below that pivot.
3. The close must exceed the pivot by at least the configured ATR displacement.
4. A bearish breakout zone is created around the broken level.
5. The script waits for price to return to that zone.
6. Penetration depth is measured relative to the zone width.
7. The Retest Quality Engine calculates the retest quality.
8. If the score meets the minimum threshold, the retest can qualify.
9. When rejection-candle confirmation is enabled, price must close back below the zone.
10. A bearish confirmation is then displayed.
Why This Indicator Is Different
A conventional breakout script generally answers one question:
**Did price break the level?**
A conventional retest script generally adds:
**Did price come back to the level?**
This indicator adds another layer:
**How cleanly did price reject the breakout zone after returning to it?**
The distinction is important because not all retests have the same structure.
The implementation combines the breakout and retest stages into one state-based process. ATR is used in two separate but related ways: first to filter weak structural breaks, and then to scale the breakout zone to current volatility.
The Retest Quality Engine then evaluates the interaction with that zone rather than treating every retest as equivalent.
The result is a more selective breakout-retest workflow instead of a collection of unrelated indicators.
Inputs
Structure Detection
**Swing Lookback (Pivot Length)**
Controls the number of bars used to confirm swing highs and lows.
**Minimum Breakout Strength (x ATR)**
Sets the minimum closing displacement beyond the structural level required for a breakout.
Breakout Zone
**Zone Width (x ATR)**
Controls the width of the dynamic breakout zone.
**Zone Max Lifetime (bars)**
Limits how long a breakout zone remains active.
Retest and Quality Engine
**Max Bars to Wait for Retest**
Defines the maximum number of bars allowed between breakout and retest.
**Minimum Retest Quality Score**
Sets the minimum quality score required for confirmation.
**Require Rejection Candle on Retest**
Requires the retest candle to close back in the breakout direction.
Volatility
**ATR Length**
Controls the ATR calculation used for breakout displacement and zone sizing.
Visual Style
The visual settings control bullish and bearish colors, zone opacity, confirmation labels, and the number of active zones displayed.
Alerts
The script can be used with TradingView alerts for the available confirmation conditions.
Alerts should be configured from the script's available alert conditions after adding the indicator to the chart.
Practical Usage
The indicator is intended to be used as a structural price-action filter.
A practical workflow is to first identify the direction and broader market context, then use the script to monitor qualified structural breaks and their subsequent retests.
Higher minimum breakout-strength and retest-quality settings will generally make the conditions more selective.
Lower thresholds will allow more setups but may also admit weaker breakouts and less decisive retests.
The breakout zone can also be used as a visual reference for evaluating whether price is accepting or rejecting the broken structure.
Signals should be evaluated together with the instrument, timeframe, market conditions, and the trader's own risk-management process.
Limitations
Pivot levels require confirmation and therefore are identified only after the required swing bars have formed.
A breakout that satisfies the ATR threshold does not guarantee continuation.
The quality score measures the geometry of the retest relative to the calculated zone; it does not predict the future direction or magnitude of price movement.
ATR-based measurements adapt to volatility but do not eliminate market noise.
A retest can fail after confirmation, particularly during rapidly changing or range-bound conditions.
The indicator is an analytical tool and should not be interpreted as a guarantee of profitable trading results.
Notes
This script is based on a single price-structure workflow: confirm the structural level, qualify the breakout using ATR displacement, define a volatility-scaled zone, monitor the retest, and evaluate the quality of the rejection.
The intention is to provide a consistent framework for studying breakout-retest behavior rather than to claim that every qualified setup will produce continuation. 지표

Market Maker BoxMarket Maker Box draws the last completed candle’s high and low as a live trading box, then colors that box for the candle that is forming now.
The idea is simple: market structure from the previous candle becomes the range you scalp this candle. Green means the forming candle is leaning up. Purple means it is leaning down. No color means chop — stand down.
Built for 5m and 15m charts so price prints inside the box, not beside it.
The boxes
Turn on the timeframes you want. They all run the same engine.
4H — on by default. Prior 4-hour high/low over the current 4-hour window.
Daily — prior day high/low over today.
9-day — prior 9-day high/low over the current 9-day window.
When a window closes, that box dies and a new one starts from the candle that just completed. The box grows with printed bars and stops a few candles past price so the live bar is readable.
How to read it
Color Meaning Destination
Neon green
Forming candle leaning bullish
Upper half — median to high
Neon purple
Forming candle leaning bearish
Lower half — low to median
Orange / TF tint
Chop. No call.
No shade
The shaded half is where price is predicted to go on that candle, not where you blindly click.
Labels show the level and how far price is from it, in percent.
Optional fibs (0.236 / 0.382 / 0.618 / 0.786) draw on every box you have turned on.
The lean
Trend first. A dip does not flip a green box purple.
EMA stack and slope on that box timeframe
The two candles before the box
A higher-timeframe completed body (daily helps 4H, 9-day helps daily)
Live candle can confirm the trend
Live candle cannot reverse the color unless a sweep-and-reclaim prints late in the window
ADX chop gate — no color in a dead tape
Color must hold a few chart bars before it paints
Stack the boxes. A green 4H inside a green daily is the clean scalp. Mixed colors means wait.
How to use it
Green box, price in the lower quarter → look long toward the median, then the high
Purple box, price in the upper quarter → look short toward the median, then the low
Price already in the destination half → you are late; wait for a pullback or the next box
Narrow grey box → range is too thin; fees eat the trade
Box-timeframe closes outside the range → the box is dead. That is continuation, not a fade
The box is the map. Your entry is still a reclaim, a rejection, or a limit at the level.
Defaults that stay clean
4H box on. Daily and 9-day off. Median on. Extra fibs off. Destination shade on. Break stamps off.
Add daily and 9-day when you want higher-timeframe context. Leave them off when you only want the session range.
Alerts
Off by default. Optional:
Price taps the box high or low
Confirmed 4H lean flips to bull or bear
What this is not
Not a signal bot. Not a guarantee the forming candle closes that color. Not financial advice.
The box tells you where you are and which way this window is leaning. You still pick the trigger and the size.
Pine v6 · © SRUS · Education and research only. 지표

Session Breakout ContextMulti-Market Session Breakout Context
Description
Multi-Market Session Breakout Context is a rule-based intraday indicator designed to help traders organize session structure across gold, forex pairs, and selected index instruments. It was originally developed for XAUUSD and can also be applied to other markets whose session behavior, liquidity, and data quality are suitable for this type of analysis.
The indicator tracks the Asia, London, and New York session ranges using the America/Chicago timezone. It displays session highs, lows, and midpoint reference levels, then classifies selected price movements as directional breakouts or sweep/fade conditions. The chart markers and dashboard are intended to support discretionary analysis and trade planning. They do not place orders, manage positions, or guarantee a market outcome.
The main session conditions are:
•London breakout: price moves beyond the completed Asia session range.
•London fade: price sweeps an Asia range boundary and satisfies the rule-based reversal filters.
•New York breakout: price moves beyond the completed London session range.
•New York fade: price sweeps a London range boundary and satisfies the rule-based reversal filters.
•Asia breakout: price moves beyond the completed New York session range.
The indicator also provides additional market context through pivot-based directional readings, RSI divergence conditions, volatility measurements, volume-derived pressure and spread classifications, prior-day levels, previous-week levels, daily range references, weekly open, four-hour swing references, and a fixed time blackout window. These components are contextual filters. They are not independent guarantees of direction, probability, or profitability.
The optional dashboard summarizes the current session state, rule-based directional alignment, reference levels, entry and stop planning zones, target reference levels, and hypothetical point movement. Any displayed score is a rule-based alignment score, not a statistically validated probability or accuracy rate. Any displayed point movement is hypothetical and does not represent broker P&L, account performance, or a Strategy Tester result.
How to use the indicator
1.Apply the indicator to a standard candlestick chart.
2.Begin with XAUUSD and a lower intraday timeframe such as 5 minutes or 15 minutes.
3.Confirm that the chart symbol, exchange or broker feed, timezone, and session schedule are appropriate for your market.
4.Allow the relevant session range to form before interpreting its breakout or fade conditions.
5.Use the plotted levels as analytical references rather than guaranteed entry or exit prices.
6.Independently evaluate market structure, spread, volatility, scheduled events, liquidity, and position risk before making any trading decision.
7.Test the indicator on historical data and in a simulated environment before considering live use.
The displayed session schedule is based on fixed Chicago-time windows. The indicator should therefore be checked after daylight-saving changes and on every symbol or data feed where it is used. Session behavior can differ between spot metals, forex pairs, CFDs, futures, and other instruments.
Signal interpretation
A green or red breakout marker identifies a rule-based directional breakout classification. A blue or orange fade marker identifies a rule-based sweep/fade classification. These classifications describe what the indicator detected; they are not instructions to buy or sell and do not predict how far price will move.
Signals may depend on the active chart bar and on confirmed pivot information. A condition can change before the realtime bar closes. Users should evaluate signals on confirmed bars when they require stable, repeatable readings and should not assume that every historical marker was available at the beginning of the bar where it appears.
The indicator is intended for standard time-based candles. Signal interpretation may be misleading on non-standard chart types such as Heikin Ashi, Renko, Kagi, Point & Figure, Line Break, or Range charts.
Example screenshots
The following screenshots show selected visual examples on XAUUSD. They demonstrate how the indicator labels different session conditions. They are illustrative examples only and are not a complete record of all signals.
1. Full XAUUSD overview
Full overview of the indicator on XAUUSD showing session ranges, reference levels, breakout and fade markers, and the rule-based dashboard.
2. London fade long
London fade-long example after price sweeps the lower boundary of the completed Asia range. The marker represents a rule-based condition, not a guaranteed reversal.
3. London fade short
London fade-short example after price sweeps the upper boundary of the completed Asia range. Traders should independently evaluate confirmation, stop placement, and market conditions.
4. London sell
London bearish breakout example showing a downside break of the Asia session range. The displayed level is an analytical reference and does not represent an executed order.
5. New York sell
New York bearish breakout example showing a downside break of the completed London session range. Results may vary according to symbol, data feed, spread, liquidity, and execution conditions.
6. New York fade long
New York fade-long example after price sweeps the lower boundary of the completed London range. This is a rule-based signal classification for discretionary analysis.
7. New York fade short
New York fade-short example after price sweeps the upper boundary of the completed London range. The indicator does not guarantee continuation or reversal.
The screenshots are visual examples of the indicator’s signal classifications and are not a performance record. They do not show every signal, guarantee future results, or account for spread, slippage, commissions, liquidity, or execution delay. Signal behavior may vary across instruments, brokers, data feeds, and timeframes.
Limitations
This indicator is a decision-support and chart-organization tool. It is not investment advice, an automated trading system, a broker connection, or a guarantee of profit. It does not determine position size, account risk, contract quantity, execution quality, or whether a trade is appropriate for a particular user.
The indicator does not use a broker-level order book or guarantee access to true exchange-level volume. Volume-derived calculations may behave differently on symbols with limited, synthetic, tick, or unavailable volume. Reference levels and classifications can also vary according to the selected symbol, historical data, chart timeframe, session template, and data provider.
Historical examples should not be interpreted as evidence of future performance. Any decision to trade remains the user’s responsibility. Always consider the possibility of loss and use risk controls appropriate to your own circumstances.
Release notes
Initial public release of the Multi-Market Session Breakout Context indicator. This version provides Asia, London, and New York session levels, rule-based breakout and fade classifications, contextual reference levels, and an optional dashboard for discretionary chart analysis.
지표

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

Relative Volume Breakout Context [Pineify]Relative Volume Breakout Context
Overview
Relative Volume Breakout Context tests an intraday price escape against normal volume at the same exchange-session position, then tracks price acceptance as participation changes.
Problem Definition
Intraday volume has a time-of-day shape: opening, midday and closing bars do not share one natural activity level. A rolling average mixes those positions, making routine opening activity look exceptional or meaningful midday volume look ordinary. A fixed channel break adds price displacement but not time-adjusted participation. A one-bar marker also loses whether price later holds its boundary on sustained or fading volume.
Design Rationale
Each bar is assigned a slot by elapsed minutes from a session start, and volume is compared only with prior observations from that slot. Exponentially weighted statistics let old sessions lose influence, trading stability for responsiveness. A dispersion floor controls unstable Z scores. Price must close beyond a prior range by a minimum ATR fraction. The joint score uses a geometric mean so weak price or volume constrains the result; an additive score could hide that weakness. Freezing the crossed rail adds state, but preserves an auditable acceptance boundary after confirmation.
Key Features
Prior-only same-position volume expectation with sample reliability and a dispersion floor.
ATR-normalized breakout joined with volume surprise in one qualified event.
Frozen acceptance zone, one-shot decay alert, bounded labels and dashboard.
How It Works
Exchange-local bar time becomes elapsed session minutes. On 1-30 minute charts, elapsed time divided by chart interval selects one of 1,440 slots. Each stores a count, exponential volume mean and variance. The current bar reads them before updating, preventing self-inclusion.
After enough samples, dispersion is the larger of observed deviation and a percentage of expected volume. Volume Z is current minus expected volume divided by dispersion, capped at plus or minus five. Relative volume is the current/expected ratio; reliability rises with sample count.
Price rails are the highest high and lowest low of preceding bars. A fresh event closes beyond a rail, exceeds minimum ATR distance and meets volume Z. Volume and distance form a reliability-scaled geometric score with directional sign.
Confirmation freezes the rail. The frontier keeps the greatest high or lowest low while price remains outside. Z falling to the decay threshold creates one thinning alert. Closing through the rail invalidates tracking; age can expire it. Transitions require a completed bar.
How Multiple Indicators Work Together
Slot normalization asks whether participation is unusual now; the prior range asks whether price left an observed boundary; ATR standardizes escape depth; reliability limits warm-up confidence; memory tests later acceptance. Without volume this is a routine breakout, without price it is only RVOL, and without memory it cannot distinguish sustained support from thinning participation.
Trading Ideas and Insights
Treat confirmation as context, not an order. A green or red zone shows accepted extension from the frozen boundary. Amber means price still holds outside while same-position participation has decayed. That can frame questions about consolidation, fragility or absorption, but does not predict failure. Compare events with one instrument, session template and interval.
Unique Aspects
Common RVOL blends unrelated day parts, while common breakout tools stop at the crossing. Here, prior-only per-slot statistics feed a frozen-boundary state. Initiation requires time-adjusted participation and volatility-scaled displacement; continuation separates price acceptance from volume support. The thinning state remains descriptive rather than claiming lower follow-through volume causes reversal.
How to Use
Match session start and length to the regular exchange session and use a standard 1-30 minute chart. Let each slot collect the minimum samples; the dashboard shows WARMING before readiness. Faint lines are candidate rails. A diamond and RVOL label mark confirmation; the band spans frozen rail to frontier. Pane Z explains volume and signed score shows joint context. Set alerts to Once Per Bar Close.
Customization
Short memory adapts faster but is noisier; long memory is steadier but lags change. Minimum samples trades availability for depth. Raise the dispersion floor when quiet history overreacts. Range length and ATR distance control price selectivity; volume Z controls participation. Decay Z sets cooling and event age bounds observation.
Assumptions and Limitations
Bars must align with the configured exchange-local session. Holidays, half days, halts, extended-hours mixing and template errors reduce comparability. Bars use opening minute and may span session end. Missing volume disables scoring; tick volume is not centralized traded volume. Exponential statistics are path-dependent, capped Z is not probability, and ATR or rails lag. The script does not infer order intent, fills, profitability or next direction. Feed revisions and parameters can alter history. Values move intrabar; transitions and alerts commit at close.
Conclusion
This indicator replaces mixed-time RVOL with a session-position benchmark and extends a qualified breakout into an acceptance path. It reports escape, participation and thinning as context, not a forecast.
지표

Opening Range Breakout [ITA]🟠 OVERVIEW
Opening Range Breakout marks the high and low of the first minutes of the trading session, extends those boundaries forward, and flags the bar where price closes outside them. The range is built live as the session opens, tracking its running high and low, then locks once the opening period ends.
Once the range is set, the indicator measures its height and projects extension targets above and below it. Four range lengths are available, and the session open time and timezone are configurable so the tool works on any market rather than being fixed to a single exchange.
🟠 CONCEPTS
* Opening Range - The high and low established during the first minutes of the session. Represents the initial boundaries of agreement between buyers and sellers before the day develops.
* Range Lock - The moment the opening period ends and the boundaries stop updating. From that bar onward the levels extend forward unchanged.
* Extension Target - A projected level placed at a multiple of the range height above the range high or below the range low. Acts as a measured move reference rather than a prediction.
* Qualified Breakout - The first close outside the range in a given direction. Each direction is tracked independently and marked only once, so a session that breaks up, reverses and then breaks down shows both events without repeating either.
* Session Anchoring - The range window is evaluated in the selected timezone rather than the chart timezone, keeping it aligned to the actual market open regardless of the user's location.
🟠 FEATURES
* Selectable Range Length - Choose between 5, 15, 30 or 60 minute opening ranges.
* Live Range Building - The box tracks the running high and low as the opening period develops, then locks when it closes.
* Extension Targets - Projects two configurable multiples of the range height in both directions.
* Breakout Marking - Labels the first close outside the range in each direction.
* Breakout Alerts - Fires on upside and downside breaks independently.
🟠 HOW TO USE
* Match the range length to the instrument. Shorter ranges suit fast-moving markets and scalping, longer ranges suit index futures and higher-priced equities where the first minutes tend to be noisy.
* Set the session open time and timezone to your market. The default is 09:30 New York.
* Use the range boundaries as the reference for the session. Price holding inside them points to rotation, while a decisive close outside tends to set the tone for the rest of the day.
* Read the extension targets as measured moves. A tight opening range produces close targets, while a wide one produces targets that may take the full session to reach, which is itself useful when sizing expectations.
* Adjust Days to Display to keep the chart clean when reviewing several sessions of history.
🟠 CONCLUSION
Opening Range Breakout combines automatic range detection, forward-extending boundaries, and range-based extension targets in a single tool. It removes the manual work of marking the opening range each session while keeping the framework configurable enough to apply across different markets and session times. 지표

[Chrona] Opening Range Breakout Opening Range Breakout
An opening-range tool for instruments that have an opening auction. It draws the
first 15 and 30 minutes of a session as a range, marks the candle that broke it,
and projects targets measured from the broken level.
WHAT IT DRAWS
- The 15-minute and 30-minute opening range of each enabled session, as a box
whose high and low freeze when the range closes. The right edge keeps
following the last printed bar until the session ends, so the box grows with
price and never extends past it.
- An optional midline through the range.
- A tag on the candle that confirmed the break — above it on an upside break,
below it on a downside one, so the side carries the direction.
- 1R and 2R targets for the 30-minute range, measured from the broken level.
- Right-axis price tags for the levels and targets of whichever session is open.
- Optional pre-market ranges: the same opening-range construction run on the
lead minutes before a session opens.
Four sessions run independently — Asia, London, New York and COMEX — each
evaluated in its own timezone.
ORIGINALITY AND UTILITY
Multi-session opening ranges are common. These are the parts that are not, and
they are the reason this exists rather than a settings preset of something else:
- The range is built from one-minute intrabars, not from chart bars. On a
15-minute chart a chart-bar implementation cannot see inside the first bar, so
its "15-minute range" is whatever the first candle happened to be. This one
requests 1-minute data and measures the real first 15 and 30 minutes, so the
box is the same box on a 1-minute chart and on an hourly one.
- Three break-confirm modes — touch, chart close, and a 5-minute close — and the
5-minute close is computed natively from time("5") buckets rather than
requested from a higher timeframe. A higher-timeframe request returns the
developing value while the bar is still forming, which is how a break appears
and then un-appears. Nothing here repaints.
- Targets are anchored to the broken level, not to the range. A level-anchored
1R sits one range-width from the level price; a range-anchored one drifts with
whichever edge is used to measure it. The two disagree on every trade, and the
level is the price actually broken.
- Each session carries its own timezone, so daylight saving is resolved per
region rather than by one global offset. London shifting a week before New
York does not move the New York range.
- Nothing is hardcoded to 09:30. Instruments with no equity open work by typing
their real hours: XAUUSD has no cash open at all, and COMEX gold's pit open is
08:20 New York time.
- The pre-market range is derived from its parent session's own window rather
than configured separately, so the two cannot drift apart when either is
edited, and its levels stay live through the parent session — the range forms
before the open and the break lands after it.
- The break tag exists because of a specific blind spot: on a 1- or 2-minute
chart you cannot see where the 5-minute bar closed. The tag marks the candle
that carried that close.
METHOD
For each enabled session the script takes the session window you set, in that
session's timezone, and masks it to weekdays. It collects one-minute highs and
lows from the session open and freezes the extremes at 15 and 30 minutes. A
break is tested against the frozen level in the confirm mode you choose. Once
broken, targets are placed at one and two range-widths from the level, and a
retest is reported when price returns to within a tenth of a range-width of it.
Everything is evaluated on confirmed bars.
ALERTS
Break up, break down, both-sides-broken, and level retest, per session and per
range. Alerts are armed in the settings, but the script's alert calls do nothing
until TradingView has an alert of its own on this indicator with the condition
"Any alert() function call".
Two things about TradingView alerts worth knowing: they fire on the realtime bar
only, never on bars that already printed, so a break that happened before the
alert existed leaves no alert behind; and TradingView saves a copy of the script
when the alert is created, so an alert keeps running the version it was made
from. Re-create alerts after updating.
REPAINT
Nothing repaints. Every value is read on confirmed bars, higher-timeframe
requests are not used, and the 5-minute confirm lands one chart bar after the
5-minute close by construction rather than being back-dated.
LIMITATIONS
- The range needs one-minute data. How far back that data is available varies by
timeframe and by your TradingView plan, so on a lower plan the historical
boxes stop earlier than they do on a higher one. "Prior days to keep" defaults
to 1, which keeps this within the recent sessions most of the time.
- On a 1-minute chart and below there is no lower timeframe to request, so the
script falls back to the chart bars themselves — which at those timeframes are
already at or finer than 1-minute resolution.
- Sessions are only as correct as the hours you give them. The defaults are
reasonable for index futures; other instruments need their real hours typed in.
- An opening range assumes an opening. On instruments that trade continuously
with no auction, the pre-market range in particular is a borrowed idea rather
than a measured one.
This is an analysis tool, not financial advice.
지표

MSnR Double Breakout LevelMSnR Double Breakout Level
A staircase of turning points, and the level that matters once price finally runs out the top or
the bottom of it.
Support and resistance tools usually mark a level the moment it forms, which is why a chart ends up carrying dozens of lines that never meant anything. This one marks nothing when a level appears. It holds two of them, waits to see whether price runs past the pair, and only then draws the one that was left behind.
The result is that a level is never drawn on hope. By the time it is on the chart, price has
already proved it was willing to go through everything above or below it.
THE TWO BUILDING BLOCKS
A candle is green when close is above open, red when close is below. A doji, where they are
equal, is neither and takes no part.
A Level a green candle followed immediately by a red one.
The GREEN candle's CLOSE is the level.
Buyers pushed, sellers took it straight back.
V Level a red candle followed immediately by a green one.
The RED candle's CLOSE is the level.
Sellers pushed, buyers took it straight back.
These are not the output. They are the raw material.
DOUBLE BREAKOUT
Two same-side levels are held as a rolling pair. On the A side that is a descending pair - A1
above, A2 below:
A1 a close above this confirms it
A2 this is the level that gets marked
When a candle CLOSES above A1, the staircase has been run out, and A2 - the innermost step, the last place sellers stepped in before price left - is marked as the level.
The V side is the exact mirror. An ascending pair, V1 below and V2 above, a candle closing below V1, and V2 is marked.
It is always a DOUBLE. However long the staircase runs, only the latest two steps are ever held.
When a new same-side level appears while the pair is still waiting, one question decides what
happens to it:
the new level did NOT break the inner step -> the pair SLIDES one along
(old inner becomes the new outer)
the new level DID break the inner step -> the pair RESTARTS from that level
That single question is the whole bookkeeping, and it is the part most easily got wrong. Throwing the pair away every time another step appears loses the long staircases, which are exactly the ones worth waiting for. Never throwing it away means the pair drifts away from price and stops describing anything. Sliding keeps it anchored to the two most recent steps for as long as the move keeps going the same way, and restarts it the moment the move stops.
The breakout is always checked before any new level is. Reaching the outer step IS the breakout, so a level beyond it can only ever belong to the next search, never interrupt the current one.
DOUBLE BREAKOUT TO DOUBLE BREAKOUT
A completed Double Breakout can itself be taken out - by a completed Double Breakout running the other way.
a Double A Breakout confirms, marking A2
a Double V Breakout then confirms, marking V2
a candle CLOSES below that old A2
-> V2 becomes a DBO to DBO V level
The bullish case is the mirror: a Double V, then a Double A, then a close above the old V2, and
A2 becomes a DBO to DBO A level.
The cross break may land on the very same candle that confirmed the second Double Breakout, or on any candle after it. What it says is that the level which had just been established as the place price wanted to leave from has now been given up in the other direction, by a move built the same strict way.
The level is UPGRADED, not duplicated. A DBO to DBO A sits at exactly the price its Double A
Breakout already marked - it is the same level with more behind it - so the line already on the
chart changes its name and thickens rather than a second line being drawn on top of the first.
WHAT MAKES THIS DIFFERENT
1. Nothing is marked when it forms.
An A Level or a V Level on its own is never drawn. Two of them together are never drawn either.
Only the breakout puts something on the chart, which is why a whole session can pass with nothing new on it.
2. The pair rolls instead of resetting.
This is the piece that separates it from a plain two-level check. A staircase that keeps stepping
the same way keeps its pair alive, sliding one step at a time. A staircase that turns back on
itself starts again. Both cases are handled by the same rule.
3. The inner step is the level, not the outer one.
The outer step is what price had to close through to prove anything, so it has already been
consumed by the time the pattern completes. The inner step is the last one price never came back to, and that is what is drawn.
4. Breakout has priority over everything else.
Because reaching the outer step is itself the breakout, the order in which the two checks run
changes the result. Checking for new levels first would let a level that is really the start of
the next search interrupt the current one. Here the breakout is always resolved first.
5. The chain is a real state, not a coincidence.
A DBO to DBO level requires a full Double Breakout, then a full opposite Double Breakout, then
the first one's level being closed through. All three are tracked as one sequence, and any part
of it ageing out of the window cancels it.
6. The search itself can be watched.
The pair currently waiting for its breakout can be drawn, so the staircase can be seen sliding
before anything confirms. It is the working state, not a signal, and it is off by default.
READING THE CHART
Green line, "DBO A" Double A Breakout, label below
Red line, "DBO V" Double V Breakout, label above
Thick green, "DBO to DBO A" the bullish chain completed
Thick red, "DBO to DBO V" the bearish chain completed
Every line starts at the candle the level was read from and runs to the right, so the distance
from its origin to price shows how long it has been standing.
Labels are parked clear of that origin candle rather than on the level itself - under its low on a
bullish level, over its high on a bearish one. The level price is a candle CLOSE, so it sits
inside the candle, and a label placed there would be buried in the price action.
A chain level is always drawn one step thicker than a plain one. That is the only styling
difference, because it is the same kind of level, reached by a longer road.
With the working pair switched on, dotted lines labelled A1, A2, V1 and V2 show what is currently being tracked. A1 and A2 are the descending pair waiting for a close above A1; V1 and V2 are the ascending pair waiting for a close below V1. Watch A2 slide down as the staircase extends. If only A1 or only V1 is drawn, the search has one step and is waiting for its second.
Only the most recent few levels are drawn, so the chart stays readable. Older ones are still
counted in the corner table, which reports Double Breakout and DBO to DBO levels split into bull and bear. If the table reads higher than what you can see, the display limit is doing its job.
SETTINGS
Double Breakout
- Scan Length: how far back the search reaches. A pair that has been waiting longer than this is
abandoned, and a confirmed level is dropped once the candle it came from is older than this. It
also bounds how long a chain can stay open.
- Max Levels Shown: how many of the most recent levels are drawn. Switching a type off frees its slots for the others.
Level Types
- A switch for each of the four: Double A Breakout, Double V Breakout, DBO to DBO A, DBO to DBO V.
- Show Working Pair: draws the pair currently waiting for its breakout.
Level Style
- Bullish, bearish and working pair colours, line width, and whether levels extend to the right
edge. With extending off, a level stops at the candle that confirmed it.
Labels
- Show Labels, Label Size, and Label Distance from Candle as a percentage of ATR(14), so the gap scales with whatever instrument and timeframe you are on. The distance is measured from the origin candle's high or low, not from the level.
Summary Table
- Show, position and size of the corner table.
ALERTS
Four alert conditions:
Double A Breakout a descending pair was run out to the upside
Double V Breakout an ascending pair was run out to the downside
DBO to DBO A a bullish chain completed
DBO to DBO V a bearish chain completed
Each message carries the event, the symbol, the timeframe and the closing price. The same
messages are also sent through the alert function, so the "Any alert() function call" alert type
can deliver all four through a single alert.
Every alert is evaluated only after a candle has fully closed.
REPAINTING
This script does not repaint.
- The whole engine runs once per closed candle. Price moving inside an open candle cannot create, change or remove a level, and cannot make a signal appear and then disappear.
- Both building blocks need a candle AFTER them to exist at all. An A Level is only an A Level
once the red candle behind it has closed, so nothing is ever read from a candle still forming.
- Levels are built forward, one candle at a time, in the same order they would have been built live. A line that has been drawn never moves. The only thing that can change about it is its
name and thickness, when a later chain upgrades it, and that is a record of what price did
afterwards rather than a revision of what it did before.
- Nothing is read from a higher timeframe, so there is no higher timeframe lookahead to get
wrong.
When you create an alert, TradingView may show a caution banner saying the indicator can repaint. That banner appears automatically for any script that uses the built in bar state variables, no matter how they are used, because the platform cannot check the intent behind them. This script uses one of them for the opposite purpose: it is what restricts the entire engine to bar close.Choosing "Once Per Bar Close" when creating the alert is still recommended.
NOTES AND LIMITATIONS
- Levels are deliberately infrequent. Two same-side reversals have to line up and then be run
through by a close, and a DBO to DBO level needs that to happen twice in opposite directions.
Long stretches with nothing new are normal.
- Scan Length is not only cosmetic here. It decides when a waiting pair is abandoned and when a chain expires, so changing it changes what is found, not just what is drawn. Max Levels Shown
is the cosmetic one.
- A doji takes no part. An A Level or V Level needs one candle of each colour, so a pair
containing a doji is not one.
- DBO to DBO upgrades the existing level in place. The count of plain Double Breakouts therefore goes down by one each time a chain completes, because that level has become
something else.
- An internal cap of 120 stored levels keeps the drawing count inside TradingView's limits. On a
very long history the oldest are dropped.
- Detection is purely structural. It reports where these sequences occurred and nothing more. It
does not rank levels by quality, measure what happened next, or produce entries, targets or
stops.
HOW TO USE IT
A Double Breakout level marks the last place the other side stepped in before price left the
area. Traders commonly watch these for:
- A reaction on the first return, since price has not been back to that step since the breakout
- Direction from the side, where a bullish level below price and a bearish level above it frame
the range price is currently working in
- Confirmation against a higher timeframe read, where a level that agrees with the larger picture carries more weight than one that fights it
A DBO to DBO level is the same level after the market has argued about it twice. The road to it
was longer, and it sits where a completed move in one direction was undone by a completed move in the other.
The working pair is worth turning on while learning the tool. Watching A2 slide down step by step makes it obvious what the breakout is waiting for, and where it would have to close for anything to be drawn.
These are reference areas, not entry signals on their own. Use them alongside your own support
and resistance mapping, your own entry method and proper risk management.
DISCLAIMER
This indicator is a pattern detection tool. It is not financial advice and it makes no claim
about profitability. Trading involves risk. Always apply your own analysis and risk management. 지표

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

Consolidation DNA | Flux ChartsGENERAL OVERVIEW:
Consolidation DNA is a market structure tool that finds price consolidations and describes what is happening inside them. A consolidation is any stretch where price stops travelling and starts moving sideways in a contained area. Most tools stop at drawing a box around that area. Consolidation DNA draws the box and then measures twelve properties of the price action inside it. Eleven of those measurements are compared against five reference profiles, and the indicator reports which profile the consolidation matches most closely. It has two detection methods, one that builds a range out of consecutive compressed candles and one that builds a range out of a fixed price area that price has stayed inside, and both produce the same output, so a trader can choose whichever suits the instrument and the timeframe.
Once a range is confirmed, the indicator watches for the moment price leaves it. It marks that break, freezes the box at the break bar, and then follows price for a set number of bars afterwards to record how far it travelled away from the range. Those measurements are grouped by consolidation type and shown in a dashboard, so a trader can look at the loaded chart history and see how each type of consolidation behaved after it broke. The five types are Clean Coil, Choppy Range, Directional Pressure, Exhaustion, and High Effort Balance, and each one describes a different kind of sideways market. A Clean Coil and a Choppy Range both look like a box on a chart, but the price action inside them is very different, and the indicator separates them using measurements taken from the candles.
WHAT IS THE THEORY BEHIND THE INDICATOR?
Price spends a large part of every session moving sideways. Traders call these areas consolidations, ranges, bases, or coils. The common idea behind all of these names is the same. Buyers and sellers are close to balanced, so price stays inside a contained area for a while before one side takes control and price leaves the area. The problem is that not every sideways area is the same. Two boxes on a chart can look identical in width and height while the candles inside them tell completely different stories.
In one box, the candles are small, they overlap each other heavily, they close near the middle of the area, they alternate direction only occasionally, and volume is quiet. This is the classic picture of a market winding up, and traders call it a coil. In another box of the same size, the candles have long wicks on both sides, closes land near the edges, direction alternates almost every bar, and volume is higher. This is the picture of a market fighting itself, and traders call it chop. A third box holds together while the closes keep drifting toward one edge and the wicks build up on one side, so price is still contained while pressure builds in a direction. A fourth box holds while volume drops away compared with the period before it and directional progress slows down, which is a market running out of participation. A fifth box shows heavy volume, split fairly evenly between rising and falling candles, while price makes almost no net progress, so a large amount of activity is being taken inside a small area.
These five pictures are the reference profiles the indicator uses. Each one is defined by a set of numeric targets across eleven measurements. When a consolidation confirms, the indicator measures the same eleven properties on the live range and finds which of the five profiles sits closest to it in measurement space. The closeness of that match becomes a fit score, and the distance between the best match and the second best match becomes a confidence gap. Both figures describe how closely the structure resembles a profile, and neither one describes what price is likely to do next. The value of this approach is that the description comes from the price action itself. A trader reading the dashboard sees which measurements are high, which are low, and which profile they add up to, and can form a view about the range from that.
The second half of the theory is the record keeping. Once a range breaks, the indicator follows price for a fixed number of bars and records the furthest it travelled away from the range in the break direction. That travel is expressed as a multiple of the range height, so a two point move away from a two point range and a twenty point move away from a twenty point range both record as one times the range. Grouping those records by consolidation type produces a small table describing what happened after each type of consolidation broke on the loaded chart history.
CONSOLIDATION DNA FEATURES:
Consolidation Detection
Consolidation Classification
Range Break Detection
Expansion Tracking
Consolidation Dashboard
Alerts
CONSOLIDATION DETECTION
🔹 What is Consolidation Detection?
Consolidation Detection is the part of the indicator that finds the sideways areas and draws boxes around them. It runs on every bar and produces a range that has a start bar, a high, and a low. That range moves through two states. It starts as a developing range, which means the indicator has found the beginning of something but the area has not lasted long enough to be treated as real. It then becomes a mature range once it has lasted for the required number of bars.
The classification measurements run while a range is still developing, and the dashboard may show a provisional type before confirmation. Only the classification calculated at maturity is held and used afterwards, and only mature ranges can produce a break or be added to the statistics.
🔹 Why is Consolidation Detection important?
Every other part of the indicator depends on getting the range right. If the box is drawn around the wrong bars, the measurements inside it describe the wrong price action, the classification is wrong, and the statistics are wrong. Two detection methods are offered because instruments behave differently. A fast futures contract on a low timeframe produces clean runs of small candles, which suits candle based detection. A slower instrument, or a higher timeframe, often produces a contained area made of mixed candle sizes, which suits area based detection.
🔹 How is Consolidation Detection calculated?
The Candles method looks at each candle on its own and decides whether it is a compressed candle. A candle is compressed when two conditions are both true. The body must be smaller than half of the total candle height, measured as the distance from open to close against the distance from high to low. The candle height must also be smaller than the four period Average True Range. A candle that has a small body but a large height is not compressed, and a candle that is short but almost all body is not compressed either. Both conditions must be true together.
When a compressed candle appears, a run starts. The bar it appeared on becomes the start of the range, and its high and low become the first range boundaries. Every following compressed candle extends the run, and the range high and range low widen to include that candle. While a range is still developing, the moment a candle appears that is not compressed, the run ends and is cleared completely. The range must be rebuilt from a new compressed candle.
The Visual Range method works on a fixed area. On each bar the indicator takes the highest high and the lowest low of the last three bars and treats that area as a seed range. If price then trades above the top of that area or below the bottom of it, the area is cleared and a new seed is taken from the most recent three bars. If price stays inside, the area is kept and the count of bars inside it grows. The range boundaries in this method do not widen once the seed is set, because any move outside them clears the range and starts a new one.
In both methods, the number of bars the range has lasted is measured from the start bar to the current bar. When that count reaches the required minimum, the range becomes mature. At that moment the range high and range low are frozen and they no longer move.
While a range is still developing, the indicator checks on every bar that the detection run still starts on the same bar it started on before. If the start bar changes, meaning the run was broken and a new one began, the developing range is cleared and its box is removed. Nothing is recorded for a developing range that never matured. This check stops once a range matures. A mature range holds its fixed boundaries and stays active through candles of any size until price breaks out of it.
After a mature range breaks, a new range cannot open from a detection run that began before the break bar. The indicator waits for a run that starts after the break.
🔹 Settings
Detection Method: Chooses how ranges are found. Candles builds the range from consecutive compressed candles. Visual Range builds the range from a fixed price area that price has stayed inside. This changes the logic of the indicator and the default is Candles.
Min. Consolidating Candles: The number of consecutive compressed candles required before a range becomes mature. Lower numbers produce more ranges and shorter ones. Higher numbers produce fewer ranges that lasted longer. This setting is only active when Detection Method is set to Candles. The default is 4 and the range is 1 to 20.
Min. Candles in Range: The number of bars price must stay inside the seed area before the range becomes mature. This setting is only active when Detection Method is set to Visual Range. The default is 20 and the range is 3 to 160.
🔹 Customization
Developing Boxes: Draws the box while the range is still developing. The default is on.
Mature Boxes: Draws the box once the range has matured, and controls whether the box is kept on the chart after the range breaks. When this is off, a mature range still produces breaks and statistics while no box is drawn for it. The default is on.
Developing: The border and fill color used while the range is developing. The default is a light blue.
Mature: The border and fill color used for a mature range whose type reads Unclear. Ranges with a matched type use that type color. The default is a green.
CONSOLIDATION CLASSIFICATION
🔹 What is Consolidation Classification?
Consolidation Classification is the part of the indicator that describes what kind of consolidation has formed. When a range matures, the indicator measures twelve properties of the price action inside it and compares eleven of them against five reference profiles. The closest profile becomes the type of that consolidation, and the type is shown on the box color, on the label, and in the dashboard.
The five types are Clean Coil, Choppy Range, Directional Pressure, Exhaustion, and High Effort Balance. A sixth outcome, Unclear, appears when no profile is close enough.
🔹 Why is Consolidation Classification important?
A box on a chart tells a trader where a range is, and that is all. It says nothing about whether the market inside that box was winding up quietly, fighting itself, leaning in a direction, running out of participation, or absorbing heavy volume. Those are different situations and traders treat them differently. Classification gives the box a description built from the candles inside it, so the box carries information beyond its own outline.
🔹 How is Consolidation Classification calculated?
The indicator measures twelve properties on every bar. Each one is expressed as a number from zero to one hundred so they can be compared with each other.
The three Structure readings describe how contained the area is. Range Tightness compares the height of the current range against a pool of previously confirmed ranges on the same chart, so a high reading means the current range is small compared with the ranges that came before it. Candle Overlap measures how much price area each bar shares with the bar before it, averaged across the range, and a high reading means the bars sit on top of each other cleanly. Close Containment measures the share of closes that land inside the range after a padding is trimmed from the top and the bottom, and a high reading means closes are staying in the middle area.
The three Pressure readings describe whether the range is leaning in a direction. Trend Drift compares the net move from the first close in the window to the last close against the total of every close to close move in between, and a high reading means most of the movement went in one direction. Close Bias measures how far the average close sits away from the middle of the range, where a reading of zero means closes averaged out at the midpoint and a reading of one hundred means closes sat at one edge. Wick Bias measures the difference between total upper wick and total lower wick as a share of all wick, and a high reading means the wicks are concentrated on one side.
The three Chop / Effort readings describe how much back and forth action the area is taking and how busy it is. Flip Rate measures how often a candle points in the opposite direction to the one before it, and a high reading means direction alternated frequently. Wick Rejection measures the total length of all upper and lower wicks as a share of the total candle height across the range, so a high reading means a large part of the price action was wicks. Effort compares the average volume inside the range against the average volume of the window of equal length that came before it, where a reading of fifty means volume matched the earlier window and a reading above fifty means volume was higher.
The three Balance / Exhaust readings cover volume symmetry, the change in pace, and how long the setup has run. Volume Balance measures how evenly the estimated bullish and bearish volume inside the range are matched, where a high reading means the two sides are close to equal and a low reading means one side dominates, and on a symbol that reports no volume this reading is left blank and the profiles are compared on the remaining ten measurements. Slowdown compares the directional progress of the earlier window against the directional progress of the current one, and a high reading means the market made much less directional progress than it did before. Duration compares how long the current setup has lasted against the number of bars required for confirmation.
The Volume Balance reading is an estimate built from one minute candles when the chart timeframe is above one minute. Each one minute candle is counted as bullish or bearish using its body direction, falling back to its close against the previous close when the body is flat, and a candle that is flat on both counts has its volume split evenly between the two sides. That volume is then scaled by how much of the candle's price range overlaps the consolidation. This approximates how much participation happened inside the area. It is not order flow and it is not volume at price data, so it cannot show which side initiated a trade or where inside a candle the volume changed hands. When one minute data is unavailable the estimate is built from the chart candles directly. This measurement reads the most recent thirty bars of the range.
Each of the five profiles holds a target value for eleven of these measurements. The indicator measures the squared difference between every live reading and its target, averages those differences, takes the square root, and subtracts the result from one hundred. That produces a fit score for each profile. The profile with the highest fit becomes the primary type and the next highest becomes the secondary type. Two thresholds then decide what is displayed. If the highest fit is below fifty five, the type reads Unclear, because no profile was close enough to describe the range. If the highest fit is at least fifty five but the gap between the best and second best is smaller than eight, both names are displayed together separated by a slash, because two profiles describe the range almost equally well. When the fit is at least fifty five and the gap is eight or more, a single type name is displayed.
The Duration measurement is calculated and displayed in the dashboard while the five profiles hold no target for it, so it reports on the setup without affecting which type is chosen. Every other measurement in the dashboard is compared against the profiles. The type is recorded at the moment the range matures and it is held from then on. It does not change while the range waits for a break.
🔹 Reading the five types
Clean Coil sits at high Range Tightness, high Candle Overlap, high Close Containment, low Wick Rejection, low Trend Drift, and low Flip Rate. It describes a small, orderly area where the candles sit on top of each other and the closes stay in the middle.
Choppy Range sits at high Wick Rejection and high Flip Rate with weaker Close Containment. It describes a sideways area where direction changes constantly and a large part of the movement is wicks.
Directional Pressure sits at high Trend Drift and high Close Bias with a lean in Wick Bias and volume leaning to one side. It describes a range that is still holding while the closes keep pushing toward one edge. Trend Drift, Close Bias, and Wick Bias are all measured as magnitudes, so this profile reports that a lean exists while it does not name which side the lean favours. The direction is recorded separately at the moment the range breaks.
Exhaustion sits at low Effort and high Slowdown. It describes a contained area where volume has fallen away compared with the earlier window and directional progress has dropped.
High Effort Balance sits at very high Effort and very high Volume Balance while Trend Drift stays low. It describes an area taking heavy volume that is split fairly evenly between rising and falling candles while price makes almost no net progress.
🔹 Settings
Comparison Lookback: The number of previously confirmed ranges kept as the comparison pool for Range Tightness. A larger number compares the current range against a longer history and a smaller number compares it against recent conditions only. The pool fills up as ranges confirm on the loaded chart, so Range Tightness reads a neutral fifty until the first range has been recorded. The default is 200 and the range is 40 to 1000.
Analysis Window: The largest number of bars used to measure the price action inside a range. A range longer than this number is measured using its most recent bars up to this limit. The default is 200 and the range is 10 to 1000.
Inner Close Padding %: The share of the range height trimmed from the top and the bottom before Close Containment counts which closes are inside. A larger number demands that closes sit closer to the middle before they count as contained. A value of zero counts every close inside the range. The default is 10 and the range is 0 to 40.
🔹 Customization
Clean Coil: The color used for boxes, labels, and dashboard text when the type is Clean Coil. The default is teal.
Choppy Range: The color used when the type is Choppy Range. The default is orange.
Directional Pressure: The color used when the type is Directional Pressure. The default is blue.
Exhaustion: The color used when the type is Exhaustion. The default is amber.
High Effort Balance: The color used when the type is High Effort Balance. The default is purple.
Detection Labels: Draws a label above the box on the bar a range matures, showing the type name and the fit percentage. The label carries a tooltip describing the type and listing the fit and the confidence gap. This option requires Mature Boxes to be on. The default is off.
Developing Labels: Draws a label at the midpoint of the box on the bar a developing range starts. This option requires Developing Boxes to be on. The default is off.
RANGE BREAK DETECTION
🔹 What is Range Break Detection?
Range Break Detection is the part of the indicator that decides when a mature range has ended. Price leaving the range in either direction ends the range. The indicator records the bar it happened on, the direction it happened in, and the height of the range at that moment, then freezes the box so it stops extending to the right.
🔹 Why is Range Break Detection important?
The point at which a range ends is the point a trader cares about, because it is where the contained period stops and directional movement begins. It is also the anchor for every measurement that follows. The expansion travel is measured from the range boundary, and it is expressed as a multiple of the range height, so both numbers must be fixed at the break bar for the statistics to mean anything.
🔹 How is Range Break Detection calculated?
The indicator offers two definitions and the trader chooses one. Under Close Break the range ends when a candle closes above the range high or closes below the range low, so a candle that pushes outside the range during the bar and closes back inside does not end it. Under Wick Break the range ends the moment any part of a candle trades above the range high or below the range low, and the close is not considered at all. Close Break therefore produces fewer breaks, each one requiring a candle to settle outside the area, while Wick Break produces more and catches the first touch outside it.
The direction is recorded as up when the range high was broken and down when the range low was broken, and when both boundaries are exceeded on the same bar the upward break takes priority. At that moment the box stops extending and its right edge is fixed at the break bar, where it stays on the chart as a record of the completed range, while the live range is cleared so the indicator can begin looking for the next one.
The Close Break check reads the current close value, and the Wick Break check reads the current high and low. On a bar that has already closed these are the finalized candle values. On the bar currently forming they are live and still moving, so a break can appear and then disappear while the bar is still open, and it settles when the bar closes. An alert set to fire Once Per Bar Close will report only the breaks that survived to the candle close.
🔹 Bullish Example
A mature range holds for several bars while the dashboard release state reads Waiting. A candle then closes above the range high. With Invalidation Method set to Close Break, the range ends on that candle, the box stops extending and its right edge is fixed at that bar, and a Break Up label is placed at the range high. From that bar the indicator begins measuring how far price travels above the range high, and it continues for the number of bars set in Expansion Window.
🔹 Bearish Example
A mature range holds for several bars while the dashboard release state reads Waiting. A candle then closes below the range low. With Invalidation Method set to Close Break, the range ends on that candle, the box stops extending and its right edge is fixed at that bar, and a Break Down label is placed at the range low. From that bar the indicator begins measuring how far price travels below the range low, and it continues for the number of bars set in Expansion Window.
🔹 Settings
Invalidation Method: Chooses the definition used to end a mature range. Wick Break ends the range on any trade outside the boundaries. Close Break requires a candle to close outside the boundaries. The default is Close Break.
🔹 Customization
Release Labels: Draws a label at the broken boundary on the break bar, reading Break Up or Break Down. The label carries a tooltip listing the method used, the type of the range, the fit percentage, and the range height. The default is off.
Max Stored Boxes: The largest number of completed boxes kept on the chart. Once the count passes this number, the oldest completed box is removed. The default is 80 and the range is 10 to 180.
Max Stored Labels: The largest number of labels kept on the chart across all label types. Once the count passes this number, the oldest label is removed. The default is 120 and the range is 10 to 400.
EXPANSION TRACKING
🔹 What is Expansion Tracking?
Expansion Tracking follows price after a range has broken and records the furthest it travelled away from the range in the break direction. It watches for a set number of bars, records the largest travel it saw, and then adds that record to a running total for the consolidation type.
🔹 Why is Expansion Tracking important?
A break on its own says only that price left the area. It says nothing about how far it went afterwards. Measuring the travel and expressing it as a multiple of the range height makes those measurements comparable across instruments, timeframes, and range sizes, which means they can be grouped and averaged. Grouping them by consolidation type produces a description of how each type behaved after breaking on the loaded chart history.
🔹 How is Expansion Tracking calculated?
When a mature range breaks, the indicator starts a record holding the break direction, the two range boundaries, and the height of the range at that moment, and from that point onward it measures on every bar how far price has travelled away from the broken boundary. For an upward break that travel is the distance from the range high up to the bar high, and for a downward break it is the distance from the range low down to the bar low, so only movement away from the range counts and a bar that trades entirely back inside contributes zero. Each measurement is divided by the range height and compared against the largest value seen so far, and whenever a new largest value appears the indicator records the bar and the price where it occurred so that exact point can be marked on the chart.
The record continues until the window set in Expansion Window has elapsed, counting the break bar itself as the first bar of that window, at which point the largest travel it saw is added to the running total for that consolidation type, the sample count for that type is added to, and the record itself is removed. Records that are still inside their window are held back and they join the averages once their window has finished. Because every measurement is expressed against the height of its own range, a travel equal to one hundred percent of the range height displays as one times, so a range that was ten points tall followed by a move of eighteen points away from the boundary records as one point eight times, which lets ranges of very different sizes be compared on one scale.
Every mature range that breaks is credited to the type profile that scored highest for it, and this includes ranges whose label read Unclear, where the fit sat below the display threshold and no type name was shown. Those breaks are still recorded and they are credited to whichever profile came closest. This is a fixed convention in the indicator, so the counts in the dashboard describe every break that occurred on the loaded chart.
🔹 Settings
Expansion Window: The length of the measurement window, counted from the break bar. The break bar itself counts as the first bar, so a value of 50 covers the break bar and the 49 bars that follow it. A short window records the immediate reaction to the break. A long window records how far the move eventually reached. Changing this number changes every average in the dashboard, because it changes how long each break is followed. The default is 50 and the range is 1 to 500.
🔹 Customization
Expansion Labels: Draws a label showing the travel as a multiple of the range height. It is placed once the window has finished, on the earlier bar where the furthest travel occurred, so it marks a completed outcome in hindsight and it is not present while that move is happening. The default is off.
CONSOLIDATION DASHBOARD
🔹 What is the Consolidation Dashboard?
The Consolidation Dashboard is a table drawn on the chart that reports the current state of the indicator and the history it has recorded. It has three parts. The header reports what state the indicator is in and which type the active setup matches. The middle section reports twelve readings for the active setup, which are the eleven compared against the profiles plus Duration. The lower section groups the recorded breaks by type.
🔹 Why is the Consolidation Dashboard important?
The box and its color report the conclusion. The dashboard reports the measurements the conclusion was drawn from, together with Duration, which describes the setup without feeding it. A trader who can see that Range Tightness is at ninety, Candle Overlap is at eighty five, and Flip Rate is at fifteen understands why the range was described as a Clean Coil, and can also see when a reading is borderline. The type and the fit percentage are held from the moment the range matured while the measurement rows keep updating on every bar, so on a range that has been holding for a while the live readings describe the range as it stands now and the type describes it as it was at confirmation. Every cell in the table carries a tooltip explaining what it measures.
🔹 How is the Consolidation Dashboard calculated?
The header row reports the state of the indicator. It reads No active setup when nothing has been found, Developing while a range is forming, and Mature once a range has confirmed. A range is cleared on the bar it breaks, so from that bar the header returns to No active setup until the next range is found. Beside the state, the header reports the type name and the fit percentage. When a range matched two profiles closely, a second header row appears carrying the second type name and its fit percentage.
The Current Setup row appears while a setup is active. It reports the range low and the range high as a pair, and it reports the release state. The release state reads Not confirmed while the range is still developing and Waiting once it has matured and is holding.
The four measurement rows appear once the active setup has lasted at least a quarter of the bars required for confirmation, and they carry three readings each. Structure reports Range Tightness, Candle Overlap, and Close Containment, which together describe how contained the area is. Pressure reports Trend Drift, Close Bias, and Wick Bias, which together describe whether the range is leaning in a direction. Chop / Effort reports Flip Rate, Wick Rejection, and Effort, which together describe how much back and forth action the area is taking and how busy it is. Balance / Exhaust reports Volume Balance, Slowdown, and Duration. Volume Balance and Slowdown both feed the classification, and Slowdown carries its highest target of any profile in Exhaustion, while Duration describes the setup without feeding it.
The History by Type section lists all five types with two columns. Samples reports how many breaks of that type have completed the full Expansion Window. Avg Max Expansion reports the average of the furthest travel across those completed breaks, shown as a multiple of the range height. Hovering a Samples cell shows the total number of breaks detected for that type, including any that are still inside their window.
Every figure in the History section describes what occurred on the loaded chart history. Loading more history, changing the timeframe, or changing Expansion Window will change these figures.
🔹 Settings
Show Dashboard: Draws the dashboard table on the chart. The default is on.
Position: Places the dashboard at one of nine points on the chart. The options are Top Right, Top Center, Top Left, Middle Right, Middle Center, Middle Left, Bottom Right, Bottom Center, and Bottom Left. The default is Top Right. This dropdown sits beside Show Dashboard and carries no label of its own.
Size: Sets the text size of the dashboard. The options are Tiny, Small, Normal, Large, and Huge. The default is Normal. This dropdown sits beside the position dropdown and carries no label of its own.
ALERTS
🔹 What are the Alerts?
The indicator provides nine alert conditions covering confirmation and range breaks, so a trader can be told when a range confirms, what kind of range it is, and which way it eventually left.
🔹 How are the Alerts calculated?
Consolidation Confirmed fires on the bar a range matures, whatever type it was given. Five further conditions cover the individual types, named Clean Coil Confirmed, Choppy Range Confirmed, Directional Pressure Confirmed, Exhaustion Confirmed, and High Effort Balance Confirmed. Each of those fires on the same bar as the general confirmation when the range matched that type. A range carrying a combined label fires the condition for the profile that scored highest, and a range reading Unclear fires the general confirmation only.
Range Break fires on the bar a mature range is broken in either direction, and Range Break Up and Range Break Down split the same moment by side, so a trader can act on one direction alone. All three follow whichever definition is set in Invalidation Method. Developing ranges that are cleared without maturing produce no alert at all.
Conditions are created through the TradingView alert dialog by selecting the indicator and then choosing one from the condition list.
IMPORTANT NOTES:
The Volume Balance measurement is an estimate that reads one minute data through a lower timeframe request, and this happens only when the chart timeframe is above one minute, so on a one minute chart and on any chart where one minute data is unavailable for the symbol the estimate is built from the chart candles themselves, and instruments that publish no volume leave the Volume Balance row blank, in which case the measurement is left out of the profile comparison entirely so the gap cannot push the result toward any one type. The comparison pool used for Range Tightness is built from confirmed ranges on the loaded chart and it starts empty, so Range Tightness reports a neutral fifty until the first range has been confirmed and added, the reading becomes more meaningful as the pool grows toward the number set in Comparison Lookback, and loading more chart history fills the pool faster. Every figure in the History by Type section is built from the chart currently loaded, so scrolling back to load more bars, switching timeframe, switching symbol, or changing Expansion Window will rebuild these figures from scratch, while breaks that are still inside their Expansion Window are held and they join the averages once their window has finished. The type recorded for a range is fixed at the moment the range matures and it is measured from the bars available at that point, meaning a range that changes character after it confirms keeps the type it was given. Ranges that are still developing produce no records of any kind, and if a developing range is cleared before it matures its box is removed and nothing is added to the statistics. Turning Mature Boxes off removes the box drawing for mature ranges while the detection, classification, breaks, alerts, and statistics all continue to run, and with that option off no completed box is left on the chart after a break.
UNIQUENESS:
Most consolidation tools answer one question, which is where the range sits, while Consolidation DNA answers that question and then answers a second one, which is what kind of range it is. The classification is built from twelve measurements of the candles inside the range, eleven of which are compared against five reference profiles, and it is reported with a fit percentage and a confidence gap so a trader can see how strong the match is, and when two profiles describe the range almost equally well the indicator displays both names together, while a range that matches nothing closely enough is reported as Unclear. The measurement set itself covers ground that range tools normally leave out, because alongside the expected structural readings of tightness, overlap, and containment, the indicator measures how often candle direction alternates, how wick length is split between the two sides, how average close location sits against the middle of the range, how current volume compares with the window that came before it, and how much directional progress has slowed, while the bullish and bearish volume split is estimated from one minute candles and scaled by how much of each candle's price range overlaps the consolidation, so candles with less price range overlap carry less weight in the balance reading. The indicator also keeps its own record of what happened after each range ended, where travel away from the range is expressed as a multiple of the range height, which makes measurements from a two point range and a two hundred point range directly comparable, and those measurements are grouped by consolidation type to produce a small table describing how each type of consolidation behaved after breaking on the chart in front of the trader. Historical figures are built from finalized candles, while readings on the bar currently forming remain provisional until it closes. Two detection methods are offered so the tool fits different instruments and timeframes, and both feed the same classification and record keeping, while every measurement in the dashboard carries a tooltip explaining what it means and most drawing categories can be turned on or off separately, with developing and detection labels depending on their matching box setting, so the chart can be reduced to boxes alone or expanded to show labels at detection, at maturity, at the break, and at the point of furthest travel. 지표

MarketMaulers Auto TrendlinesMarketMaulers Auto Trendlines draws the diagonal structure you would have drawn yourself, and then stays with the line through the part that matters. Two confirmed pivots anchor it, the market's own touches validate it, and its parallel rail is projected through the furthest price travelled while the line was forming. Then it waits for the break, and reports which of the only two things that can follow a break took place.
Forming · Validated · Broken · Retested / Failed break
THE RETEST IS THE PRODUCT
Anyone can draw a line through two pivots and print a marker when price closes through it. The break is the least informative moment in a trendline's life. Most lines break, and the break on its own says nothing about whether the level still matters.
Two things can follow, and they mean opposite things.
• RETEST. Price comes back and respects the line from the OTHER side. Old support is now resistance. The line survived its own break as a reference and is arguably more useful after it than before.
• FAILED BREAK. Price closes straight back on the original side. The break was noise, the line was never beaten, and anyone who traded the break is offside.
This tool waits for one of those and names it. That is the read you cannot get by eyeballing the chart in the moment, because in the moment the two look identical.
FROM ZERO: WHY A DIAGONAL LINE IS A DIFFERENT ANIMAL FROM A HORIZONTAL ONE
A horizontal level is a price. It sits at one number and it is still that number tomorrow. A trendline is a price AND a rate. It asks the market to keep making higher lows at a certain speed, or lower highs at a certain speed. That is a much stronger claim, which is why trendlines break more often than horizontal levels and why the break carries less information when they do.
It is also why a line has to be earned rather than drawn. Two points define any line at all. Three or more touches is the market repeatedly agreeing to the rate.
HOW A LINE EARNS ITS PLACE
Five gates, each closing a specific way auto-trendline scripts produce clutter.
• Confirmed pivots only, paired for direction. A rising support line needs a second swing low strictly HIGHER than the first, a falling resistance line a second high strictly lower. A zero slope is unreachable by construction, so this file never draws a horizontal line.
• A cleanliness scan. Every bar between the two anchors is checked for a close through the line. A line price has already spent time on the wrong side of was never a valid line, and drawing it anyway is how a chart fills with lines nobody would have drawn by hand.
• Touch counting with a spacing rule. A touch is a bar reaching within a quarter of an ATR of the line, and touches within three bars of each other count once. Without the spacing rule one slow drift along a line counts as five touches and validates anything.
• Near-duplicate rejection. Two lines are compared at two sample points, now and fifty bars back, and the newer one is dropped if they sit within 0.75 ATR at BOTH. Comparing at a single point lets two lines with different slopes look identical at the moment they cross.
• A slope cap and abandoned-line retirement. Near-vertical lines off a single spike are refused, and a line price has stayed far away from for twenty consecutive bars is retired. That is what keeps ancient support lines from hanging under current price forever.
TWO WAYS A LINE BREAKS, AND THE SECOND ONE IS THE INTERESTING ONE
The obvious break is distance: a close sitting at least 0.35 ATR beyond the line. That catches the decisive break and it misses the slow one.
Price can park a fraction through a line, too shallow to trigger the distance test and too close to trigger retirement, and grind there bar after bar. Under a distance-only rule the line stays marked VALIDATED with price on the wrong side of it for as long as the grind lasts, which is a tool stating something false. So three consecutive wrong-side closes break a line at any distance. Decisive breaks are caught by distance, grinds by persistence, and there is no state left where the display and the price disagree.
A RETESTED LINE GOES BACK TO WORK
Most implementations treat the retest as the end of a line's life, which is backwards from what the retest proves. A line that broke, was left alone, and then held from the other side has demonstrated it still matters, and the tools that go quiet there stop watching at the exact moment the line earned its keep.
The mechanism is a POLARITY FLIP rather than a new line. Old support becomes resistance, so the side the break test looks at flips while the line's geometric identity does not. It is still a rising line, it keeps its color and its channel offset, and it starts being tested for a break to the upside. The label carries R1, R2, R3 so a twice-proven line is visibly different from a fresh one, and the cycle is capped at three, after which retested is terminal. A line oscillating around price cannot churn forever.
The status card reports both facts rather than picking one. RISING · RES is a rising line currently acting as resistance. Unflipped lines read RISING · SUP and FALLING · RES, which is what they always meant, said out loud.
THE CHANNEL
Once a line is validated, its parallel rail is projected through the furthest the market travelled away from it while the line was forming. The rail comes from a real extreme rather than from a statistical fit, so the width means something specific: this is how far this structure has been willing to travel from its own floor. Fill and opacity are yours to set, and the fill carries the state, so there is no color legend to memorize.
CONVERGENCE, WITH A TIME
Two validated lines with different slopes meet at an apex, and an apex is a price AND a bar. That is a triangle or a wedge resolving, one of the oldest readable objects in chart reading. It needs both lines retained as DATA rather than as drawings, which is why most auto-trendline scripts cannot offer it at all.
It is reported on the card and alerted, not drawn. A marker painted into future bars would say the same thing and add a drawing to a chart whose whole design rule is fewer marks. And it is a fact, not a forecast: it says where and when the structure runs out of room, not what happens when it gets there.
HIGHER TIMEFRAME LINES
A second engine, off by default, sharing the concepts of the chart-timeframe engine and none of its code paths. If the higher-timeframe layer is wrong, the layer you already trust keeps working.
Why most higher-timeframe trendline overlays are unsound is worth stating. A security call hands back prices. It does not hand back the ability to walk backwards through higher-timeframe bars, and the cleanliness scan IS a walk. So an HTF line built off a plain security read cannot be validated the way a chart line is, and most implementations quietly skip the check. Here, completed higher-timeframe bars are pushed into a ring buffer as they close and the whole HTF engine walks those. A real scan, real HTF touches, and a break that is a real HTF close through the line.
Breaks are judged by the timeframe that OWNS the line. A 15m candle closing through a 4H trendline is not a 4H close, and treating it as one is the most common way an HTF overlay lies. The visible consequence is that an HTF line can die up to one HTF bar later than the chart makes it look like it should. That is correct, and it will look wrong the first time.
What the HTF layer deliberately does not do, each one a decision rather than an omission: no channel, no polarity flip, no apex participation, and no separate alerts. The rail is measured by the same pass that validates the chart line. Converging HTF and chart slopes needs a unit conversion that is wrong the moment the chart timeframe changes. And two engines firing the same alert would double every notification. One slot, defaulted off, because new surface gets proven before it gets duplicated.
THE STATUS CARD
Six live lines on a chart and no way to tell which one matters this bar. The card names the nearest line, the distance to it in points and in ATR, its geometry and its current role, how many broken lines are still awaiting a verdict, and the soonest apex. A table rather than a label, because a label draws inside the price pane and loses the z-order fight with candles.
ALERTS
Trendline validated · Trendline broken · Trendline retest confirmed · Failed trendline break · Trendline convergence approaching
The convergence alert is the one worth leaving on. The other four report something that has already finished, which is useful for a journal. Convergence is the one thing the tool knows about the future, so it is the one alert that can reach you while there is still something to do about it. It is edge-triggered: it arms while the apex is beyond your warning distance and fires once on the way in, rather than firing every bar of the approach until you mute it forever.
WHY IT DOES NOT REPAINT
Lines anchor on confirmed pivots only, and a pivot is not known until the required bars have closed after it. Every state change is judged on a closed bar. The chart-timeframe engine contains no security call at all, and the higher-timeframe engine reads only completed HTF bars, never the one in progress, using the last-closed idiom with an atomic tuple so high, low, close and time cannot straddle a boundary. The cost is a deliberate lag of a few bars on every anchor, and that lag is the guarantee.
WHAT THIS TOOL IS NOT
It draws structure. It shades no band, marks no zone, and makes no claim about resting orders anywhere. When a broken line is reclaimed, this tool calls it a FAILED BREAK, which is a statement about structure and is what the price action supports on its own. A liquidity tool looking at the same bar would call it a sweep, which is a statement about order flow. Same behavior, different claim, and only one of them is visible on the chart.
MADE TO FIT YOUR CHART
Eight card positions, three text sizes, separate colors for rising and falling lines and for their higher-timeframe counterparts, line width, channel fill and opacity, labels on or off, and a toggle per section. Detection, channel, break and retest, style, higher timeframe, card and alerts are separate groups. Pivot length, minimum touches, maximum active lines, the slope cap, the retirement distance, the retest confirmation mode and the retest window are all exposed.
HOW TRADERS ACTUALLY USE IT
Pivot Length decides everything downstream, because it decides which swings exist to be paired. If the chart looks emptier than you expect, that is the first knob, ahead of the touch count.
Minimum touches is the honesty dial. Two touches is a line you drew. Three is a line the market drew. Three is the default for that reason.
Treat a break as the question and the following bars as the answer. Wait for RETESTED or FAILED before deciding what the break meant. The whole tool is built so you do not have to guess which one you are sitting in.
Works on any market and any timeframe.
Display only. This draws structure and reports what happened to it, it does not fire buy/sell signals and it does not forecast. Educational tool, not financial advice.
Published open-source. The pivot pairing and cleanliness scan, the near-duplicate rejection, the two-mode break test, the polarity-flip lifecycle, the apex pre-filter and the higher-timeframe ring buffer are all readable in the source. Everything above explains what it draws and how it decides what to draw; the code is there so you can check that the description is accurate rather than take it on faith. Read it, fork it, argue with the constants. 지표

Pattern Atlas : Geometric Indicator [AxeAlgo]Pattern Atlas : Geometric Indicator
A chart-native scanner for 16 classical price-structure ("geometric") chart
patterns. It tracks confirmed swing pivots as they form and, when a run of
pivots satisfies the geometry of a known pattern and its breakout condition, it
marks the pattern on the chart with an outline box, an optional construction
skeleton, a measured-move target, and a labelled pin signal. It also keeps a
live status table of every pattern it knows.
All pattern-recognition logic lives in the companion Pine library
"Pattern Atlas : Geometric ". This script is the visualization and
alerting layer on top of it, so the detection rules stay in one place that can
be maintained and audited on their own.
Patterns detected
Reversal patterns: Head & Shoulders and its Inverse; Double Top and Double
Bottom; Triple Top and Triple Bottom; Rounding Top and Rounding Bottom; Diamond
Top and Diamond Bottom; Broadening Formation; and the V-Top / V-Bottom spike.
Continuation patterns: Ascending Triangle; Descending Triangle; Symmetrical
Triangle; Rising and Falling Wedge; Bull and Bear Flag; Bull and Bear Pennant;
Rectangle; and Cup & Handle with its Inverted form.
Structural patterns: Island Reversal and Bump-and-Run Reversal.
How it works
First, a rolling list of confirmed swing highs and lows is maintained. The
"Pivot left bars" and "Pivot right bars" inputs set how many bars on each side
of a candidate must be less extreme for it to count as a pivot. Higher values
give fewer, more significant pivots and a longer confirmation lag.
Next, each pattern function inspects the recent pivot sequence for its defining
shape together with the price move that confirms it. For example, Head &
Shoulders looks for three peaks with a lower-shoulder relationship and a close
back through the neckline; an Ascending Triangle looks for a flat resistance
base with a rising support line and a close through the base.
Each match reports its direction (bullish or bearish), the exact pivots it was
built from, a text description, a strength score, and a measured-move price
target.
Strength score
The strength score runs from 0 to 100 percent and measures how decisively price
broke through the pattern's confirmation level, relative to the pattern's own
price range. A higher score means a cleaner, more committed break.
Patterns defined by a single point, such as the Spike and the Island Reversal,
have no internal range to measure against and always score a neutral 50 percent.
The "Minimum pattern strength to show" input filters marginal matches off the
chart and out of the alerts.
Measured-move targets
The target is a classical projection: the pattern's own height added to or
subtracted from the breakout point, shown as a small price label. No ray is
drawn out to it.
Targets are not shown for the Spike, the Island Reversal, or the Bump-and-Run
Reversal, because those patterns have no reliable height to project from.
Repainting
Every box, line, target, and pin is drawn only on a closed bar. Each match is
gated so it appears, and alerts, only once, on the bar it is first confirmed.
Swing pivots are only known a number of bars after they occur, equal to
"Pivot right bars". That confirmation lag is structural to pivot-based analysis,
not repainting. Nothing already drawn is moved or removed on later bars.
What you see on the chart
A box outlines the full pivot span of each match, coloured by direction.
Construction lines draw a zig-zag through the exact pivots that built the
pattern. This is off by default.
Construction points place a small circle on each of those pivots. This is also
off by default.
A target label shows the measured-move price.
A pin signal is a thin stem with a glowing gem at its tip, placed below the bar
for a bullish match and above it for a bearish one. Hovering the gem shows the
full list of matches on that bar with their strength and targets.
The scanner table lists every pattern with a live status column. When a pattern
matches on the current bar the row shows its name and strength percent; when it
does not, the row shows a dash. Hovering any row shows that pattern's
description.
Inputs
Pivot Detection controls the left bars, right bars, and the maximum number of
pivots tracked.
The Reversal, Continuation, and Structural groups each have a master enable
switch plus one checkbox per pattern, so a whole category can be turned off in
one click.
Display controls the boxes, construction lines, construction points, targets,
and pin signals; the minimum strength filter; the table on/off, position, and
text size; and the bullish and bearish colours.
Watermark switches between a Dark and a Light theme.
Alerts
There is one alert condition per pattern, plus an "Any Bullish Chart Pattern"
and an "Any Bearish Chart Pattern" condition.
There is also a single dynamic alert() call that fires once per closed bar with
the full list of patterns found on that bar, along with their strength and
targets. Add it using the "Any alert() function call" option when creating the
alert.
Every alert condition is gated to confirmed bars in the code itself, so none of
them can fire from a still-forming bar regardless of the alert frequency chosen.
Notes
Chart-pattern recognition is inherently approximate. Treat matches as structured
context rather than mechanical trade signals, and confirm them with your own
analysis.
The indicator works best on liquid instruments and on timeframes where swings
are well defined. Very low timeframes produce noisy pivots.
This is not financial advice.
Dependency: Pattern Atlas : Geometric , a Pine library.
지표

Pattern Atlas : Geometric [AxeAlgo]Pattern Atlas : Geometric Patterns
WHAT THIS LIBRARY IS
This is a Pine Script v6 library of 17 classical chart pattern detectors — Head and Shoulders, Double/Triple Tops and Bottoms, triangles, wedges, flags, and the rest of the standard technical-analysis catalog built from swing highs and lows rather than single-candle shape. Unlike candlestick patterns, which read one to a handful of fixed bars, chart patterns span a variable, often large number of bars, so this library carries one small piece of state — a rolling history of confirmed swing pivots — that every pattern function reads from. Beyond that, the same philosophy as Library #1 applies: no plotting, no alerts, and no inputs in this script by design, since a library's job is to hand other scripts a clean, reusable, well-documented API, not to draw on a chart itself (Pine doesn't allow a library to plot anything anyway). If you're looking for a ready-to-use indicator built on top of this library, see the companion "Pattern Atlas : Geometric Indicator " script, which imports every function here and turns it into on-chart signals, measured-move price targets, a live scanner table, and alerts.
Chart pattern analysis is one of the foundational tools of classical technical analysis, going back to Edwards and Magee's original work and refined since by researchers like Thomas Bulkowski, whose statistical studies of pattern behavior are the closest thing this field has to an industry-standard reference. The patterns in this library follow that standard catalog, so anyone who already knows what a Head and Shoulders top or an Ascending Triangle looks like will recognize exactly what each function is checking for.
WHY A LIBRARY INSTEAD OF ONE MONOLITHIC INDICATOR
Splitting detection logic out as an importable library means:
- Any Pine coder building their own strategy, indicator, or screener can pull in exactly the pattern checks they need without copy-pasting swing-pivot and trendline math into every new script.
- The detection logic is tested and maintained in one place. When a threshold gets refined, everything importing this library benefits from the update by bumping one version number.
- It keeps the math separate from presentation — how a pattern gets drawn, colored, or alerted on is a completely separate decision from whether the pattern is actually present, and different users want different presentations.
HOW TO IMPORT AND USE IT
Add this line near the top of your script (adjust the version number to whatever the current published version is):
import AxeAlgo/Pattern_Atlas_Geometric/1 as geo
Unlike Library #1, most of the functions here need a shared pivot history to work from. Call trackPivots() exactly once per bar, then pass its result into every detect*() function that needs it:
pivots = geo.trackPivots()
match = geo.detectDoubleTopBottom(pivots)
if match.found
label.new(bar_index, high, match.patternName)
Four functions — detectSpike(), detectFlag(), detectPennant(), and detectIslandReversal() — read directly off recent price action instead of the shared pivot history, so they're called without a pivots argument: geo.detectSpike().
trackPivots() takes three optional parameters: leftBars and rightBars (how many less-extreme bars must surround a candidate swing point before it confirms as a pivot — higher values mean fewer, more significant pivots, at the cost of a longer confirmation lag), and maxPivots (how much pivot history to retain). All three have sensible defaults.
Every detect*() function returns the same structure, called ChartPatternMatch, so the calling pattern is identical no matter which of the 17 you use. It has nine fields:
- found — true if the pattern matched at the evaluated bar, false otherwise.
- patternName — the specific name of what matched (e.g. "Ascending Triangle"), na when not found.
- direction — "bullish" or "bearish".
- pivotBars — bar_index of each pivot the match was built from, in chronological order.
- pivotPrices — price of each pivot, in the same order as pivotBars.
- breakoutLevel — the support, resistance, or neckline level price broke through to confirm the pattern.
- necklineSlope — slope (price per bar) of the breakout line, na when the pattern's breakout level isn't a sloped line.
- barIndex — the bar_index the pattern completes (breaks out) on.
- description — a full sentence naming the pattern and the actual measured price levels that triggered it — genuinely useful for a tooltip or an alert message, not just a repeat of the pattern name.
Two additional exported functions turn that raw match into something more actionable, and both work on any ChartPatternMatch regardless of which detect*() function produced it:
- patternStrength(match) — a 0-100 score for how decisively the confirmation close broke through breakoutLevel, relative to the pattern's own price range. A breakout that clears the level by a meaningful fraction of the pattern's own size scores higher than a one-tick poke through it.
- patternTarget(match) — a classical measured-move price target, projecting the pattern's own height from the breakout point. Returns na for patterns without a reliable height to project from (V-Top/V-Bottom Spike, Island Reversal, Bump-and-Run Reversal).
Every detect*() function also exposes its own set of tunable threshold parameters — how flat a "flat top" has to be, how much two shoulders can differ and still count as equal, and so on — all with sensible defaults so you don't have to touch them unless you want to tighten or loosen a specific pattern's sensitivity for a particular instrument or timeframe.
THE 17 PATTERNS
Reversal patterns (7) — signal a potential change in the prevailing trend:
- Head and Shoulders / Inverse Head and Shoulders — detectHeadAndShoulders(). Three swing extremes with the middle one more extreme than the two roughly-equal outer ones, confirmed when price breaks the neckline connecting the two points between them.
- Double Top / Double Bottom — detectDoubleTopBottom(). Two roughly equal peaks (or troughs) with a retracement between them, confirmed when price breaks back through that retracement level.
- Triple Top / Triple Bottom — detectTripleTopBottom(). The same idea as a Double Top/Bottom with a third roughly-equal touch, confirmed on the break of the support or resistance formed between the touches.
- Rounding Top / Rounding Bottom — detectRoundingTopBottom(). A gradual, curved advance-and-rollover (or decline-and-recovery) between two similar edge levels. Approximate: read from three swing pivots rather than fitting a true curve.
- Diamond Top / Diamond Bottom — detectDiamondTopBottom(). Swing range that widens and then narrows again, confirmed on a break of the resulting support or resistance. Rare and approximate: read from three pivot pairs rather than a clean diamond outline.
- Broadening Formation — detectBroadeningTopBottom(). Diverging highs and lows forming an increasingly volatile range, confirmed on a break of either edge. Approximate: read from two pivot pairs rather than a hand-fitted diverging channel.
- V-Top / V-Bottom (Spike) — detectSpike(). A single sharp extreme with no rounding — a large move into the pivot and an equally large move away from it, both measured against the recent average bar range, within a handful of bars. Self-contained, no pivots argument needed.
Continuation patterns (8) — typically resolve in the direction of the move that preceded them:
- Ascending Triangle — detectTriangleAscending(). Flat resistance with rising support, confirmed on a break above resistance.
- Descending Triangle — detectTriangleDescending(). Flat support with falling resistance, confirmed on a break below support.
- Symmetrical Triangle — detectTriangleSymmetrical(). Converging highs and rising lows, confirmed (bullish or bearish) whichever side the price actually breaks.
- Rising Wedge / Falling Wedge — detectWedge(). Both trendlines slope the same direction and converge; breaks the opposite way from the slope, since the shared-direction move was already losing momentum.
- Bull Flag / Bear Flag — detectFlag(). A strong directional move (the pole), followed by a tight, roughly parallel pullback, confirmed on a break back out in the pole's direction. Self-contained, no pivots argument needed.
- Bull Pennant / Bear Pennant — detectPennant(). The same pole-and-consolidation structure as a Flag, but the consolidation narrows and converges rather than staying parallel. Self-contained, no pivots argument needed.
- Rectangle — detectRectangle(). Price boxed between flat support and flat resistance, confirmed on a break of either edge.
- Cup and Handle / Inverted Cup and Handle — detectCupAndHandle(). A rounded recovery (or decline) back to its starting rim, then a shallow pullback (the handle), confirmed on a break through the rim.
Structural / gap-based patterns (2):
- Bullish / Bearish Island Reversal — detectIslandReversal(). A bar (or small cluster) isolated by a gap on both sides, then abandoned by a gap the other way — an abrupt reversal. Self-contained, pure gap logic, no pivots argument needed.
- Bump-and-Run Reversal — detectBumpAndRun(). A lead-in trendline, then a "bump" phase accelerating well beyond it, then a "run" breaking back through the lead-in line. Approximate: the lead-in line is read from just two pivots rather than a hand-drawn trendline.
WHAT THIS LIBRARY DELIBERATELY DOES NOT DO
No plotting, no drawing, no alertcondition() calls, and no inputs — Pine doesn't allow any of those inside a library in the first place, since a library can never be added to a chart on its own. If you want signals, price targets, a scanner table, or alerts, import this library into your own script (or use the companion "Pattern Atlas : Chart Pattern Scanner " indicator, which does exactly that) rather than expecting this script to render anything by itself.
This library also does not evaluate multi-timeframe data, volume, or broader market structure — it's swing-pivot and trendline geometry only, on purpose, so its behavior is easy to reason about and easy to reuse as one building block among several.
Four of the seventeen patterns are explicitly noted above as approximate: Rounding Top/Bottom, Diamond Top/Bottom, Broadening Formation, and Bump-and-Run Reversal are read from a small, fixed number of swing pivots rather than fitting a true curve or hand-drawn trendline to the data. They will not catch every textbook-perfect example of these shapes, and they may occasionally flag a looser approximation of one. Treat them as a starting point for further chart review, not a final word.
PART OF A LARGER SERIES
This is Library #2 in the AxeAlgo Pattern Atlas — a planned set of Pine libraries splitting pattern detection by the method actually used to find each kind of pattern: candlestick shape (Library #1, already published), classical chart/geometric patterns (this library), harmonic patterns (Fibonacci-ratio XABCD structures), and market-structure concepts (order blocks, liquidity, Wyckoff-style events). Each library is independent and useful on its own; together they're meant to cover technical pattern analysis without forcing unrelated detection methods into the same function.
A NOTE ON REPAINTING
trackPivots() only confirms a swing pivot once rightBars bars have passed since it happened — the same confirmation lag ta.pivothigh()/ta.pivotlow() use, just written out as plain comparisons so it works safely inside a library's exported functions. That means a pivot never moves or disappears once confirmed; it just takes rightBars bars to become known, which is a normal and unavoidable part of swing-pivot detection, not a defect in this library. On the currently-forming bar, a pattern's found status can still change tick to tick as that bar's own high, low, and close move — that's inherent to reading live price action. If you're building persisted signals, drawings, alerts, or price targets on top of these functions (rather than a live "what's happening right now" readout), gate your usage on barstate.isconfirmed so a signal only fires once the bar it describes has actually closed, exactly like the companion scanner indicator does.
DISCLAIMER
This library is a technical analysis tool for identifying classical chart pattern shapes in historical and live price data. It does not predict future price movement, and a detected pattern — including any projected price target — is a description of past price action, not a signal guaranteed to repeat. Nothing in this script constitutes financial advice. Always combine pattern recognition with your own risk management and broader analysis before making any trading decision.
라이브러리

BBMA Trend & MomentumBBMA Trend & Momentum
The BBMA structure read as one running sequence rather than a handful of separate signals.
Most tools built on Bollinger Bands and moving averages draw the lines and leave the reading to
you. This one keeps a memory. It knows that momentum came first, that a reversal candle followed it, that the pullback target has already been reached, and it will not report the next step until the ones before it have happened. Each label on the chart is a position in that sequence, not an isolated condition that happened to be true.
Two of those steps are level touches rather than candle patterns, and they are treated
differently from the rest. That distinction is explained below and it matters.
THE LINES
Four families are drawn. Seven individual lines carry every rule in the script.
Bollinger Bands SMA 20 with deviation 2, giving Upper, Mid and Lower
LW MA on the HIGH weighted averages of the candle HIGH, drawn in the upper colour
LW MA on the LOW weighted averages of the candle LOW, drawn in the lower colour
EMA 50 on Close, drawn as a slower reference
The High averages sit above price and the Low averages below it, because of what they are
averaging. That is what forms the two bands the price runs between.
The seven lines every rule is written against are the three Bollinger Bands and the 5 and 10
period LW MAs on each side. Those four averages are drawn SOLID. Periods 6 to 9 are drawn DASHED, exist only to show the shape of the band, and sit on their own switch so you can take them off and see for yourself that nothing is calculated from them. Within each band the 5 sits nearer to price and the 10 further out.
The EMA 50 is drawn and nothing is measured from it either. It is there as background context for your own reading, and it can be switched off without changing a single label.
THE SEQUENCE
Upper and Lower name the band an event belongs to. Every rule below has an exact mirror on the other side, so only the Upper form is spelled out.
CSM - Candlestick Momentum
LW MA 5 High is above the Upper BB, and the candle CLOSES above LW MA 5 High.
The close is therefore beyond the outer band as well, without needing to be tested for it.
EX - Extreme
A CSM has already happened and its Extreme has not been taken yet. LW MA 5 High is still
outside the Upper BB, but a candle now CLOSES back below it. That candle must not reach down to LW MA 5 Low, LW MA 10 Low, or the Mid BB. Touching any one of the three disqualifies it. Exactly one Extreme belongs to one CSM. For another Extreme, a new CSM has to come first.
MTP - Mandatory Take Profit
After an Extreme, the first time price reaches LW MA 5 Low or LW MA 10 Low.
If a new CSM or a new MTM arrives before that touch, the MTP is cancelled and a fresh Extreme
has to form before it can be looked for again.
MLV - Market Volume Lost
After the MTP has been reached, a candle rises to the Upper BB but cannot CLOSE beyond it, and closes at or above the Mid BB. The band was tested and refused.
CSD - Candlestick Direction
A candle that opens on one side of the Mid BB and CLOSES through it, and in the same candle
closes beyond BOTH LW MA 5 and LW MA 10 on the side it broke into. An Upper CSD breaks upward through the Mid BB and both High averages; a Lower CSD breaks downward through the Mid BB and both Low averages. CSD is named by the direction it broke, not by which cycle it interrupted.
MTM - Momentum Push
After a CSM, price falls back below the Upper BB without ever CLOSING below the Mid BB, then
closes above the Upper BB again. That renewed push is the MTM candle. It is not itself a CSM,
which is what separates the two - and because it is not a CSM, it does not open the door to a
new Extreme either. It only clears whatever the previous CSM had left waiting.
RE - Re-Entry
The touch that follows CSM, MTM or CSD. An upper-band sequence looks for LW MA 5 Low or LW MA 10 Low; a lower-band sequence looks for LW MA 5 High or LW MA 10 High. Three kinds are marked separately, because they arrive from three different places:
CSM RE a pullback that was followed by a full CSM
MTM RE a pullback that was followed by an MTM push
CSD RE the pullback after a CSD
WHAT IS READ WHEN
This is the part worth being precise about.
CSM, EX, MLV, CSD and MTM are structure. They are decided on the CLOSE of a candle, and once
decided they never change.
MTP and RE are not patterns, they are level touches. A touch happens at the moment price reaches the level, not when the candle finishes, so both are read on the RUNNING candle. Waiting for the close would report the touch after the level had already been passed, which would describe something other than what happened.
When a running-candle label and a closing label land on the same bar, the running one is
removed and its text is folded into the closing label, so the two never sit on top of each other.
WHAT MAKES THIS DIFFERENT
1. It is a sequence, not a checklist.
An Extreme is not reported unless a CSM came first. An MTP is not looked for until an Extreme has been confirmed, and an MLV not until the MTP has been reached. The same candle shape means different things depending on what came before it, and the script keeps track of that.
2. A step can be cancelled, not only completed.
If momentum resumes with a new CSM or an MTM while an MTP is still waiting for its touch, that MTP is dropped. The market changed its mind, so the sequence restarts rather than reporting a target that no longer belongs to anything.
3. One Extreme per CSM.
An Extreme is the answer to a particular CSM, so it is reported once and then that CSM is spent.
Price can keep closing back inside the band for the next ten candles and none of them will be
called an Extreme. A new CSM has to arrive first. An MTM push does not substitute for one.
4. The Extreme test is deliberately narrow.
Closing back inside the band is not enough. The candle also has to stay clear of the opposite LW
MA 5 and 10 and of the Mid BB. A candle that reaches any of them has done more than fail at the edge, and it is not reported as an Extreme.
5. CSD is named by what it did.
A downward break through the Mid BB and both Low averages is a Lower CSD, wherever it happens to appear. Naming it after the cycle it interrupted would put the wrong word on the chart.
6. Touches are read as touches.
The two events that are levels rather than candle patterns are handled as levels, on the running candle, and the script says so plainly rather than pretending everything is close-based.
READING THE CHART
Each event prints a small label at the candle it belongs to. Upper-band events sit above the
candle, lower-band events below it, and where several land on the same candle they are stacked into one label instead of overlapping.
CSM momentum push beyond the outer band
MTM renewed push after a pullback
EX the reversal candle
MTP first touch of the opposite LW MA 5/10 after an Extreme
MLV the outer band tested and refused
CSD Mid BB and both same-side LW MAs broken together
CSM RE / MTM RE / CSD RE the re-entry touch, named after what preceded it
SETTINGS
Lines
- BB Period and BB Deviations for the Bollinger Bands.
- BB Shift: moves the drawn bands only. The values every rule is measured against are not
moved.
- LW MA 5 to 10 Low and LW MA 5 to 10 High: the twelve weighted average periods. Only 5 and 10 are used by any rule.
- EMA Period.
Pattern Types
- A switch for each of the seven: CSM, MTM, EX, MTP, MLV, CSD and RE.
Line Style
- Show LW MAs: the 5 and 10 period averages, the ones every rule is measured against.
- Show LW MA 6-9 Band: the four decorative periods on each side, on their own switch. Turning
them off is the quickest way to check the claim above - the chart gets simpler and not a single
label moves.
- Show or hide the Bollinger Bands and the EMA.
- Colours for the Bollinger Bands, the LW MA High band, the LW MA Low band and the EMA.
Labels
- Label Size.
ALERTS
Fourteen alert conditions, one for each event on each side:
CSM Upper / CSM Lower
MTM Upper / MTM Lower
EX Upper / EX Lower
MTP Upper / MTP Lower
MLV Upper / MLV Lower
CSD Upper / CSD Lower
Re-Entry Upper / Re-Entry Lower
The structural ones fire once per bar close. MTP and Re-Entry fire once per bar, because they are touches and are read on the running candle.
The same events are also sent through the alert function, so the "Any alert() function call"
alert type can deliver all of them through a single alert. Those messages name the exact
Re-Entry kind - CSM, MTM or CSD - which a fixed alert condition cannot.
REPAINTING
This script does not repaint.
CSM, MTM, EX, MLV and CSD are structure. They are evaluated only after a candle has fully closed and the state memory they drive is updated only on closes, so price moving inside an open candle cannot change the sequence.
MTP and Re-Entry are read on the running candle, and that deserves a straight answer rather than a disclaimer, because a label that can appear mid-candle usually can vanish mid-candle too. Here it cannot, and the reason is in the arithmetic of the level being watched.
A weighted average of the LOW gives the candle still forming a weight of one third at length 5,
and about one fifth at length 10. The running low of that candle falls three to five times faster
than the average it is being compared against. So the moment the low reaches the average, the gap between them can only keep closing. It can never reopen inside that candle. The high side is the exact mirror.
Which means:
- Once an MTP or Re-Entry label is drawn, it stays. It cannot un-touch before the candle closes.
- Reloading the chart gives the same result, because a closed candle is evaluated once using its
final low and high, and those are the most extreme values the candle ever had.
- The only thing that changes at the close is presentation: a running-candle label is folded into
the closing label for that bar so the two do not sit on top of each other. The event itself is
not re-decided.
When you create an alert, TradingView may show a caution banner saying the indicator can repaint.
That banner appears automatically for any script that uses the built in bar state variables, no
matter how they are used, because the platform cannot check the intent behind them. For the
structural alerts, choosing "Once Per Bar Close" is still recommended.
NOTES AND LIMITATIONS
- CSD is the strong form only: the Mid BB and BOTH same-side LW MAs have to be broken by the same candle. A Mid BB break on its own is not reported.
- An Extreme always needs a CSM before it. A reversal candle appearing without that history is
not an Extreme here, whatever it looks like.
- The 6, 7, 8 and 9 period LW MAs and the EMA 50 are drawn but never measured. Changing them, or hiding them, changes the picture and nothing else.
- BB Shift is visual only. Shifting the bands does not shift the rules.
- TradingView caps a script at 500 labels and the oldest are dropped once that cap is reached, so on a long history the earliest labels leave the chart.
- Detection is purely structural. It reports where each step of the sequence occurred and nothing more. It does not rank setups by quality, measure what happened next, or produce entries, targets or stops.
HOW TO USE IT
Read the labels in order rather than one at a time. A CSM on its own says momentum arrived. The same CSM followed by an Extreme says the move ran out of room. That Extreme followed by an MTP and then an MLV says the band was tested again and refused. Each label narrows what the previous one meant.
The two bands are the working area. Price spends most of its time between the LW MA High band and the LW MA Low band, and the Re-Entry marks are where it came back to one of them after a push.
A CSD is the point where the picture changes side. It is the only event in the set that breaks
the Mid BB and both same-side averages in one candle, and everything after it belongs to the new direction.
These are reference points, not entry signals on their own. Use them alongside your own analysis, your own entry method and proper risk management.
DISCLAIMER
This indicator is a pattern detection tool. It is not financial advice and it makes no claim
about profitability. Trading involves risk. Always apply your own analysis and risk management. 지표

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

Keltner Rings [Quantum Algo]Keltner Rings
═══════════════════════════════════════════════
🔶 OVERVIEW
Keltner Rings is a complete reading system built on Keltner Channels — volatility bands placed around an exponential moving average, with width set by the Average True Range. Three nested rings form a gradient volatility field around price, a regime classifier determines what kind of market you are actually in, and the dashboard translates it into plain instructions: when riding the upper band is strength, and when the very same touch is fade material.
That distinction is the heart of this tool. The most common way traders lose money with any channel indicator is applying range logic in a trend — shorting an upper-band touch while price is band-walking higher. Keltner Rings classifies the regime first, interprets every touch accordingly, generates three distinct signal families, and scores each family's historical performance on your exact symbol and timeframe.
═══════════════════════════════════════════════
🔶 WHAT ARE KELTNER CHANNELS?
Keltner Channels are volatility-based bands around a moving average. The concept originates with Chester W. Keltner (1960); the modern formulation — an exponential moving average with bands offset by multiples of the Average True Range — was popularized by Linda Bradford Raschke. Because the Average True Range expands and contracts with real movement, the channel breathes with the market: wide in storms, tight in calm.
This tool extends the classic single channel into three rings — inner, middle and outer — creating a graded map of how far price has traveled from its average in volatility-adjusted terms.
═══════════════════════════════════════════════
🔶 WHAT IS A BAND WALK?
In a genuine trend, price does not oscillate politely around its average — it presses against the channel and rides it, closing beyond the inner ring bar after bar. This is the band walk, and it is the single most misread behavior in channel trading: it looks overbought, and it is actually strength. Keltner Rings detects the walk explicitly (a configurable count of consecutive closes beyond the inner ring), paints the walking bars in full trend color, and marks the walk's beginning as a continuation signal rather than a fade.
═══════════════════════════════════════════════
🔶 WHY IS THIS ORIGINAL?
1. Regime-aware interpretation. The classifier combines average slope, band-walk state, squeeze condition and the channel's own width percentile into four regimes — Trend Up, Trend Down, Range, Squeeze — and the dashboard's "How To Read It" row states, live, how touches should be interpreted right now. The tool teaches its own correct usage.
2. Three signal families, separated on purpose. W marks the start of a band walk with the trend (continuation). R marks a middle-ring rejection in a range regime only (reversion, exactly where reversion belongs). S marks a squeeze release through the inner ring (expansion). One tool, three behaviors, never confused with each other.
3. Per-family statistics on your chart. Every family's ten-bar outcomes are tracked in first-in-first-out samples, shrunk toward neutral at small sizes, with Wilson lower bounds. Each signal's tooltip quotes its own family record on the current symbol at the moment it prints — and the dashboard shows all three records side by side.
4. The width cone. Channel width is ranked as a percentile inside its own recent history, so "tight" and "wide" are defined by this symbol's behavior, never by fixed numbers.
5. The squeeze, credited and integrated. Bollinger Bands closing inside the Keltner ring — the compression concept popularized by John F. Carter — is detected with duration tracking, gold coil markers on the average, and directional release signals.
═══════════════════════════════════════════════
🔶 HOW IT WORKS
— The exponential average and Average True Range build three rings at configurable widths; five gradient fills render the volatility field between them.
— Average slope, walk counters, squeeze state and width percentile feed the regime classifier every bar.
— Signals: W fires when the walk count is reached with the trend; R fires on middle-ring rejections in range regimes; S fires when a mature squeeze releases through the inner ring.
— Each family's outcomes feed its own statistics; the dashboard and tooltips report them with sample counts.
All signals are evaluated on confirmed bars and do not repaint. All drawings are capped for performance.
═══════════════════════════════════════════════
🔶 HOW TO USE IT
— Read the regime row first, then the guidance row — they tell you which of the three signal families is currently in its natural habitat.
— In trends: treat inner-ring pullbacks as entries in the trend direction, and let the painted band walk carry the position; the walk ending is your first warning.
— In ranges: middle-ring touches with rejection candles target the average — the R family's record shows how this symbol has respected that logic.
— In squeezes: the coil duration and width percentile tell you how compressed the spring is; the S release gives the direction, and the family record tells you how trustworthy releases have been here.
— Works on all markets and timeframes; every threshold is volatility-adjusted or percentile-based, so nothing needs retuning per symbol.
═══════════════════════════════════════════════
🔶 SETTINGS
— Keltner Channels: exponential average length, Average True Range length, three ring widths.
— Regime & Signals: trend slope threshold, band-walk bar count, width history window, cooldown, squeeze ring width.
— Statistics: sample cap, minimum samples, shrinkage strength, Wilson z-score.
— Visuals and dashboard: full color control, band-walk painting toggle, position and text size.
═══════════════════════════════════════════════
🔶 ALERTS
— Squeeze Started — compression began.
— Squeeze Release Up / Down — compression resolved through the inner ring.
— Band Walk Started — consecutive closes locked beyond the inner ring with the trend.
— Reversion Signal — middle-ring rejection in a range regime.
═══════════════════════════════════════════════
🔶 FAQ
Q: How is this different from standard Keltner Channels?
A: The standard indicator draws one channel and leaves interpretation to you — including the fatal ambiguity of what an upper-band touch means. This tool adds the regime classifier, the three-ring field, the band-walk engine, explicit signal families for continuation, reversion and expansion, and per-family statistics, so every touch arrives with its context and its track record.
Q: Does it repaint?
A: No. All signals are evaluated on confirmed closes; a printed signal never changes.
Q: Keltner Channels or Bollinger Bands?
A: They answer different questions. Bollinger Bands use standard deviation and react sharply to close-to-close variance; Keltner Channels use the Average True Range and breathe more smoothly with the full bar range. This tool uses both — the channel as the structure, and the Bollinger relationship as the squeeze detector.
Q: What do the family percentages mean?
A: The share of past signals in that family after which price had moved favorably ten bars later, on the current symbol and timeframe, shrunk toward fifty percent at small samples. They describe history — they are not predictions.
Q: Which settings matter most?
A: Band Walk Bars (higher = stricter walks, fewer W signals) and the ring widths — the defaults of one, two and three Average True Ranges follow common practice and suit most markets.
═══════════════════════════════════════════════
🔶 CREDITS
The original channel concept is by Chester W. Keltner (1960); the modern exponential-average and Average True Range formulation was popularized by Linda Bradford Raschke. The Average True Range is by J. Welles Wilder Jr. (1978). Bollinger Bands are by John Bollinger, and the band-compression squeeze concept was popularized by John F. Carter. The Wilson score interval is by Edwin B. Wilson (1927). The regime classifier, three-ring field, band-walk engine, signal families, per-symbol statistics and all code in this script are original work — no third-party or open-source script code was reused.
═══════════════════════════════════════════════
🔶 LIMITATIONS
— Regime classification is descriptive, not predictive: regimes are identified as they form, and transitions are only visible once underway.
— Reversion logic is disabled by design outside range regimes; traders who want to fade trends will not find those signals here.
— Statistics describe the current chart's history only; past frequencies never guarantee future outcomes.
═══════════════════════════════════════════════
🔶 DISCLAIMER
This indicator is a research and charting tool provided for educational purposes. It is not financial advice, and nothing it displays is a recommendation to buy or sell any asset. Trading involves substantial risk of loss. Always do your own analysis and manage risk responsibly. 지표

지표

Directional Bias, Flip & Continuation█ OVERVIEW
Directional Bias, Flip & Continuation is a single decision instrument that answers one question at a time — "which side, and is this a FLIP (reversal) or a CONTINUATION?" — and draws the exact levels that define the read: Trigger, stop, and two targets. Its loudest and most frequent output is STAND ASIDE: by design it spends most of its time telling you there is no clean read, rather than manufacturing one. It issues no buy/sell order and makes no promise; the confidence it shows is an in-script, past-only forward self-test with a Wilson lower bound on THIS chart, not a trained probability.
█ HOW IT WORKS
The tool resolves ONE of four states each confirmed bar, in strict priority order, so the states never contradict each other:
STAND ASIDE (checked first, fires most) — a chaos / extreme-volatility regime, a toxic-tape reading, or price sitting mid-range with no level nearby. This is the default; it is information, not a failure.
FLIP — a confirmed swing trend-flip that occurs AT a graded major level, with order flow not strongly opposed. The side is the flip direction.
CONTINUATION — a trending regime PLUS a confirmed structural break carrying strength PLUS higher-timeframe agreement PLUS price not already stretched into a level. The side is the trend.
CONFLICT — the engines disagree; shown transparently, with no side taken.
Each stage names the method it uses, and every calibrated block shares one scale rather than being independent indicators bolted together:
Regime brain — efficiency ratio (fast vs slow) + ADX with separate trend and strong-trend floors + a self-excitation / volatility-cluster gauge + a variance-ratio random-walk test + an Ornstein-Uhlenbeck mean-reversion read. A trend must clear BOTH persistence (ER) and strength (ADX) floors, so ordinary chop never reads as a strong trend.
Flip engine — a swing-structure trend flip scored by a composite (structure, momentum, location) with a kill state that vetoes flips in the wrong regime.
Continuation engine — a convex-hull channel break, validated for strength and for higher-timeframe alignment, with a stretch guard so a break into an opposing level is not chased.
Levels & targets — a multi-anchor VWAP / anchored-volume-profile ladder that snaps the Trigger, stop and two targets to real liquidity rather than fixed multiples.
Barriers & confidence — a volatility-scaled, regime-asymmetric profit-target / stop geometry, and a forward reject-vs-continue self-test (two-barrier race) that reports each mode's hit rate with a Wilson 95% lower bound and against a matched base rate; it stays "uncalibrated / warming" until the sample is large enough.
Flow proxy — a lower-timeframe signed-volume CVD estimate (Bulk-Volume-Classification fallback) used only to veto a side that fights strong opposing flow; it abstains on no-volume symbols.
█ HOW TO USE
Read the panel top-down: the state (STAND ASIDE / FLIP / CONTINUATION / CONFLICT) and side, then the confidence line, then the four levels. When a FLIP or CONTINUATION is live, the Trigger / SL / TP1 / TP2 are the levels that define it; when the state is STAND ASIDE they read "—" on purpose. The confidence line shows that mode's own forward-tested floor with its sample size, and says "uncalibrated" until there is enough history — treat a warming or low-confidence read as a reason to wait. The dashboard defaults to Compact (state, side, confidence and the four levels only); switch Dashboard detail to Pro to add the regime, engine-agreement, flow-toxicity and free-text detail rows, and enable the backtest strip to see each mode's forward win% and average R. STAND ASIDE dominating the tape is the tool working, not failing. Horizon and position sizing are yours; it places no orders.
█ INPUTS
00 · Data & Source — price source, borrow-volume symbol for volume-less instruments.
01 · Regime brain — ER fast/slow horizons, ADX length and trend / strong-trend floors, ER floors, volatility-cluster length.
02–05 · Flip / Continuation / Structure — swing length, break validation, HTF timeframe and agreement, stretch guard.
06 · Levels & targets — VWAP / AVP anchors, ladder, snap tolerance, barrier multiples.
07 · Confidence & calibration — reject/continue barrier size, horizon, minimum sample, edge-gate window.
08 · Flow proxy — LTF granularity, classifier, toxicity gate.
09 · Display — dashboard detail (Compact default / Pro), backtest strip, regime breakdown, markers, panel position.
10 · Style — Dark / Light theme.
█ HONESTY & LIMITATIONS
This is a study, not a strategy. The confidence figure is an in-sample, descriptive, forward self-test on visible history with fixed barriers and no costs or slippage — it is not a backtest and not a probability of your next trade working. Order-flow side is an OHLCV estimate and abstains on symbols without volume. Non-repaint by construction: all higher- and lower-timeframe reads use lookahead-off; pivots confirm several bars late; the verdict, its levels, and the outcome tracking all resolve on confirmed bars only, and prior-period levels use the standard non-repainting prior-bar idiom. When the sample is small the confidence is shown as uncalibrated and the read is discounted; when there is no clean setup the tool says STAND ASIDE rather than inventing one. No edge shown is honest, not broken.
█ ORIGINALITY
One coherent decision object, not a signal stack. The original contribution is the strict-priority four-state resolution — STAND ASIDE is evaluated first and dominates, so FLIP and CONTINUATION can only fire when the regime, structure, location and flow all agree — paired with a per-mode confidence that is measured on the chart by a Wilson-bounded forward self-test rather than asserted. Each block (regime, flip, continuation, levels, barriers, flow) exists only to feed that single verdict and its levels; none is presented as a standalone indicator. That combination — a location-aware, regime-gated flip-vs-continuation decision that grades and honestly discounts its own confidence, and whose default answer is "stand aside" — is what distinguishes it from a trend filter, a breakout signal, or a bundle of oscillators.
█ CREDITS
Efficiency ratio — Kaufman. ADX / DMI — Wilder. Variance-ratio random-walk test — Lo & MacKinlay. Mean reversion — Ornstein & Uhlenbeck. Self-exciting clustering — Hawkes. Volume-weighted average price / value-area concepts — Market Profile lineage. Bulk Volume Classification — Easley, López de Prado & O'Hara. Trade-side tick rule — Lee & Ready (1991). Two-barrier forward test — López de Prado. Wilson score interval — Wilson (1927). Code written from scratch; no external script reused.
This script is for analysis and education. It is not financial advice. 지표

Darvas Box Ladder [ITA]🟠 OVERVIEW
Darvas Box Ladder plots the rectangle Nicolas Darvas traded, and then keeps plotting the ones that follow it. Darvas did not buy a box and sell it - he rode a ladder of them, staying in as each breakout built a new box higher and lifting his stop to the floor of the newest one. He got out when a box finally broke down.
The script builds each box the way Darvas built it, as a sequence of confirmations rather than a rectangle fitted after the fact, and keeps the completed rungs on the chart so the whole run stays visible.
🟠 CONCEPTS
A Darvas box has an order to it. The ceiling comes first: price makes a new high, and that high has to survive a set number of bars unbeaten before it counts. Only then does the floor form, from the lowest low printed since the ceiling, and it has to survive the same test.
That order matters. A rectangle drawn around any quiet stretch of price is just a consolidation range. A Darvas box is a leader pausing after a run to new highs, and the ceiling-then-floor sequence is what separates the two.
Because both levels come from confirmed structure, they are fixed once drawn and do not move afterwards.
🟠 FEATURES
🔹 The full ladder, not one box - completed rungs stay on the chart so you can see the whole advance rather than the current pause in isolation
🔹 Stop line under the active box - a dashed line at the floor, which is where Darvas kept his
🔹 Measured-move target - one box height projected above the ceiling
🔹 Volume-confirmed breakouts - a close above the ceiling only counts when volume beats its 20-bar average by your chosen multiple
🔹 Box under construction - a dashed ceiling shows while the box is still forming, so you can see one coming before it completes
🔹 New-high filter - boxes may only start from a high that is the highest of the lookback window, keeping the script on leaders instead of drawing rectangles inside downtrends
🔹 Height limits - boxes outside your minimum and maximum are discarded
🔹 Alerts on both the breakout and the box breaking down
🟠 HOW TO USE
Add it to a daily chart of a stock that has been making new highs - that is the setup Darvas was looking for, and the new-high filter will keep the script quiet on anything else.
Watch for the dashed ceiling. That is a box forming. When the floor confirms, the box turns solid and the stop line appears underneath it.
A green box with a triangle below the bar is a confirmed breakout on volume, and the next box begins from there. Each new rung is a chance to lift the stop to the newer, higher floor.
A red box marks the end of the run - price closed below the floor.
Confirmation Bars is the main setting. Darvas used 3. Higher values give fewer, cleaner boxes; lower values react faster and produce more of them.
🟠 CONCLUSION
The box is the easy part. The ladder is what Darvas actually traded, and it is what tells you whether a breakout is the start of a run or the end of one. 지표

Volatility Storm Tracker [Quantum Algo]Volatility Storm Tracker
═══════════════════════════════════════════════
🔶 OVERVIEW
Volatility Storm Tracker treats volatility the way meteorologists treat weather: as a system with structure, pressure, and a lifecycle. Volatility clusters. It compresses before it releases. Its term structure inverts under stress. This indicator measures all of it with professional range-based estimators, locates current volatility inside its own historical cone, charges a Storm Pressure gauge while compression builds, boxes each phase of the storm lifecycle directly on the chart — BUILDING, STORM, AFTERMATH — and projects the statistical expected-move cone forward from live price like a hurricane track.
Its one predictive claim is deliberately narrow and deliberately measurable: after deep, sustained compression, expansion follows. Direction is never predicted — expansion is. And every Storm Watch marker settles publicly into "Delivered" or "Fizzled" depending on whether the expansion actually arrived, so the chart always displays the tool's honest historical record on your exact symbol.
═══════════════════════════════════════════════
🔶 WHAT IS REALIZED VOLATILITY AND WHY DO ESTIMATORS MATTER?
Realized volatility measures how much price actually moves. The naive approach uses only closing prices and throws away most of the information in every bar. Range-based estimators use the full open, high, low and close: Parkinson (1980) exploits the high-low range, Garman-Klass (1980) adds the open-close body, Rogers-Satchell (1991) handles drift, and Yang-Zhang (2000) combines overnight gaps, intraday movement and drift into the most efficient practical estimator — the standard on professional volatility desks. This tool computes the full suite and uses Yang-Zhang as its engine.
═══════════════════════════════════════════════
🔶 WHAT IS A VOLATILITY CONE?
A number like "volatility is 2.4%" means nothing in isolation — is that high or low for this symbol, on this timeframe? The volatility cone, introduced by Burghardt and Lane (1990), answers by ranking current volatility as a percentile inside its own recent history. The 8th percentile means deep compression for THIS market; the 92nd means a live storm. Every definition in this tool is relative to the symbol's own behavior — nothing is hard-coded.
═══════════════════════════════════════════════
🔶 WHAT IS VOLATILITY TERM STRUCTURE?
Short-horizon volatility compared to long-horizon volatility. In calm conditions the short reading sits below the long one (contango). When the short reading rises ABOVE the long one (backwardation), recent movement is violent relative to the established baseline — the classic stress signature options desks watch. The dashboard reads this as Contango, Flat, or Backwardation with the live ratio.
═══════════════════════════════════════════════
🔶 WHY IS THIS ORIGINAL?
1. A professional estimator suite on the chart. Yang-Zhang as the engine, with Parkinson and Garman-Klass computed alongside and readable in the dashboard tooltip — mathematics standard on volatility desks and almost never implemented on this platform.
2. Storm Pressure. A charged gauge built from three measurable ingredients: how deep volatility sits in its cone, how long the compression has lasted, and how unstable volatility itself has become (volatility-of-volatility). Pressure is the tool's early warning — it rises while the chart still looks quiet.
3. The storm lifecycle, boxed and labeled. Each phase is drawn around its own price action: BUILDING in amber, STORM in red, AFTERMATH in slate, with calm periods left clean. Scrolling back reads as a storm history — volatility clustering made visible.
4. The expected-move cone. From live price, the tool projects the one- and two-standard-deviation statistical range forward with the correct square-root-of-time curvature — a hurricane-track cone for price. It is a range projection, never a direction forecast, and it is labeled as such.
5. Settling markers and a public record. Every Storm Watch resolves after a fixed window into Delivered (a move of at least the threshold arrived) or Fizzled. The dashboard's Watch Record row reports the delivery rate with sample count, shrunk toward neutral at small samples, with a Wilson lower bound. The tool grades its own homework where everyone can see it.
═══════════════════════════════════════════════
🔶 HOW IT WORKS
— Each bar, the estimator suite computes realized volatility from the full price range, gaps included.
— Current volatility is ranked inside its historical cone; term structure and volatility-of-volatility are updated.
— Storm Pressure charges during deep, persistent, unstable compression and prints a Storm Watch when it crosses the watch threshold.
— A Storm confirms when volatility enters the top of its own cone; the regime machine transitions Calm → Building → Storm → Aftermath and boxes each phase on the chart.
— After the settle window, each Watch is recolored by outcome, and results feed the statistics.
All detection happens on confirmed bars; settled markers never change. The forward cone is a live projection that updates with volatility — it is explicitly a statistical range, not a prediction of path or direction.
═══════════════════════════════════════════════
🔶 HOW TO USE IT
— Breakout preparation: a charged Pressure gauge inside a BUILDING box is the environment where breakout strategies earn their keep; the Watch Record tells you how reliably expansion has followed on this symbol.
— Position sizing: the Expected Move row translates current volatility into a concrete ±percentage over your horizon — a rational basis for stop distances and size.
— Options context: the cone position and term structure describe whether movement is cheap or expensive relative to this market's own history.
— Regime filtering: many strategies work in exactly one regime. The boxes tell you, at a glance, which regime any historical trade lived in — and which one you are in now.
— Works on all markets and timeframes from 15m to Weekly; everything is self-relative, so nothing needs retuning per symbol.
═══════════════════════════════════════════════
🔶 SETTINGS
— Volatility Engine: estimator length, term-structure windows, historical cone window.
— Storm Detection: watch pressure threshold, storm percentile, delivered-move threshold, settle window, markers kept.
— Expected Move Cone: projection toggle and horizon.
— Statistics: sample cap, minimum samples, shrinkage strength, Wilson z-score.
— Full color, regime-box and dashboard customization.
═══════════════════════════════════════════════
🔶 ALERTS
— Storm Watch — pressure crossed the watch threshold; expansion conditions are charged.
— Storm Confirmed — volatility entered the top of its historical cone.
— Calm Restored — the storm cycle completed.
— Term Structure Inverted — short-horizon volatility exceeded long-horizon; stress regime.
═══════════════════════════════════════════════
🔶 FAQ
Q: Does it predict direction?
A: No — and that is the point. Direction after compression is genuinely uncertain; expansion is not. The tool makes only the claim volatility mathematics can support, and then measures that claim on your chart via the settled markers and the Watch Record.
Q: Does it repaint?
A: No. Watches, storms and regime transitions are detected on confirmed bars, and settled markers are permanent. The forward cone updates live because it is a projection from current conditions — it is drawn to the right of price and never alters past signals.
Q: What does "Delivered" mean on a settled marker?
A: That price moved at least the configured threshold (in Average True Range units, in either direction) within the settle window after the Watch. "Fizzled" means it did not. Both outcomes stay on the chart.
Q: Why Yang-Zhang instead of a simple standard deviation of closes?
A: Close-to-close volatility ignores gaps and intrabar range, making it slow and noisy. Yang-Zhang uses the full bar plus the overnight gap and is dramatically more efficient — the same reading quality from far fewer bars, which matters enormously for adaptive thresholds.
Q: Which markets does it suit?
A: All of them — crypto, stocks, indices, forex, commodities. Every threshold is defined relative to the symbol's own volatility history, so the tool recalibrates itself wherever you load it.
═══════════════════════════════════════════════
🔶 CREDITS
Range-based volatility estimators by Michael Parkinson (1980), Garman and Klass (1980), Rogers and Satchell (1991), and Yang and Zhang (2000). Volatility cones after Burghardt and Lane (1990). Volatility clustering first documented by Benoit Mandelbrot (1963) and formalized in the ARCH family by Robert Engle (1982), referenced as conceptual context. The Wilson score interval is by Edwin B. Wilson (1927). The storm pressure model, regime state machine, settling audit, per-symbol statistics and all code in this script are original work — no third-party or open-source script code was reused.
═══════════════════════════════════════════════
🔶 LIMITATIONS
— Expansion timing is probabilistic: pressure can stay charged longer than expected, and some Watches fizzle — the record row exists precisely to quantify this on your chart.
— The expected-move cone assumes volatility measured today persists over the horizon; regime shifts mid-projection will widen or narrow the true range.
— Statistics describe the current chart's history only; past frequencies never guarantee future outcomes.
═══════════════════════════════════════════════
🔶 DISCLAIMER
This indicator is a research and charting tool provided for educational purposes. It is not financial advice, and nothing it displays is a recommendation to buy or sell any asset. Trading involves substantial risk of loss. Always do your own analysis and manage risk responsibly. 지표

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

Premarket OTT TriggerPremarket OTT Trigger
Premarket OTT Trigger is a multi-timeframe indicator designed to identify important premarket price zones using a 15-period OTT and then use those zones for structured break-and-retest setups after the market opens.
The concept is simple:
Higher timeframe = Find the setup
Lower timeframe = Find the entry
During premarket, the indicator looks for the most recent candle that crosses or touches the OTT. That candle is automatically boxed from its high to low, with a 50% midline, and the box extends to the right throughout the trading session.
If another qualifying premarket candle appears later, the older box is removed and the newest candle becomes the active zone.
Why Look for an OTT Cross?
A symbol with a premarket candle crossing or interacting with the OTT may be showing increased price activity and the potential for meaningful movement during the session.
This does not guarantee a move, but it can help identify symbols worth adding to a watchlist.
The resulting box creates a clearly defined trading area with three important levels:
Box High
50% Midline
Box Low
Instead of entering randomly, traders can use these levels to wait for price to show direction.
Break & Retest Method
A simple approach is to use the 30-minute timeframe to identify the box and the 5-minute timeframe for entries.
Bullish Setup
Wait for price to break above the box high.
Do not chase the initial breakout.
Allow price to pull back and retest the top of the box.
If the old resistance level holds as support and the 5-minute chart shows bullish confirmation, this can provide a potential long setup.
Break Above → Retest → Hold → Long
Bearish Setup
Wait for price to break below the box low.
Allow price to retest the broken level from underneath.
If the old support level acts as resistance and the 5-minute chart shows bearish confirmation, this can provide a potential short setup.
Break Below → Retest → Reject → Short
If price remains inside the box, the idea is simply to wait for direction.
AAPL Example
In the AAPL example shown, the 30-minute timeframe was used to establish the premarket OTT box, while the 5-minute chart was used for trade execution.
The higher timeframe provided the important premarket structure, while the lower timeframe provided a more precise view for the breakout, retest, and entry.
This is the core idea behind the indicator:
OTT Interaction → Potential Movement → Defined Zone → Break → Retest → Entry
Features
Selectable indicator timeframe
15-period OTT
Adjustable OTT percentage
Adjustable premarket session
Wick Touch, Body Cross, or Close Cross detection
Automatic most-recent premarket box
Automatic daily reset
Box High, Low, and 50% Midline
Dynamic box colors
Solid, Dashed, or Dotted box borders
Customizable midline style
Optional candle-close confirmation
Box extends through the trading session
Important
The OTT cross is not intended to predict direction by itself.
Its purpose is to help identify symbols that may be showing meaningful premarket activity and create a defined trading zone where entries, invalidation, and risk can be planned more clearly.
The trader still waits for price to confirm direction through the break and retest.
30M for structure.
5M for execution.
Let price confirm the trade.
This indicator is intended as a structure and confirmation tool and should be combined with proper risk management, position sizing, and your own trading plan.
For educational purposes only. Not financial advice.
Credits: This indicator incorporates the Optimized Trend Tracker (OTT) concept originally developed by Anıl Özekşi. Credit is also given to Kıvanç Özbilgiç for bringing OTT implementations to the TradingView/Pine community. This script extends the concept into a multi-timeframe premarket zone and break-and-retest framework.
지표
