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

지표

지표

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

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

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

지표

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

지표

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

지표

MAD Adaptive Trend Score [BackQuant]MAD Adaptive Trend Score
Overview
MAD Adaptive Trend Score is a trend oscillator built from a Median Absolute Deviation-based price filter and a multi-lookback relative-position score.
The indicator first calculates a rolling median and MAD from the selected source. Price deviation from the median is then clipped to a configurable MAD envelope, producing the MAD Adaptive Filter.
The current value of that filtered series is then compared with a range of its previous values. Each comparison contributes either +1 or -1 to a Trend Score.
The result is a bounded directional score that can be used with separate bullish and bearish thresholds to create a persistent trend state.
The script includes:
Exact rolling median and MAD calculations.
MAD-based clipping of source movement.
Configurable multi-lookback Trend Score.
Separate long and short regime thresholds.
Optional filter overlay on the main chart.
Trend candle colouring and signals.
Reference levels and alerts.
MAD Adaptive Filter
The first stage calculates the rolling median of the selected Source over the MAD Length.
It then calculates Median Absolute Deviation:
MAD = Median(|X - Median(X)|)
Raw MAD is multiplied by 1.4826:
Scaled MAD = Raw MAD × 1.4826
with a minimum value based on the instrument's minimum tick.
The 1.4826 factor is commonly used to scale MAD to approximately the same scale as standard deviation when the underlying distribution is normal.
The indicator then measures:
Deviation = Source - Rolling Median
and defines the maximum permitted deviation as:
Maximum Deviation = Scaled MAD × MAD Multiplier
The source deviation is clipped to this range before being added back to the median.
Conceptually:
If Source remains inside the MAD envelope, the filter follows Source.
If Source moves above the envelope, the filter is limited to the upper MAD boundary.
If Source moves below the envelope, the filter is limited to the lower MAD boundary.
The MAD Adaptive Filter is therefore not a conventional moving average. It is a source series whose distance from its rolling median is limited by the current MAD-derived envelope.
MAD Multiplier
MAD Multiplier controls the permitted distance between the filtered value and the rolling median.
Lower values:
Create a tighter envelope.
Clip more of the source movement.
Keep the filter closer to the median.
Higher values:
Create a wider envelope.
Allow more source movement through unchanged.
Make the filter follow price more closely.
Trend Score
The second stage scores the current MAD Filter against several previous values of the same filtered series.
For every lookback between Score Lookback Start and End:
+1 if the current MAD Filter is above the historical MAD Filter.
-1 otherwise.
The final Trend Score is the sum of all comparisons.
If N historical values are being compared, the theoretical score range is:
-N to +N
For the default 1-to-45 range, 45 comparisons are made, so the score can range from -45 to +45.
What the score represents
A high positive score means the current MAD-filtered value is above most of the historical filtered values being compared.
A strongly negative score means it is above very few of them.
For example, with 45 comparisons:
A score near +45 means the current filtered value is above nearly the entire comparison range.
A score near 0 means the comparisons are more evenly divided.
A score near -45 means the current filtered value is below, or equal to, nearly all of them.
The score is therefore best understood as a relative position / trend score of the filtered series.
It is not a return forecast or probability of future direction.
Why use several lookbacks?
Comparing the current filter with only one previous value would effectively reduce the calculation to short-term slope.
Using many previous values instead measures where the current filtered level sits relative to a broader section of its history.
A steadily rising filtered series will generally move toward higher positive scores because the current value becomes greater than an increasing number of historical values.
During sustained weakness, the opposite occurs.
Score Lookback Start and End
These settings define which historical MAD Filter values participate in the score.
For example:
Start = 1
End = 45
compares the current filter against each filtered value from 1 through 45 bars ago.
A shorter range:
Responds more quickly to recent changes.
Creates a smaller score range.
A longer range:
Includes more historical comparisons.
Produces a broader measure of relative trend position.
Usually changes more gradually.
Because the score range depends on the number of comparisons, threshold settings should be chosen with the selected score range in mind.
Trend State
The script converts the Trend Score into a persistent bullish or bearish signal state.
The bullish and bearish rules are deliberately separate.
Bullish condition
The signal becomes bullish when:
Trend Score > Long Threshold
Once bullish, the state remains bullish until a valid bearish condition occurs.
Bearish condition
The signal becomes bearish when the score crosses downward through the Short Threshold:
Previous Score >= Short Threshold
Current Score < Short Threshold
The bearish condition therefore requires an actual downward threshold crossing rather than simply remaining below the level.
Why use separate thresholds?
Using different bullish and bearish levels introduces persistence into the regime.
The signal does not need to reverse whenever the score crosses zero.
For example, with:
Long Threshold = 40
Short Threshold = -6
the score must reach a strongly positive state before the model turns bullish, but the bullish state can persist through a substantial amount of score deterioration before a bearish transition occurs.
This creates a form of threshold hysteresis and reduces rapid switching around a single center level.
The thresholds are fully configurable and do not need to be symmetrical.
Initial state
The signal begins neutral.
A bullish state can be established once the Long Threshold condition is satisfied.
A bearish state requires a valid downward crossing of the Short Threshold.
Signal markers are shown only when an established bullish state changes to bearish or an established bearish state changes to bullish.
The initial transition from neutral does not produce a long/short marker.
Reference Lines
The optional dashed reference lines display the Long and Short Thresholds directly in the oscillator pane.
These levels correspond to the actual regime settings and can be useful when visually tracking how the Trend Score approaches a possible state change.
MAD Filter Overlay
The MAD Adaptive Filter can optionally be plotted directly on the main price chart.
This makes it possible to compare:
Raw price.
The rolling-median/MAD envelope response.
The active trend colour.
The overlay uses the same bullish or bearish state colour as the oscillator.
Trend Candles
Optional chart candles are coloured from the stored trend state:
Bullish state = Long Color.
Bearish state = Short Color.
The colour represents the indicator's trend regime rather than the direction of each individual candle.
Background Colour
An optional transparent background can also display the current trend regime on the main chart.
This is purely visual and does not alter the calculation.
How to interpret it
Strong positive score
The current MAD Filter is above most values in the selected historical comparison range.
This typically accompanies a relatively strong upward position in the filtered trend.
Falling score while still bullish
The filtered trend is losing relative strength, but the Short Threshold has not yet been crossed.
The persistent state therefore remains bullish.
Short Threshold crossing
The score has deteriorated far enough to cross below the selected bearish boundary, changing the stored state to bearish.
Rising score while bearish
The score can recover substantially while the trend remains bearish.
A new bullish state is not established until the score exceeds the Long Threshold.
How to use the indicator
The indicator can be used as:
A directional trend filter.
A persistent bullish/bearish regime indicator.
A way to measure the relative position of a MAD-filtered price series.
A confirmation tool alongside other price or market-structure analysis.
The score itself can also provide additional context beyond the binary trend colour.
For example, a bullish regime with a score near its maximum is different from a bullish regime whose score has already fallen substantially toward the bearish threshold.
Input Guide
MAD Length
Controls the rolling sample used to calculate the median and Median Absolute Deviation.
Shorter values adapt more quickly.
Longer values produce a broader statistical reference window.
MAD Multiplier
Controls how far the filtered source may move away from its rolling median.
Lower values produce stronger clipping.
Higher values allow the filter to follow Source more closely.
Score Lookback Start / End
Defines the historical MAD Filter values used in the Trend Score comparisons.
Long Threshold
Score level that must be exceeded to establish a bullish state.
Short Threshold
Level that must be crossed downward to establish a bearish state.
Data Window
The script exposes:
Rolling Median.
Raw MAD.
Scaled MAD.
These values can help show how the underlying MAD filter is being constructed.
Limitations
The indicator is reactive rather than predictive.
The score measures the current filtered value relative to historical filtered values; it does not estimate future returns.
Threshold selection can materially change signal frequency and persistence.
A very tight MAD Multiplier can suppress meaningful movement along with noise.
A very wide MAD Multiplier makes the filter increasingly similar to the original Source.
Long score ranges can improve persistence but also delay changes in regime.
Strong trends can keep the score near an extreme for extended periods.
Alerts
The script includes:
MAD Trend Score Long: stored signal changes from bearish to bullish.
MAD Trend Score Short: stored signal changes from bullish to bearish.
Summary
MAD Adaptive Trend Score combines two simple ideas.
First, the selected Source is constrained around a rolling median using Median Absolute Deviation. Source movement inside the MAD envelope passes through normally, while movement beyond the envelope is clipped to the current boundary.
Second, the current filtered value is compared with a configurable range of its own historical values.
Those comparisons are summed into a Trend Score, with positive values indicating that the current filtered level is above more of the historical comparison range and negative values indicating the opposite.
Separate Long and Short Thresholds then convert the score into a persistent bullish or bearish regime.
The result is a MAD-based filtered series and relative-position trend score for experimenting with trend persistence and threshold behaviour. 지표

지표

Williams Variable A/D Pressure [MarkitTick]💡 This tool reframes Larry Williams' Variable Accumulation/Distribution concept as a fully adaptive, confluence-filtered oscillator, then extends it into a complete ATR-based trade-management layer with a live on-chart dashboard. Rather than reading a single fixed-formula line, traders get a volume-weighted pressure reading that can be reshaped through eight different smoothing engines, gated by a trend-strength filter and a higher-timeframe bias check, and translated directly into projected entry, stop, and take-profit levels the moment a qualifying signal appears.
✨ Originality and Utility
The core value of this script is not the Variable A/D formula itself — that calculation is decades old — but the pipeline built around it. Three distinct engineering layers are stacked with a specific purpose each, which is what justifies combining them into a single publication rather than three separate scripts:
A selectable adaptive-smoothing stage that lets the trader choose how the raw pressure sum is denoised — from simple averaging to cascaded, lag-reduced, and custom recursive estimators — instead of being locked into one fixed filter shape.
A dual confluence gate (trend-strength via ADX and directional bias via a higher timeframe) that suppresses crossovers occurring in weak or conflicting conditions, rather than firing on every raw cross of the smoothed line against its signal average.
An execution layer that converts a confirmed crossover into a concrete, volatility-scaled trade plan (entry, stop, three take-profit tiers) with automatic on-chart tracking of which levels have been touched, plus JSON webhook payloads for each event so the signal can drive external automation without manual re-entry of parameters.
None of these layers is arbitrary window-dressing: the adaptive filter changes what "the trend" looks like, the confluence gate decides whether that trend is tradeable, and the trade-management layer answers the practical question of where to actually place risk once a decision has been made. Removing any one of the three would leave either a raw unfiltered oscillator, an unfiltered signal, or a signal with no execution framework.
🔬 Methodology and Concepts
• Williams Variable Accumulation/Distribution Core
For every bar, a raw pressure value is calculated as the bar's directional efficiency — (close − open) divided by the bar's full range (high − low) — multiplied by that bar's volume. This produces a signed, volume-weighted read of how much of the bar's traded volume pushed price toward its close relative to its open, scaled by how decisively the bar closed within its own range. This raw series is then summed over the WVAD Period using a simple moving average multiplied by the period length, which reconstructs a rolling total (rather than an average) of accumulated buying or selling pressure over that window — consistent with Williams' original "variable" accumulation/distribution concept, where the weighting factor varies bar to bar instead of using a fixed multiplier.
• Adaptive Filter Engine
The rolling WVAD sum is then optionally reshaped by one of eight selectable smoothing methods before it becomes the tool's working "WVAD" line:
SMA / EMA / RMA — standard simple, exponential, and Wilder-style moving averages applied directly to the WVAD sum.
Double WMA — a weighted moving average applied to the output of a first weighted moving average, compounding the weighting to reduce lag further than a single WMA pass.
Triple VWMA — a volume-weighted moving average cascaded through itself three times, so the smoothing itself continues to lean on volume at each stage rather than only at the raw-pressure stage.
HMA — a Hull Moving Average pass, used here for its reduced-lag response relative to standard averages.
LLAMA — a proprietary in-house filter unique to this script. It combines a simple moving average of the WVAD sum with a linear extrapolation term: the average per-bar slope of the WVAD sum across the lookback window, scaled by half that window's length, is added back to the moving average. In practice this projects the average forward along its recent trend rather than leaving it lagging behind price the way a plain moving average would.
Kalman Filter — also a proprietary, simplified single-state implementation rather than a textbook multi-variable Kalman filter. It maintains a running error estimate and a fixed process-noise term equal to the reciprocal of the selected length; on each bar it computes an adaptive gain from the ratio of predicted error to that error plus a fixed measurement-noise constant, then nudges its estimate toward the new WVAD value by that gain. Shorter lengths raise the process-noise term and make the filter react faster to new data; longer lengths make it progressively smoother and slower to adapt.
Selecting "None" bypasses this stage and the raw WVAD sum is used directly.
• Signal & Confluence Logic
A Signal Length moving average of the (optionally filtered) WVAD line produces the Signal line, and the difference between the two produces the histogram. A raw long or short bias is registered when the WVAD line crosses above or below its Signal line. That raw bias only becomes an active Long/Short signal when both confluence conditions pass: the ADX Filter, when enabled, requires the prior bar's ADX reading to be at or above the ADX Threshold before a crossover is accepted, filtering out signals born in low-trend-strength conditions; the HTF Confirmation filter, when enabled, requires the previous, fully closed candle on the selected higher timeframe to have closed bullish for long signals or bearish for short signals, filtering out crossovers that fight the higher-timeframe bias.
• Confirmation & Non-Repainting Design
The script is built so that no decision depends on data that has not yet closed. The crossover check itself compares the previous bar's WVAD and Signal values, the ADX gate reads the previous bar's confirmed ADX value, and the higher-timeframe request pulls the prior, already-closed candle on that timeframe rather than the currently forming one. Entry price for a new trade plan is likewise taken from the previous bar's close rather than the live price. Entry/exit alerts only fire once a bar is fully confirmed. One practical consequence worth understanding: because the crossover and entry reference both use the prior bar, there is a small, consistent one-bar delay between the moment the underlying pressure line actually crosses its signal and the bar on which the trade plan is drawn and the alert can fire — this is a deliberate confirmation design choice, not an inconsistency. Take-profit and stop-loss "hit" detection, by contrast, is checked against each bar's own intrabar high/low as it happens and can alert in real time, since that behavior simply reports a price touching an already-fixed level rather than altering a prior signal.
🎨 Visual Guide
• Oscillator Pane
The WVAD line plots the (optionally adaptively filtered) pressure sum.
The Signal line plots its moving average.
The Histogram, drawn as columns, shows the difference between the two and cycles through four shades: a solid strong color when rising above zero, a faded shade when falling but still above zero, a solid opposite color when falling below zero, and a faded shade when rising but still below zero — giving an at-a-glance read of both direction and momentum change.
A flat Zero Line marks the neutral pressure boundary.
BULL and BEAR text markers appear directly on the oscillator at the bar where a confirmed long or short signal registers.
• Price Chart Overlay Elements
Several elements are pushed onto the main price chart even though the indicator's native pane is the oscillator below it:
Heatmap Candles optionally recolor the actual price candles' bodies, wicks, and borders based on whether the WVAD line is above, below, or equal to its Signal line — turning the price chart itself into a running visual of the underlying bias.
A second copy of the BULL/BEAR marker is placed directly below or above the corresponding price bar, so the signal is visible on the price chart without needing to also watch the oscillator pane.
• Trade Level Projection
When a confirmed signal fires (and levels are not locked), five horizontal lines and matching labels are drawn from the signal bar forward: the Stop-Loss line and label, the Entry line and label, and three Take-Profit lines and labels (TP1–TP3). A shaded Risk fill spans the zone between stop and entry, and a shaded Reward fill spans between entry and TP3, giving an immediate visual sense of the risk/reward geometry. All five lines automatically extend to the right as new bars form. Once a take-profit or stop level is touched, its label text updates in place to show a hit confirmation and the resulting percentage gain or loss from entry — the lines are not redrawn or repositioned, only the label text and the ongoing color state update.
• Dashboard Panel
An optional table (position configurable) summarizes, in real time: the symbol and timeframe, whether Lock Signal is active, the current directional Bias, the raw WVAD and Signal values, the Histogram value, a filled-bar Strength readout (WVAD magnitude relative to its own 100-bar high), current Volume and a filled-bar Volume Ratio (versus its 20-bar average), the Higher-Timeframe Bias (only shown when that filter is enabled), the current ADX reading (only shown when the ADX filter is enabled), the active Adaptive Filter name (only shown when one is selected), and the live Trade direction with Entry, SL, and TP1–TP3 prices, each recoloring once its corresponding level has been hit.
📖 How to Use
Treat a WVAD-over-Signal cross, confirmed by a BULL/BEAR marker and matching histogram color flip, as the core directional bias; the heatmap candles offer the fastest visual confirmation of that same bias directly on price.
Enable the ADX Filter to require a minimum trend-strength reading before a crossover is accepted — useful for avoiding signals generated during flat, low-conviction chop.
Enable HTF Confirmation and choose a higher timeframe to only accept longs when that timeframe's last closed candle was bullish, and shorts when it was bearish — this narrows signals to those aligned with the broader trend context.
Use the Adaptive Filter dropdown to trade off responsiveness against smoothness: SMA/EMA/RMA are the most transparent baseline options, Double WMA and Triple VWMA add extra lag reduction (the latter leaning more heavily on volume), HMA targets minimal lag, and LLAMA and Kalman Filter are the script's proprietary adaptive options for traders who want the smoothing itself to react to changing conditions rather than stay fixed.
Lock Signal freezes the currently displayed trade-level lines and labels so a new opposite signal will not replace them while it is enabled; it does not stop new BULL/BEAR markers, histogram behavior, or alert conditions from continuing to register — it only holds the visual trade plan in place.
The Entry price used for any trade plan is the previous bar's close, not the live price at the moment the signal appears, so real-world fills will vary from the plotted entry level depending on slippage and gap risk.
Configure the Alerts group's action-tag fields to match whatever automation system consumes the webhook payloads, then build a TradingView alert on this script using "Any alert() function call" to receive the JSON messages for entries, exits, and each TP/SL event.
⚙️ Inputs and Settings
• Core Settings
WVAD Period — the summation length for the raw Variable A/D pressure calculation.
Signal Length — the moving-average length used to derive the Signal line from the (filtered) WVAD line.
• Filters
Use HTF Confirmation / HTF Timeframe — enables the higher-timeframe directional gate and sets which timeframe it checks.
Use ADX Filter / ADX Threshold / ADX Length — enables the trend-strength gate and sets its minimum qualifying reading and DMI length.
Adaptive Filter / Adaptive Filter Length — selects which of the eight smoothing methods (or none) is applied to the WVAD sum, and its lookback length.
• Trade Tools
Lock Signal — freezes the current trade-level projection against replacement by a new signal, as described above.
Show Trade Levels — toggles whether entry/SL/TP lines, labels, and fills are drawn at all.
SL × ATR — sets the stop distance as a multiple of ATR from the entry reference price.
TP1 × R / TP2 × R / TP3 × R — set each take-profit distance as a multiple of the initial risk (R) defined by the stop distance.
ATR Length — the lookback used for the ATR value driving stop and target distances.
• Visuals
Show Histogram, Show WVAD/Signal Lines, Show Signal Markers, Show Zero Line, and Color Candles independently toggle each corresponding chart element described in the Visual Guide.
• Dashboard
Show Dashboard and Position control whether the summary table is displayed and which corner it occupies.
• Alerts
Long / Short / Close Long / Close Short Action and TP1 / TP2 / TP3 / SL Hit Action — free-text tags inserted into each event's JSON webhook payload (alongside ticker, timeframe, and relevant price fields) so external automation can route each message correctly.
Colors for every line, fill, label, candle state, and dashboard element are independently configurable and are purely cosmetic.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The foundation is Larry Williams' Variable Accumulation/Distribution concept: a price-volume flow measure in the same family as Chaikin's Accumulation/Distribution Line, but weighting each bar's volume by its own directional efficiency — (close − open)/(high − low) — rather than the Close Location Value used in Chaikin's version, making the "variable" weighting bar-specific rather than fixed.
The adaptive-smoothing stage draws on several established ideas from technical filtering theory: cascaded weighted and volume-weighted averaging (repeated WMA/VWMA passes) as a lag-reduction technique, Alan Hull's reduced-lag moving average construction, and the broader concept of adaptive filters that vary their responsiveness with market conditions rather than using a static weighting scheme — the category popularized by adaptive moving-average research such as Kaufman's work. Within that category, this script's LLAMA and Kalman Filter options are simplified, single-parameter, in-house approximations: LLAMA borrows the linear-extrapolation logic underlying least-squares/regression-adjusted moving averages (projecting a simple average forward using its own recent slope), while the Kalman Filter option implements a single-state recursive estimator in the spirit of Kalman filtering — updating an estimate and its error term each bar based on a fixed process/measurement noise ratio — rather than the multi-state, matrix-based formulation used in full Kalman filter implementations.
The ADX/DMI confluence gate is drawn from Welles Wilder's Directional Movement System, using ADX as a proxy for trend strength independent of direction. The higher-timeframe confirmation gate reflects standard multi-timeframe analysis practice, where aligning a lower-timeframe signal with a higher-timeframe directional read is used to reduce signals that contradict the broader trend. Finally, the ATR-based stop and R-multiple take-profit structure reflects standard volatility-adjusted position and risk management practice, sizing trade levels to each instrument's own recent average range rather than to a fixed point or percentage value.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. 지표

XeL OnlineRecursionXeL OnlineRecursion is a Pine Script library for online and streaming statistical estimation on continuous numerical and financial data.
The library is designed around recursive statistical populations whose retained state is updated observation by observation. Most recursive components use constant retained memory and O(1) work per observation, making them suitable for indicators and models that require adaptive statistics without repeatedly recalculating an entire historical window.
OnlineRecursion is statistical infrastructure rather than a trading signal, strategy, or standalone indicator. It is intended to be imported and composed by other Pine scripts.
CORE DESIGN
The library separates four conceptual layers:
Streaming and population mechanics.
Generic retained statistical state.
Derived statistical interpretations.
Finance-oriented evidence and recursive weighting models.
A central design principle is that retained state represents a statistical population. Statistics that can be derived from an existing population are computed from that state rather than introducing unnecessary independent recursions.
STATISTICAL TOOLS
The library includes:
First-order recursive filtering and recursive extrema estimation.
Sample-and-hold, settlement, accumulation, and exact rolling-sum tools.
Fixed-memory P2 cumulative quantile estimation.
Adaptive quantile and expectile estimation.
Adaptive conditional tail-mean estimation.
Adaptive Huber location estimation.
Adaptive MAD and Gaussian-equivalent robust scale.
Recursive univariate moments through fourth order.
Variance, sigma, skewness, kurtosis, and effective sample size.
Recursive covariance and correlation.
Recursive linear-regression views including beta, intercept, and R-squared.
Recursive Heavy-Tail distribution estimation.
Relative-return, relative-projection, and additive-moment transforms.
Recursive decay, anchored, participation, and composite-alpha constructors.
Market-participation models.
Market-dispersion models.
POPULATION SEMANTICS
OnlineRecursion treats population geometry as part of the mathematical definition of an estimator.
Depending on the component, the represented population may be:
Cumulative.
Finite rolling.
Exponentially weighted.
Anchored.
Conditional.
Observation-clock.
Event-clock.
These population interpretations are not assumed to be interchangeable.
Initialization, missing observations, reset behavior, recursive coefficients, and population boundaries are therefore explicit estimator semantics rather than incidental implementation details.
Where defined as a recursive feedback coefficient, alpha generally follows a convention. Exact initialization behavior is defined by each estimator because creation of a new statistical population is not always equivalent to an ordinary recursive update.
FINANCE-ORIENTED EVIDENCE
The library includes reusable tools for constructing adaptive market evidence, including time-decay weighting, participation-based weighting, relative-return transformations, and recursive market-dispersion models.
Available dispersion interpretations include:
Mean displacement.
Realized movement.
Drawdown.
Upthrust.
Directional stress peaks.
Average directional stress.
Participation models allow recursive weighting to respond to different market-population relationships rather than treating every observation as equally informative.
The chart accompanying this publication demonstrates library mechanics on NQ continuous futures using hourly observations and Open Interest participation.
The upper and lower dispersion plots, recursive mean, and lower-pane statistic illustrate one possible composition of exported library functionality.
These plotted outputs are demonstrations of statistical mechanics. They are not trading signals or recommended parameter settings.
HEAVY-TAIL MODEL
The Heavy-Tail estimator combines generic recursive moment state with additional model-specific interpretations such as Student-t degrees of freedom, t-distribution scale, and absolute-innovation scale.
HeavyTail is one statistical interpretation built on the generic moment backbone. The library does not assume that this model is appropriate for every market, instrument, or application.
USAGE
Import the library from another Pine Script and use the exported state types, methods, enumerations, or functional interfaces required by the application.
Stateful interfaces provide explicit control over retained state and update timing. Functional interfaces are also provided where convenient for series-oriented use.
Some estimator compositions intentionally require caller-controlled timing.
For example, when one adaptive estimator supplies a threshold, center, or scale to another estimator, the caller may need to use the previously retained value to avoid unintended same-observation feedback.
MISSING DATA AND CALLER POLICY
Market-data-dependent functions can return na when required information is unavailable or when the requested statistical relationship is not currently defined.
Fallback behavior intentionally remains with the importing application when the library cannot define the relationship mathematically.
This prevents unavailable data from being silently converted into a different statistical assumption.
LIMITATIONS
OnlineRecursion does not provide:
Entry or exit logic.
Trading recommendations.
Profitability claims.
A guarantee that any estimator is appropriate for a particular market.
Recursive estimators depend on their coefficient policy, population definition, and initialization semantics.
A recursive population is not automatically equivalent to a finite rolling-window population merely because their outputs may appear similar.
Users should therefore select estimators and coefficient models according to their statistical meaning rather than treating all recursive parameters as interchangeable smoothing controls.
DESIGN INTENT
OnlineRecursion is intended to provide reusable statistical infrastructure from which higher-level models can be composed.
The architecture follows this separation:
Foundational state represents the retained population.
Derived statistics interpret that population.
Models add model-specific assumptions.
Applications decide how statistical evidence is used.
This separation is intended to keep generic statistical machinery independent from application-specific trading logic.
VERSION
This first TradingView library publication corresponds to XeL OnlineRecursion development release 1.0.0-rc.2 , dated 2026-09-04.
TradingView library publication revisions such as /1 are independent of the project's development release numbering. 라이브러리

TMA Volatility BandsTMA Volatility Bands
TMA Volatility Bands is a trend and volatility indicator built around a smoothed Triangular Moving Average (TMA) and dynamically calculated deviation bands.
The indicator is designed to show the current market trend, volatility range, and potential reversal areas through a structured set of expanding TMA bands.
The TMA acts as the central trend reference, while the surrounding bands expand according to the current deviation of price from the TMA. This creates three volatility levels on both sides of the TMA, helping visualize how far price has moved from its smoothed average.
Main Settings
TMA Trend Line
The central TMA provides a smooth representation of the underlying price trend and reduces short-term market noise.
Dynamic Volatility Bands
Three band levels are calculated above and below the TMA. The bands automatically adapt to changing price volatility, creating a dynamic market range.
Multi-Level Band Structure
The first band represents the primary volatility boundary, while the middle and outer bands extend progressively farther from the TMA. This makes it easier to identify stronger extensions in price movement.
Trend Strength Gradient
The TMA changes color according to the direction and strength of its movement relative to ATR-based volatility. Stronger TMA movement produces a stronger color transition, while weaker movement moves toward a neutral color.
Buy and Sell Signals
The indicator includes automatic reversal-style signals based on price extending beyond the primary volatility band and then forming an opposite-direction candle.
A Buy signal appears when the previous candle moves below the lower primary band and the current candle closes bullish.
A Sell signal appears when the previous candle moves above the upper primary band and the current candle closes bearish.
Adjustable Settings
TMA Period controls the smoothing and responsiveness of the central TMA.
Band Deviation controls the distance of the primary volatility bands from the TMA.
Price Source allows the calculation to use the selected price source.
Trend Threshold controls the sensitivity of the TMA trend-strength gradient.
TMA Volatility Bands is designed to provide a clean visual framework for analyzing trend direction, volatility expansion, price extensions, and potential reversal areas.
The signals should be used as part of a broader trading strategy and confirmed with price action, market structure, or other analysis tools.
지표

지표

Atr Volatility BandsAtr Volatility Bands
Atr Volatility Bands is an ATR-based trend and volatility indicator designed to provide a clear visual view of market direction, volatility, and changing price conditions.
The indicator combines a smoothed ATR Trail with an additional ATR-based outer band and a dynamic three-color gradient. The ATR Trail adapts to market volatility and changes direction when price moves through the calculated volatility levels.
The gradient continuously changes based on the position of price within the ATR bands, creating a smooth visual transition between different market conditions. The same gradient is also applied to the candles, making trend and momentum changes easier to recognize directly on the chart.
Main Settings
• Adaptive ATR Trail
Tracks the current market direction while adapting to changing volatility.
• ATR Outer Band
Provides additional volatility context around the main ATR Trail.
• Dynamic Color Gradient
Uses a smooth purple, blue, and cyan transition based on price position within the ATR range.
• Trend Shift Detection
Helps visually identify when the current market direction changes.
• Gradient Bar Coloring
Colors candles according to the current ATR-based market condition.
• Sensitivity
Adjusts the responsiveness of the ATR calculations.
• Gradient Smoothness
Controls how smoothly the color transitions respond to price changes.
Atr Volatility Bands is designed to keep the chart clean while providing an intuitive view of trend direction, volatility, and price movement.
Use the indicator together with your preferred market structure, price action, and confirmation tools. It is not intended to be used as a standalone buy or sell signal.
지표

지표

SMC Structure IdentifierThis indicator uses SMC (ICT) concept for market structure identification.
It maps market structure using confirmed swing highs and swing lows, then builds structural logic from those points. It is designed to separate raw swings from meaningful structural swings, label the structure, and optionally display Break of Structure (BOS) events.
The swing logic uses a configurable lookback and forward confirmation window. Once raw swings are detected, consecutive highs or lows are compared so that only the most structurally relevant point is kept. Overwritten swings can optionally be shown separately, making it easier to understand how structure is being filtered.
Features:
• Confirmed swing high and swing low detection
• Structural swing filtering with overwritten swing handling
• Optional HH, LH, HL, and LL labels
• Optional bullish and bearish BOS detection
• BOS based on protected highs/lows and candle close
• Customizable swing marker size and colors
• Customizable BOS colors, line width, and label placement
• Ability to show or hide ignored/overwritten swings
Logic:
A structural swing is confirmed when an opposite swing appears. If multiple swings of the same type occur before an opposite swing confirms structure, only the most extreme swing is kept:
• Higher highs replace prior unconfirmed highs
• Lower lows replace prior unconfirmed lows
Trend and BOS logic are based on protected highs and lows:
• In a bearish trend, a close above the protected high marks a bullish BOS
• In a bullish trend, a close below the protected low marks a bearish BOS
This tool is intended for traders who use SMC for market structure, swing analysis, and break-of-structure concepts in their discretionary analysis.
Note:
1. Market Structure inside SMC is subjective; this indicator is an attempt to implement it into the code. Regulate Lookforward and Lookback variables to find the most suitable structure for you.
2. This indicator does not provide buy or sell signals. It is a visual structure-mapping tool and should be used together with your own trading plan, risk management, and additional analysis. 지표

Parabolic SAR Constraint Kinematics & Run GeometryOverview
Parabolic SAR Constraint Kinematics & Run Geometry studies how a continuing Parabolic SAR step is formed and how the surrounding run develops. It keeps TradingView's ta.sar() as the plotted SAR series and adds measurements of the run's Extreme Point, remaining Arc, acceleration-factor progression, and prior-two-bar price constraint.
The central distinction is between the free parabolic candidate and the candidate after the two-bar constraint. The script measures how much movement the constraint removes, how much movement remains, and how frequently material constraints occur within a fully observed run. A synchronization check compares the reconstructed candidate with ta.sar() before exposing the related constraint percentages.
The PSAR formula itself is standard. The added functionality is the coordinated measurement of its step mechanics, run-relative geometry, observation completeness, and bounded run history. The indicator does not adapt the PSAR formula, filter its side changes, optimize parameters, or rank trading opportunities.
Chart layers
The default display contains the canonical SAR dots, an Extreme Point trace, a translucent SAR-to-Extreme-Point Arc, small side-change markers, yellow material-constraint halos, and a compact upper-right panel.
Cyan and pink distinguish the tracked SAR-below and SAR-above run states. Green and amber distinguish the corresponding Extreme Point traces. Colors and visibility are configurable. These colors describe tracked states; they do not prescribe an action.
The Extreme Point is the highest observed high in a SAR-below run or the lowest observed low in a SAR-above run. It is updated according to the selected confirmation setting.
Optional layers include the free candidate point, the constraint bridge, an Arc midline, the current run's origin line, descriptive event markers, and completed-run summaries. These additional layers are disabled by default to avoid crowding the chart. The bridge compares the free candidate with the plotted SAR on materially constrained bars after the synchronization check; the reconstructed guarded candidate can differ from the plotted SAR by the permitted tolerance.
Reading the compact panel
The default layout remains a three-row grid. Abbreviated captions and reduced spacing save horizontal space without changing the measurements or their numeric precision.
STATE: BELOW or ABOVE means the tracked SAR side relative to price. FULL means the run's beginning was observed; PARTIAL means tracking began during an existing run. TIGHT identifies the contracted-Arc state. SYNTHETIC identifies a non-standard chart.
RUN: An example such as "11b ✳3 ∥4" means 11 bars in the tracked run, three Extreme Point updates, and four bars since the last Extreme Point update. The star identifies updates; the parallel strokes identify elapsed bars without an update.
ARC: Current normalized SAR-to-Extreme-Point distance, followed by Arc Retention.
STEP: Absolute one-bar SAR movement, followed by that movement as a percentage of the remaining Arc. This percentage is a geometric ratio, not a return or probability; it is not capped at 100%.
MOTION: Mechanical state, TX percentage, observed AF, and synchronization symbol. TX means Step Transmission. For example, "FREE TX100.0% AF0.08" indicates an observed FREE state, transmission of 100.0% of the reconstructed free step, and an observed AF of 0.08.
CODE: The four-axis run signature and completed-run count. CODE is the compact label for the run signature, not a trading signal. The suffix n20 means 20 completed full runs are retained for the duration/brief-run history. When the signature display is disabled, HIST shows the sample count, average duration in bars, and brief-run share instead.
Hovering over the cells reveals definitions, the processing scope, reconstruction error, constraint percentages, recent recorded signature states, and rolling history summaries. The panel shows the latest execution state; moving the cursor over an older bar does not make the panel display that bar's historical state. Extended Data Window output can be enabled for historical numeric inspection inside the research window.
Arc and distance units
Arc = abs(Current SAR - Tracked Extreme Point)
Arc Retention = 100 x Current Arc / Widest Arc recorded in the same tracked run
A lower retention value means the current Arc is narrower relative to that run's widest recorded Arc. It does not establish that a price reversal is approaching.
Distance units are selectable: ATR at run start, percent from run origin, minimum ticks, or raw price. The ATR-style normalizer smooths true range using RMA, SMA, EMA, or WMA. The range used for normalization is captured when tracking of the run begins, and percent distances use the absolute close captured as the run origin. In a PARTIAL run, these references belong to the first tracked bar, not the unknown actual beginning of the run.
Normalization and optional marker spacing do not alter the canonical SAR calculation.
Tight Arc and re-expansion
After the configured minimum run age, TIGHT is entered when Arc Retention is at or below the selected contraction threshold. Defaults are five bars and 35% retention.
The contracted state is released only after a new Extreme Point appears and retention reaches the contraction threshold plus the selected hysteresis, capped at 100%. Default hysteresis is 20 percentage points, giving a default release level of 55%.
The two thresholds reduce repeated state changes near a single boundary. TIGHT is a latched run state, so a retention value above the entry threshold does not by itself end that state. Neither contraction nor re-expansion forecasts a future market event.
Observed acceleration factor
Observed AF = min(Starting AF + Recorded EP Updates x AF Increment, Effective Maximum AF)
AF Progress = 100 x (Observed AF - Starting AF) / (Effective Maximum AF - Starting AF)
Defaults are 0.02 for the starting factor, 0.02 for the increment, and 0.20 for the maximum. If the entered maximum is below the starting factor, the effective maximum is raised to the starting factor. When both are equal, AF progress is represented as 100%.
The observed AF is reconstructed from the tracked Extreme Point sequence. It is not an independently exposed internal AF series supplied by ta.sar(). Partial-run values do not recover unobserved pre-window updates.
Free candidate and two-bar constraint
The reconstruction is attempted on eligible continuing bars of FULL runs, with the required prior values available and the current raw SAR side agreeing with the tracked run.
Free Candidate = Previous SAR + Previous Observed AF x (Previous Tracked EP - Previous SAR)
For a SAR-below run:
Guarded Candidate = min(Free Candidate, Previous Low, Low Two Bars Ago)
For a SAR-above run:
Guarded Candidate = max(Free Candidate, Previous High, High Two Bars Ago)
The resulting guarded candidate is compared with the current ta.sar() value. The default permitted difference is two minimum ticks; the tolerance is adjustable and includes a small numerical floor.
If the reconstruction is outside tolerance, the state becomes CHECK and Constraint Load and TX are unavailable. If the bar is not eligible, the state is INIT. A successful check establishes agreement within the selected tolerance on that bar, not exact recovery of every internal PSAR state or independent validation of the model.
Constraint Load and Step Transmission
Free Step = abs(Free Candidate - Previous SAR)
Removed Distance = abs(Free Candidate - Guarded Candidate)
Constraint Load = 100 x Removed Distance / Free Step
TX measures the guarded directional step as a percentage of the free directional step. Direction here means the mechanical direction of the tracked PSAR run, not a proposed trade.
TX = 100 x Guarded Directional Step / Free Directional Step
The displayed constraint percentages require synchronization and a valid positive denominator. They are bounded between 0% and 100%. In ordinary eligible cases, they describe the removed and transmitted portions of the reconstructed step. A zero or invalid denominator produces unavailable data rather than an invented percentage.
A measurable constraint requires both a removed distance of at least one quarter of a minimum tick and Constraint Load of at least 1%. A material constraint additionally requires the user-selected materiality threshold, which defaults to 12.5%.
MOTION states and symbols
INIT: The current bar is not eligible for the continuing-run reconstruction, including during partial tracking or at the start of a run.
CHECK: The guarded candidate differs from ta.sar() by more than the permitted tolerance.
FREE: The measurable-constraint conditions are not satisfied. This includes effects below the residual or load thresholds, not necessarily a mathematically exact zero effect.
TRACE: A measurable constraint exists, but its load is below the materiality threshold.
BRAKE: A material constraint exists and the guarded directional step remains greater than one quarter of a minimum tick.
PINNED: A material constraint exists and the guarded directional step is at or below that quarter-tick threshold.
The check mark means agreement within tolerance; the exclamation mark means outside tolerance; the ellipsis means not yet eligible. None is a confidence rating or market recommendation.
Yellow halos and run occupancy
A yellow halo identifies a bar meeting the synchronized material-constraint conditions. It marks a mechanical effect on the PSAR step, not an entry, exit, reversal prediction, target, or stop.
Run Constraint Occupancy = 100 x Materially Constrained Counted Bars / Synchronized Counted Bars
The counts follow the selected confirmation setting and exclude the side-change bar. Under the default setting, they are committed at bar close. The percentage measures how frequently the guardrail materially affected the eligible observations in that run, not the probability of a future outcome.
Run signature: A, F, P, C
An example code is A3·F2·P2·C0.
A is Arc Retention.
F is observed AF Progress.
P is Extreme-Point Pause Share: 100 x Bars Since Latest EP / (Run Age - 1), with zero used at age one.
C is current Constraint Load.
A, F, and P use four fixed percentage bands:
1: below 25%
2: 25% to below 50%
3: 50% to below 75%
4: 75% or higher
C uses:
C0: valid load below 1%
C1: 1% to below 25%
C2: 25% to below 50%
C3: 50% to below 75%
C4: 75% or higher
C-: Constraint Load is unavailable
C- can occur because the bar is ineligible, synchronization fails, or the denominator is invalid. When no complete signature can be formed, placeholder bands are shown. C is based on the numeric load, whereas MOTION also applies the quarter-tick residual test and the selected materiality threshold; the two displays need not change together.
A3·F2·P2·C0 therefore describes retention from 50% to below 75%, AF progress from 25% to below 50%, pause share from 25% to below 50%, and valid constraint load below 1%.
These are fixed ranges, not sample quartiles, learned regimes, rankings, or probabilities. The code helps compare similarly structured observations without implying similar future outcomes. Up to three recent distinct synchronized signature observations are available in the tooltip; this is not an automatic historical pattern search.
FULL, PARTIAL, and completed-run history
A FULL run begins at an observed SAR side change inside the research window. A PARTIAL run was already underway when tracking began. Only completed FULL runs enter the rolling history.
The memory setting defaults to 20 and accepts 3 to 100 runs. Duration and brief-run history retain the latest completed full runs. The brief threshold defaults to four bars or fewer.
Constraint-occupancy history accepts only completed full runs with a valid occupancy value. Runs without that value are skipped for this particular average, so its sample can differ from the duration/brief-run sample.
Optional completed-run labels also show EP updates, time at the maximum observed AF stage, constraint occupancy, and tight-Arc episode count. These summaries describe completed observations, not simulated transactions.
Research window and runtime
Recent bars is the default scope. The custom research window defaults to 3,000 bars and can be set from 500 to 50,000. All available bars removes that custom limit, subject to the history available on the chart.
The boundary is fixed when the script loads or recalculates. Subsequent realtime bars are included; the window is not a continuously sliding hard cap. Reloading or changing an input rebuilds it.
Before the boundary, canonical ta.sar() and the selected normalizer still evaluate to provide continuous underlying series. The window limits custom run analysis, reconstruction, history, events, and plotted research output; it is not Pine's native calc_bars_count restriction and does not prevent every underlying calculation from running on earlier bars.
Larger windows and All available bars can increase runtime. Use a smaller window if a runtime warning occurs. This is a research and resource setting, not an access restriction.
Controls and alerts
Users can change the research scope, PSAR factors, confirmation behavior, normalization, history length, constraint threshold, synchronization tolerance, visual layers, marker limits, panel layout and position, right-edge clearance, text size, bold formatting, and colors.
Alerts are disabled by default. Available conditions report a SAR side change, Arc contraction, Arc re-expansion, the onset of a material constraint, an age milestone, the observed AF maximum, an EP pause, or completion of a brief full run. They do not specify trading actions.
Extended Data Window output is also disabled by default. Enabling it exposes additional numeric series without changing the underlying measurement rules.
Suggested research workflow
Start on a standard candlestick or bar chart with default settings. Identify the SAR dots, Extreme Point trace, and Arc before reading the panel. Check FULL or PARTIAL, inspect ARC and STEP, and then use MOTION and its tooltip to examine the reconstructed constraint.
For a worked mechanical example, a free directional step of ten ticks reduced to six ticks has a four-tick removed distance: Constraint Load is 40% and TX is 60%, provided the guarded candidate synchronizes and the other eligibility conditions hold. This example explains the arithmetic; it does not describe a trading result.
Use CODE to compare descriptive states, or enable the candidate point and bridge for closer mechanical inspection. Keep the symbol, timeframe, PSAR factors, distance unit, and observation policy consistent when comparing records.
Realtime behavior and limitations
Confirm state changes at bar close is enabled by default. Run changes, EP updates, descriptive event records, and history counters are committed under that setting. The active ta.sar() point, current geometry, constraint calculations, halos, and current displayed signature can nevertheless change before the bar closes. The panel can retain a committed run state while live geometric values update. Disabling confirmation allows more provisional intrabar behavior.
The script is not described as completely non-repainting. Use closed bars for reproducible comparisons.
Non-standard chart types supply synthetic or transformed OHLC. The panel marks them as SYNTHETIC; their measurements describe that generated chart series, not standard market bars.
PSAR can change sides frequently in irregular or sideways markets. A synchronized reconstruction is only a numerical consistency check within tolerance. Changing the available history, research boundary, settings, or timeframe can change the tracked run statistics. Extreme parameter values may produce more unavailable or CHECK observations. Defaults are general research settings, not optimized values.
This open-source indicator is a descriptive visualization and numerical research tool. It makes no claims about forecast accuracy, trading performance, or a predictive edge, and it does not provide individualized recommendations or trading instructions. 지표

Market Regime EngineMarket Regime Engine
Market Regime Engine is a multi-layer market-state and historical research framework designed to identify what the market is doing, where it is in the broader market cycle, how mature the current regime is, and how similar historical environments have behaved afterward.
Rather than defining trend from a single indicator, the engine processes price, volume, volatility, momentum, and market structure through several independent layers and combines them into a standardized:
Regime Score: -100 → +100
The architecture is:
Price + Volume → Fast Engine → Structure Engine → Context Engine → Regime Score → Regime + Stage → Regime Age → Historical Cohort
The objective is to remain responsive to genuine changes in market behavior without allowing a single moving-average cross, high-volume candle, or isolated structural signal to completely change the market classification.
Fast Engine
The Fast Engine is the most responsive part of the model and receives substantial weight in the final score.
It analyzes:
20 SMA location — whether price is above or below its short-term trend mean.
20 SMA slope — whether the trend itself is rising, falling, or flattening.
Displacement — candle-body expansion normalized by ATR.
Relative Volume (RVOL) — determines whether directional movement is being accompanied by meaningful participation.
The combination of price relative to the 20 SMA, SMA slope, displacement, and volume provides the first indication that market behavior is changing.
ATR normalization allows these measurements to adapt across instruments and volatility regimes.
Structure Engine
The Structure Engine asks whether price structure confirms what the Fast Engine is detecting.
It tracks:
Swing highs
Swing lows
Higher highs
Higher lows
Lower highs
Lower lows
Break of Structure (BOS)
Change of Character (CHoCH)
A BOS identifies a meaningful break of established swing structure and receives one of the largest individual weights in the model.
A CHoCH identifies a potential change in the prevailing structural direction and is particularly useful when an established trend begins deteriorating.
This creates an important distinction between simply moving above or below the 20 SMA and actually changing market structure.
Context Engine
The Context Engine determines whether the surrounding environment supports the signals coming from price and structure.
It incorporates:
ATR — normalizes price movement and allows the engine to compare displacement and SMA distance across changing volatility environments.
ADX/DMI — measures trend strength and directional confirmation. ADX itself does not determine whether the market is bullish or bearish; it strengthens an already established directional condition.
Fair Value Gaps (FVG) — identify recent price imbalances that provide additional directional context.
Order Blocks — identify recent opposing candles preceding meaningful displacement.
FVG and Order Block information intentionally receive relatively small weights because they are treated as contextual evidence rather than primary directional signals.
Regime Score
All of these components feed into a single standardized score:
-100 ←──────── 0 ────────→ +100
Negative values represent increasing bearish alignment, while positive values represent increasing bullish alignment.
The full weighting framework is:
Component Maximum Weight
Price vs. 20 SMA ±15
20 SMA Slope ±15
Relative Volume ±10
Displacement ±10
Swing Structure ±10
Break of Structure ±20
CHoCH ±10
ADX/DMI ±5
FVG ±2.5
Order Block ±2.5
Maximum Score ±100
This hierarchy is intentional.
The engine places greater importance on price, the 20 SMA, volume, displacement and structural breaks, while FVGs and Order Blocks act as secondary confirmation.
Regime Classification
The Regime Score is translated into five market states:
Strong Bull — broad bullish alignment with strong directional confirmation.
Bull — bullish evidence dominates, but the environment is not strong enough to qualify as Strong Bull.
Range / Neutral — directional evidence is weak, balanced, or conflicting.
Bear — bearish evidence dominates.
Strong Bear — broad bearish alignment with strong downside confirmation.
A confirmation mechanism prevents every short-lived fluctuation from changing the official regime.
For example, price briefly crossing below a rising 20 SMA does not automatically terminate a Bull regime. Other components must deteriorate sufficiently for the aggregate score to confirm a meaningful transition.
This provides the responsiveness of a fast indicator without making the classification excessively sensitive to noise.
Regime vs. Market Stage
One of the most important features of the full engine is that Regime and Stage are separate calculations.
Regime = tactical market condition
Regime answers:
What is the market doing right now?
It is relatively fast and responsive.
Stage = structural market cycle
Stage answers:
Where is the market within the broader trend cycle?
The model uses four stages:
Stage 1 — Base / Accumulation
Typically characterized by flattening trend, weaker ADX, overlapping price structure, and stabilization following a bearish environment.
Stage 2 — Markup
Characterized by a rising 20 SMA, bullish structure, price above the trend mean, structural upside progression and strengthening trend conditions.
Stage 3 — Distribution
Represents deterioration following a bullish environment. The 20 SMA may flatten, bullish structure begins failing, lower highs may develop, and bearish CHoCH can signal that the previous advance is losing control.
Stage 4 — Markdown
Characterized by a falling 20 SMA, bearish structure, price below the trend mean and established downside progression.
Because Stage and Regime are independent, the model can recognize transitions such as:
Strong Bull / Stage 2 → Bull / Stage 2 → Range / Stage 2 → Range / Stage 3 → Bear / Stage 3 → Bear / Stage 4
This provides considerably more information than simply labeling every bar "uptrend" or "downtrend."
Regime Age
Once a confirmed regime begins, the engine counts how many bars that regime has survived.
This produces Regime Age.
For example:
Bull — Age 4
Bull — Age 8
Bull — Age 13
Bull — Age 21
The numbers 8, 13 and 21 do not determine the regime or Stage.
They are strictly research checkpoints.
A market does not become more bullish because it reaches Age 13, nor does it become bearish because it reaches Age 21.
Instead, regime age allows the model to investigate whether the statistical behavior of a market changes as a regime matures.
Historical Cohort Engine
The full Market Regime Engine extends beyond classification by maintaining a historical cohort research layer.
At the designated regime-age checkpoints:
8 bars
13 bars
21 bars
the engine studies subsequent market behavior over:
5 bars
10 bars
20 bars
The research layer can evaluate characteristics such as:
Continuation probability
Average forward return
Historical sample size
Direction-adjusted performance
The larger framework can also be extended to measure:
Median return
Maximum Favorable Excursion (MFE)
Maximum Adverse Excursion (MAE)
Regime survival rate
Regime failure rate
Probability of a new high or low
Probability of transitioning into another regime
This creates a distinction between classification and expectancy.
The Regime Engine tells you:
What environment are we in?
The Historical Cohort Engine asks:
What has historically happened after environments like this?
Importantly, historical cohort statistics do not feed back into the Regime Score. They remain an independent research layer.
Distance From the 20 SMA
The full engine also measures price's distance from its 20 SMA in ATR units:
(Price − 20 SMA) / ATR
This provides information that a simple Bull/Bear classification cannot.
For example, two markets might both have a +55 Bull Regime Score, but one could be:
0.30 ATR above its 20 SMA
while the other is:
2.20 ATR above its 20 SMA.
The directional environment may be similar, but the second market is substantially more extended.
SMA distance is therefore treated primarily as location information rather than additional directional points, helping avoid double-counting the same trend information.
Full Dashboard
The larger version exposes the internal workings of the engine rather than displaying only the final regime.
The dashboard reports:
Current Regime
Regime Score
Market Stage
Regime Age
Price vs. 20 SMA
SMA slope
RVOL
Displacement
BOS
CHoCH
ADX
FVG
Order Block context
ATR-normalized SMA distance
5-bar historical cohort results
10-bar historical cohort results
20-bar historical cohort results
This makes the indicator transparent: instead of simply being told that the market is Bullish, the user can see why the model reached that conclusion.
Example
Suppose the dashboard reports:
Regime: BULL
Score: +32.5
Stage: Stage 2 — Markup
Age: 9 bars
with:
Price above 20 SMA: +15
Rising SMA: +15
RVOL: 0
Displacement: 0
BOS: 0
CHoCH: 0
ADX: 0
Bullish FVG: +2.5
The result is:
+15 + 15 + 2.5 = +32.5
The correct interpretation is not simply "the market is going higher."
Instead, the engine is saying:
The market remains structurally bullish and in a Stage-2 environment, but immediate momentum, volume and structural-break confirmation are currently limited.
That distinction is the purpose of the model.
Philosophy of the Indicator
Market Regime Engine is built around the idea that:
Regime ≠ Trade Entry
A bullish regime does not mean every bar should be bought, just as a bearish regime does not mean every bar should be sold.
The engine is designed to establish environment and directional context.
Execution can then be handled separately using the trader's preferred methodology—price location, pullbacks, candlestick confirmation, support/resistance, volume profile, or other entry criteria.
The framework therefore separates three different questions:
Regime:
What is the market doing?
Stage:
Where are we in the broader cycle?
Historical Cohort:
What happened historically after comparable conditions?
Together, these create a market-state framework that attempts to remain fast enough to recognize meaningful change, structured enough to resist noise, and transparent enough to understand exactly why the market received its current classification.
For research and educational purposes only. Market Regime Engine does not predict future prices and is not financial advice. 지표

Volume Profile Breakout Continuation
What this is - and is not. This is one state machine, not separate tools stacked on a chart. A range-compression detector, a volume profile, a higher-timeframe filter, a pullback tracker and a trade-management layer are chained so that each stage only exists because the previous one fired. It is not a volume profile indicator with signals bolted on, and it is not a breakout indicator with a profile drawn next to it.
Why the parts are inseparable. The profile is built only over the bars of a detected accumulation range - remove the range detector and there is nothing to profile. The breakout is defined as a close outside that same range - remove the profile and the pullback has no POC to return to. The trigger is a close back through the POC in the breakout direction - remove the breakout and the trigger has no direction. Take any stage away and the remaining logic has nothing to act on.
Mechanism
1. Accumulation. When the range of the last N bars is at or under k × ATR, an accumulation box opens on that bar and grows while price stays inside. It is drawn as it forms, not in hindsight. A box that expands past the abandon threshold, or runs too long, is dropped and faded.
2. Profile. A small volume-at-price histogram is built inside the box from the accumulation bars only and refreshed each bar. Each bar's volume is spread evenly across the rows its high-low spans. POC is the heaviest row; the value area is expanded outward from the POC to the chosen percentage.
3. Breakout. A confirmed close outside the box. With the higher-timeframe filter on, long breakouts require the prior completed HTF close above its EMA and shorts below. At this moment POC, VAL and VAH are frozen and a second box opens to frame the pullback.
4. Pullback. Price comes back into the POC zone (a tolerance expressed as a percentage of the range height). The setup is invalidated by a close through the far edge of the value area or by a wait timeout.
5. Trigger. A confirmed close back through the POC in the breakout direction marks the entry.
What you see
- Purple accumulation boxes with the profile tucked inside (heatmap or single-hue mode, POC row in gold).
- A teal pullback box from the breakout bar to the trigger bar, with the POC line running through it and a label on the bar that touches the zone.
- Entry labels with entry, TP and SL; TP and SL boxes that extend while the trade is open and truncate at the exit; exit labels showing the percentage actually taken. Past trades stay on the chart.
- A developing session profile floated off the last bar, plus finished day profiles painted in place at each rollover and never redrawn.
- A monospace dashboard: stage, HTF bias, accumulation range, setup and day POC, day value area, pullback status, position, TP/SL, running record, readiness.
Settings
- Accumulation: range lookback, compression multiple, minimum and maximum bars, abandon multiple, ATR length.
- Setup profile: rows, value-area percentage, histogram width, past-setup fade and count.
- Session profile: rows, width, offset, side, color mode, past profiles to keep and their width and transparency.
- HTF bias: on/off, timeframe (auto steps up one tier from the chart), EMA length.
- Pullback: POC zone half-width, maximum wait.
- Trade management: fixed-percent or ATR-multiple TP/SL, max bars in trade, entry cooldown, optional post-exit cooldowns by exit type, past-box fade.
- Session: end-of-day flatten hour and minute (New York).
- Webhook: optional JSON payload on entry and exit with a strategy id and quantity.
How to use. Start with the default settings on the timeframe you normally trade and watch how often boxes form and how often breakouts fail before the pullback. Tighten the compression multiple for fewer, cleaner ranges; widen the POC zone if pullbacks are missing the level by a hair. The trade-management layer is a study aid: the labels and boxes show what the mechanical rules would have done, so you can judge the logic against your own read of the chart.
The defaults are a starting point for one instrument, not an optimized or recommended configuration, not intended to suggest any particular outcome.
Non-repainting. Every state transition, entry and time-based exit is evaluated on confirmed bars only. The higher-timeframe values are requested with lookahead off and reference the previous completed HTF bar, so history and live behave the same. Finished day profiles are painted once at the rollover and never redrawn. TP and SL are checked against the bar's high and low. The profile uses chart-timeframe bar volume, not tick data, so it is an approximation, as every profile built in Pine is; instruments without volume fall back to a time-at-price count. 지표
