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

Global Net Liquidity - (Giovanni Fork)Hello traders. This plots the combined balance sheets of the Fed, ECB, BoJ, PBoC and Bank of England, converted to dollars, with the US Treasury General Account and the Fed's reverse repo facility subtracted.
There are already a lot of global liquidity scripts on here, so I want to be clear about what this one does differently rather than just adding another overlay to the pile. Three things.
First, this is a net measure.
Gross central bank assets tell you how much money has been created. They do not tell you how much of it is actually available, because some of it gets created and then taken straight back out of circulation. Money sitting in the Treasury's account at the Fed is not in the system. Nor is cash parked overnight in the reverse repo facility. Subtracting those gives you what is genuinely out there, and that is what net means here. At the time of writing it is 0.97tn in the TGA coming off a gross of 22.37tn.
It is also worth saying that this is built from central bank balance sheets rather than M2. Those are related but they are not the same measure, so if you are comparing this against something else, check which one you are looking at.
Units are worth paying attention to when you combine feeds like this. The underlying sources do not agree with each other: FRED publishes the Fed balance sheet in millions and the reverse repo facility in billions, and the China balance sheet is reported in hundred millions of yuan. TradingView appears to normalise all of them to absolute units before serving them, which is why every scale factor in this script is 1.
I would still rather you checked than took my word for it. Every series has its own visible scale factor and the table prints each component in USD trillions, so you can compare the numbers against what you know the Fed and the ECB are actually running. If a row looks wrong by orders of magnitude, that series' scale input is wrong and you can correct it in the settings without touching the code.
Second, China is measured properly.
The PBoC balance sheet is a poor gauge of Chinese liquidity and most aggregates include it anyway. Its growth up to 2014 was foreign exchange accumulation rather than stimulus, so the series has meant different things in different decades. More importantly, the PBoC's main easing tool is the reserve requirement ratio, and that is balance sheet neutral. Cutting the RRR reclassifies required reserves as excess reserves, releasing roughly 1 trillion yuan per 50bp, while total assets do not move at all. The biggest thing the PBoC does is invisible to a balance sheet aggregate.
The default here subtracts required reserves, estimated as the reserve ratio applied to M2 as a deposit proxy, so an RRR cut registers as the easing it actually is. You can switch back to the plain balance sheet or to the commercial bank balance sheet in the settings. It is an approximation because China's RRR is tiered across large, small and rural banks and the headline rate only covers the large ones, but it responds to the right events.
Third, and this is the part I think adds most, the currency effect is separated out.
Every aggregate that converts foreign balance sheets at spot has dollar moves baked into it. A stronger dollar shrinks the line even when no central bank has done anything, and that gets reported as tightening.
The purple line is the same aggregate chain linked at constant currency. Each period's balance sheet change is converted at that period's own opening rate and accumulated, so it shows what the balance sheets did without the currency. The shaded gap between the two lines is the currency effect, and the table gives it as a number. Since January 2016 it is 1.56tn, meaning that much of the apparent decline in global liquidity was dollar strength rather than central bank action.
The BoJ is the clearest example. Its assets have grown in yen over recent years while its reported dollar contribution has fallen sharply. A gross liquidity chart reads that as the BoJ tightening. It didn't tighten, the yen moved.
A few things to be aware of before you use it.
The chain start date is January 2016 by default and it matters. The constant currency line is accumulated rather than measured, so it seeds at that date and the two lines are identical there by construction. The currency figure is always cumulative since the start date, so 1.56tn means since January 2016, not in absolute terms. Set the date later if you find a component with no data at the start.
The TGA and RRP are US specific drains applied to a global gross, which is slightly inconsistent. Everybody does it, few say so, so I am saying so.
The underlying data updates weekly at best and the PBoC monthly, so use this on daily or higher. Intraday just repeats the last print.
I built this because I wanted to know how much of the last three years of liquidity contraction was real and how much was the dollar. If it is useful to you, say so, and if you think I have got something wrong let me know. 指標

Delta Trend Delta Trend is a momentum and directional-trend indicator designed to measure the relative movement of price between the open and close of each candle. It converts the percentage change within each candle into a smoothed Delta Line, allowing traders to identify whether short-term price momentum is strengthening or weakening.
The indicator uses the relationship between the candle's Open and Close to calculate its raw directional movement. This value is then smoothed using a Weighted Moving Average (WMA) and multiplied by an adjustable Delta Adjust factor. The resulting Delta value provides a normalized representation of short-term price momentum.
How the Delta is calculated
The raw calculation is:
(Close − Open) / (Close + Open)
This measures the directional movement of the current candle relative to its overall price level.
The raw value is then smoothed using the selected Delta Smooth period and multiplied by the Delta Adjust setting:
Delta = WMA(Raw, Smooth) × 100 × Adjust
A higher Delta indicates stronger positive price momentum, while a negative Delta indicates bearish price momentum.
Delta Trend
The indicator compares the current Delta value with the previous Delta value.
Rising Delta → momentum is increasing or strengthening.
Falling Delta → momentum is decreasing or weakening.
The Delta Line is displayed in:
White when Delta is rising.
Red when Delta is falling.
This allows the trader to see changes in momentum visually without relying solely on whether price itself is moving up or down.
Zero Line and Thresholds
The indicator includes several reference levels:
0 — the primary bullish/bearish dividing line.
0.3 — an early positive-momentum threshold.
3 — a stronger positive-momentum threshold.
The area behind the indicator is shaded blue whenever Delta is zero or above, providing a quick visual indication that momentum is on the positive side of the zero line.
Delta Table
A table in the upper-right corner displays the current Delta value.
The table changes its background according to the strength of Delta:
Delta ≥ 5 → strong positive momentum.
Delta > 0 → positive momentum.
Delta ≤ 0 → negative momentum.
This gives the trader an immediate numerical reading of current momentum.
Alerts
The indicator contains alerts for both the direction and strength of Delta.
Trend alerts
Buy — Delta Line Rise
Triggered when Delta is rising compared with the previous candle.
Sell — Delta Line Fall
Triggered when Delta is falling compared with the previous candle.
Delta-level alerts
The indicator also provides bullish/bearish conditions around:
10
5
3
0.3
0
These thresholds allow traders to monitor different levels of momentum strength.
For example, a Delta above 5 represents considerably stronger positive momentum than simply being above zero.
Overall Interpretation
The Delta Trend indicator can be viewed as a short-term momentum and momentum-direction tool.
Its readings can be interpreted broadly as:
Positive Delta + Rising Delta
→ Positive momentum is strengthening.
Positive Delta + Falling Delta
→ Momentum remains positive but is weakening.
Negative Delta + Falling Delta
→ Negative momentum is strengthening.
Negative Delta + Rising Delta
→ Bearish momentum is weakening and a potential momentum transition may be developing.
The combination of the Delta level and the direction of the Delta Line is therefore more informative than either one by itself.
Example
If the indicator shows:
Delta = +6.2x
Delta Line = Rising
this suggests that the current smoothed price momentum is strongly positive and is increasing.
If it subsequently changes to:
Delta = +4.1x
Delta Line = Falling
the momentum is still positive, but its strength is declining.
If Delta eventually moves below 0, the indicator has transitioned into negative momentum.
Important Limitation
Delta Trend should not be interpreted as true order-flow or buy/sell volume delta.
Unlike an exchange-provided bid/ask delta, this indicator does not measure actual buyer-initiated versus seller-initiated trades. It derives its value entirely from the relationship between open and close prices.
Therefore, it is more accurately described as a smoothed price-momentum/directional-pressure indicator, rather than a true volume-delta indicator.
In simple terms
Delta Trend answers two questions:
1. Is price momentum positive or negative?
and
2. Is that momentum getting stronger or weaker?
The Delta value tells you the approximate strength of the momentum, while the rising/falling state of the Delta Line tells you whether that momentum is increasing or decreasing.
指標

指標

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. 指標

指標

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. 指標

指標

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. 指標

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. 指標

STP Trade Idea AnalysisThe STP Trade Idea Analysis Indicator is a conditional price-path projection engine designed to help traders evaluate potential market direction, important reaction levels, and alternative price scenarios directly on the chart.
Rather than relying on a single technical signal, the indicator combines multiple forms of market structure and price action analysis to provide a clearer view of where price may move next. The system evaluates Elliott-wave structure, Fibonacci levels, Fair Value Gaps (FVGs), Supply and Demand, trend information, and technical confluence to identify meaningful areas of support, resistance, and potential price reactions.
A key feature is the Primary and Secondary Elliott price paths. The Primary path represents the currently favored scenario based on the available market structure, while the Secondary path provides an alternative if price action develops differently. These paths are conditional projections rather than fixed predictions and can adjust as new market information becomes available.
Key Features
Conditional Price-Path Projection – Displays Primary and Secondary Elliott-style scenarios based on current market structure.
Primary Elliott Path – Shows the currently favored 1–5 impulse and A–B–C corrective price path.
Secondary Elliott Path – Displays an alternative scenario if market structure begins to shift.
Fibonacci Levels – R1–R4 and S1–S4 levels derived from the 6:00 AM ET anchor and prior regular-session trading range.
Bullish FVGs – Green shaded areas identify bullish price imbalances that may act as future reaction or support zones.
Bearish FVGs – Red shaded areas identify bearish price imbalances that may act as future reaction or resistance zones.
Supply and Demand Zones – Identify areas where buying or selling pressure may influence future price action.
Confluence Support and Resistance – Highlights important decision zones where multiple independent technical levels cluster.
21 and 50 EMAs – Provide additional visual context for trend direction and price structure.
How to Use the Indicator
For the clearest analysis, I recommend using the indicator primarily on the 1-hour and Daily charts.
Start with the Daily chart to understand the larger market structure, longer-term trend, major support and resistance areas, and the broader Primary and Secondary price-path scenarios. This provides the higher-timeframe context for the trade.
Next, move to the 1-hour chart for a more detailed view of the current setup. Use the 1-hour chart to evaluate developing Elliott structure, FVGs, Fibonacci levels, Supply and Demand, and nearby confluence zones.
Pay particular attention to the Primary Elliott path. This represents the currently favored scenario based on the market information available to the indicator. The Secondary Elliott path should not be ignored. It represents an alternative scenario and can help identify where your original trade thesis may be weakening or where market structure may be changing.
Use the Confluence Support and Resistance zones as potential decision areas. These zones are especially important because they represent areas where multiple independent technical factors cluster, rather than a level derived from a single calculation.
Bullish and Bearish FVG shaded zones can provide additional context. Watch how price behaves as it approaches or enters these imbalances. A reaction, rejection, continuation, or fill can provide useful information about whether the Primary price path remains intact.
The Fibonacci R1–R4 and S1–S4 levels provide additional reference points for potential price reactions and targets. They are established using the 6:00 AM ET anchor and prior regular-session range.
Suggested Workflow
1. Start with the Daily chart
Identify the broader trend, Elliott scenario, major zones, and directional context.
2. Move to the 1-hour chart
Evaluate the current price structure and more actionable Primary and Secondary paths.
3. Identify Confluence Support and Resistance
Look for areas where price may react, consolidate, reverse, or break through.
4. Review FVGs and Fibonacci Levels
Use these as additional confirmation and as potential areas for reaction.
5. Compare the Primary and Secondary paths
The Primary path represents the favored scenario. The Secondary path helps you prepare for an alternative outcome.
6. Let price action confirm the scenario
The projected path should be used as a roadmap, not as a guarantee. As price structure changes, the favored scenario can change as well.
Understanding the Projection
The goal of the indicator is not to predict an exact future price. Instead, it provides a structured framework for answering a more useful trading question:
If the current market structure continues, what is the most probable price path, and what alternative path should I be prepared for if conditions change?
Using the Daily chart for broader context and the 1-hour chart for trade analysis allows traders to evaluate both the larger market structure and the developing setup before making a trading decision.
Important: The STP Trade Idea Analysis Indicator is intended for technical analysis, education, and trade planning. Primary and Secondary price paths are conditional scenarios based on available market data and should not be interpreted as guaranteed future price movements.
指標

Gaussian Trend Filter | Lyro RS█ Overview
Gaussian Blur Trend Filter | Lyro RS is a trend-following overlay that runs price through a two-pass Gaussian blur to build a smoothed baseline, then classifies the market as bullish, bearish, or neutral from the slope of that baseline combined with price's position relative to it.
Where a single moving average reacts to every wiggle in price, this indicator convolves the same Gaussian kernel over price twice. The second pass smooths the already-smoothed series, producing a wider effective kernel with cleaner slope behaviour than a single-pass filter of the same length — fewer false slope changes, later noise-driven flips.
The result is a coloured baseline with a filled cloud back to price, flip labels marking the exact bar of a trend change, and recoloured candles so the whole chart reflects the current state at a glance.
█ How It Works
⚪ Gaussian Weighting
Each bar in the lookback window is weighted using a Gaussian curve rather than a flat or linear taper, so nearby bars dominate but older bars still contribute smoothly instead of dropping out abruptly.
w = math.exp(-(i * i) / (2.0 * sigma * sigma))
sigma is set as a percentage of Kernel Length via the Blur Width input, which shapes how quickly that weighting falls off.
⚪ Two-Pass Convolution
The first pass smooths raw close into an intermediate series. The second pass smooths that already-blurred series with the same kernel. Two convolved Gaussians combine into one wider, cleaner Gaussian — this is what removes the "noise of the noise" that a single pass leaves behind.
⚪ Trend Classification
The trend only flips to bullish when the baseline is rising and price closes above it, and only flips to bearish when the baseline is falling and price closes below it. Outside of those conditions the previous state is held, so the trend is sticky rather than flickering on ambiguous bars.
⚪ Visual Layer
The baseline is drawn as a stacked outer-glow / glow / core-line plot for a soft neon look, the raw first-pass line is kept visible but faint as a reference, the space between baseline and price is filled as a trend cloud, and candles are recoloured to match the active trend.
█ How to Use
⚪ Reading the Cloud
Cloud colour and fill direction show the current bias and how far price has stretched from the smoothed baseline.
⚪ Flip Labels
"Long" and "Short" labels mark the exact bar where trend state changed — useful as an entry trigger or as confirmation of a bias shift.
⚪ Tuning Kernel Length
Shorter length reacts faster and produces more flips; longer length is smoother but lags further behind price. Lower timeframes generally want shorter settings.
⚪ Tuning Blur Width
Controls how sharply the Gaussian weighting falls off relative to Kernel Length. Lower values keep more first-pass detail; higher values flatten the weighting curve for extra smoothness.
⚪ Alerts
Two built-in alert conditions — Bullish Flip and Bearish Flip — let you get notified the moment the trend state changes without watching the chart.
█ Settings
Kernel Length (5–100, default 30) — number of bars used in the Gaussian window for both blur passes.
Blur Width (0.1–1.0, step 0.05, default 0.35) — Gaussian sigma as a fraction of Kernel Length.
Custom Color Palette — Classic, Mystic (default), Accented, or Royal preset schemes.
Use Custom Palette — overrides the preset with your own Up/Down colours.
█ Important
The double Gaussian pass trades reactivity for a cleaner slope — the baseline will lag raw price more than a single-pass filter of the same length. Reduce Kernel Length on faster markets or lower timeframes if that lag feels excessive. Trend state is confirmed on bar close and does not repaint historically, though the state of the currently forming bar can still change until it closes.
This script is provided for educational and informational purposes only and does not constitute financial advice. Past performance of any strategy, indicator, or trading approach does not guarantee future results. 指標

McGinley Regime Ribbon [AxeAlgo]McGinley Regime Ribbon
----------------------------------------------------------------------
WHAT THIS SCRIPT DOES
----------------------------------------------------------------------
McGinley Regime Ribbon classifies the current market into one of four regimes, Trend Up, Trend Down, Ranging, or Volatile, on any chart, in real time, and colours a woven ribbon to match.
It is a context filter. It does not predict future price direction and it does not generate buy or sell signals. Its job is to tell you which kind of tool fits current conditions, so you can stop applying trend logic to a range or fade logic to a trend.
- Trend Up or Trend Down: trend and breakout tools are in context, and mean reversion tends to fight the move.
- Ranging: fades, support and resistance, and VWAP reversion tend to fit, while breakout tools tend to produce false starts.
- Volatile: wide, structureless movement with no dependable edge for either style. The label is a suggestion to stand aside.
----------------------------------------------------------------------
BACKGROUND, WHY A McGINLEY RIBBON AND NOT AN EMA RIBBON
----------------------------------------------------------------------
A standard EMA moves at one fixed speed set only by its length. That same speed applies in a dead calm range and in a fast trend. That fixed speed is the main reason an EMA ribbon whipsaws: in chop, price crosses back and forth through a band that cannot get out of the way, and the stacked or not stacked alignment reading that any ribbon based classifier depends on flickers along with it.
The McGinley Dynamic (John R. McGinley, CMT) handles this inside the formula rather than by adding more smoothing. Each line updates every bar with a term that measures how far price has pulled away from the line, raised to the fourth power. When price pulls away, the line speeds up to close the gap on its own. When price is riding the line, it settles back to roughly the pace of an EMA of the same length. The line is fast when it needs to be and calm when it needs to be, with no separate trend or chop switch attached on top.
The Ribbon Smoothness input is the published tuning constant that scales the baseline speed so it lines up with an EMA of the chosen length. Lower reacts faster, higher is steadier, and the adaptive behaviour happens on top of that either way.
----------------------------------------------------------------------
THE SHARED SPEED FACTOR
----------------------------------------------------------------------
The textbook McGinley formula lets each line compute its own deviation from price. In a five line ribbon that breaks the one property a ribbon needs, a stable relative order between the lines, because a slower line always lags price more than a faster one, so it sees a larger deviation and speeds up by a different amount on an ordinary bar.
In this script only the middle line computes its own deviation. The other four reuse that same speed factor. Relative responsiveness between any two lines is then a fixed ratio of their lengths, exactly like an EMA ribbon, while the ribbon as a whole still accelerates in trends and calms in chop as a group. The speed factor is bounded so one extreme bar cannot collapse every line at once. The five lengths keep Fibonacci spacing, 8, 13, 21, 34 and 55 by default, scaled from a single Ribbon Length input.
----------------------------------------------------------------------
HOW THE REGIME IS CLASSIFIED
----------------------------------------------------------------------
Three independent readings are combined on each bar.
1. Ribbon alignment. How many of the five lines are stacked in order, fast above slow for up or the reverse for down. A full stack is directional structure, a partial stack is not.
2. ADX, taken from the Directional Movement Index. Above the trending threshold points to a real directional push, below the chop threshold points to none. ADX on its own cannot separate trend from chop, which is why it is only one of three inputs.
3. Normalised ATR percentile. ATR divided by price, ranked against its own recent history on a 0 to 100 scale. A high percentile means volatility is unusually elevated for this symbol specifically. Ranking against its own history is what lets the thresholds work across different symbols and timeframes without re-tuning.
From those three:
- Volatile requires an elevated ATR percentile together with a ribbon that has come apart. A fully stacked ribbon is treated as a trend no matter how fast it is moving, so elevated volatility on its own never forces the Volatile state.
- Trending requires not Volatile, ADX at or above the trending threshold, a fully stacked ribbon, and a ribbon spread, meaning its width measured in ATR, at or above a minimum.
- Ranging is the calm, structureless default that applies when neither of the above holds.
----------------------------------------------------------------------
STABILITY AND CONFIRMATION
----------------------------------------------------------------------
Four layers keep the regime from flickering on a boundary.
- Hysteresis. The reading needed to leave a regime is looser than the one needed to enter it, so a value parked on a threshold does not flip every bar.
- Minimum hold. A changed raw regime becomes official only after it has held for a set number of bars. Entering Volatile is exempt by default, because standing aside should not wait.
- Flip rate chop filter. If the official regime has already changed several times inside a recent window, the market is whipsawing by definition, and a fresh trend call is held back until it settles. An already established trend is exempt, so this never fights a real trend through a pullback.
- Higher timeframe confirmation. The same classifier is run on a higher timeframe using confirmed bars only, then folded into an agreement flag and into the published gates. It can require the higher timeframe to merely not conflict, or to match the trend direction exactly.
----------------------------------------------------------------------
SCORES
----------------------------------------------------------------------
- Regime Confidence, 0 to 100. How far past its defining threshold the current regime sits. A reading right on the line scores near zero.
- Regime Maturity, 0 to 100. How long the current run has lasted compared with past runs of the same type on this symbol. A high value means the current phase is already longer than most earlier ones, which can flag a stretched range or an extended trend.
- Trend Quality, 0 to 100. A weighted blend of ADX, ribbon alignment, ribbon spread and mid line slope, reduced when volatility is elevated.
----------------------------------------------------------------------
WHAT YOU SEE ON THE CHART
----------------------------------------------------------------------
- A woven ribbon of 21 thin strands interpolated across the five McGinley lines, with no solid fill. Each strand is a shade of the current regime colour, darker on the slow edge and lighter on the fast edge, over a soft wide glow. Gold for Trend Up, ruby for Trend Down, royal blue for Ranging, indigo blue for Volatile.
- Shade is driven by Regime Confidence. A confident reading gets the full saturated colour. A borderline reading is pulled toward a greyed version of the same colour, never a different colour and never invisible, so the ribbon colour itself tells you how much to trust the call.
- On a regime change every strand cross fades from the old colour to the new one over a few bars, so the ribbon melts between colours instead of snapping.
- A diamond when the regime officially flips into a directional call. A gold diamond below the bar for Trend Up and a ruby diamond above the bar for Trend Down, following the usual arrow convention. Flips into Ranging or Volatile are reported on the dashboard rather than the chart.
----------------------------------------------------------------------
DASHBOARD
----------------------------------------------------------------------
A compact on chart panel showing the current regime, the tool family it favours, Trend Quality, Regime Confidence, ADX, ATR percentile, the recent flip count, how long the regime has run against its own median, any pending flip and its confirmation countdown, and the higher timeframe regime with its agreement state. If the optional signal section is enabled it also shows average result by regime.
Position is selectable. The whole panel can be turned off.
----------------------------------------------------------------------
OPTIONAL, GRADE A SIGNAL BY REGIME
----------------------------------------------------------------------
An optional section lets you wire in an external signal series from another indicator, positive for long, negative for short, zero for flat. The script measures each entry forward return over a chosen number of bars in ATR units and reports the average result grouped by the regime the signal fired in, so you can see which regimes your own signal actually performs in. It is off by default and stays blank until pointed at a real signal.
----------------------------------------------------------------------
INPUTS
----------------------------------------------------------------------
- Ribbon. Price source, overall length, smoothness, and drawn width. Drawn width changes appearance only, not detection.
- Trend Criteria. A single dial, Strict, Normal or Lenient, that moves the trend strength bar, the minimum ribbon width, the volatility cut off, the confirmation delay and the quality floor together.
- Higher Timeframe Check. On or off, and which timeframe to use.
- Display. Element toggles, panel position, and the four regime colours.
- Grade A Signal By Regime. The optional external signal section above.
- Advanced. Higher timeframe agreement rules, ADX and ATR lengths, volatility lookback, colour fade length, and whether markers and alerts wait for the bar close.
----------------------------------------------------------------------
CALCULATION AND REPAINT BEHAVIOR
----------------------------------------------------------------------
Chart timeframe logic uses only the current bar own data. Higher timeframe reads take the last closed higher timeframe bar with lookahead off, so they do not repaint. The regime change diamonds and the alert calls are gated to confirmed, closed bars by default.
The ribbon colour on the open, still forming bar can update until that bar closes, because the live bar regime is not final until then. This is expected for a context tool. The confirmed markers and alerts are the parts that wait for the close.
There is a warm up period. The ribbon, ADX and the percentile window all need history first, and until that fills the panel reads Calibrating and no regime is published.
----------------------------------------------------------------------
LIMITATIONS
----------------------------------------------------------------------
- This is a classifier, not a strategy. It describes current conditions, it does not tell you where to enter or exit.
- Regime calls lag by design. Hysteresis, the minimum hold and the chop filter all trade a few bars of delay for fewer false flips.
- On very short histories, or the first bars of a new symbol, there is not enough data to rank volatility or measure regime maturity, and those readings stay blank until enough runs have completed.
- Thresholds are preset driven. The three criteria presets cover most cases, but unusual instruments may still need the Advanced dials.
----------------------------------------------------------------------
DISCLAIMER
----------------------------------------------------------------------
Trading involves substantial risk of loss and is not suitable for every investor. Nothing in this script or its description constitutes financial, investment, or trading advice. The regimes detected by this script label current and past conditions only and are not indicative of future results. Test any tool on your own markets, timeframes and settings before relying on it.
指標

Trendline Indicator with Dynamic Breakpoint TrackingTrendline Indicator with Dynamic Breakpoint Tracking
This indicator automates the process of manually drawing and redrawing trendlines as price structure evolves, rather than plotting a single static line.
How it works
The script tracks confirmed swing highs and lows (pivots). It starts in downtrend mode, watching the most recent swing low:
When that low is broken, the line resets. It anchors to the top of the prior move and snaps its second point to the next confirmed swing high that's lower than that top — drawing a fresh descending resistance line.
As price continues down, each new broken low re-anchors the line the same way, so the resistance line keeps stepping down along the sequence of lower highs.
If price closes at or above the current resistance level, the script flips to uptrend mode and begins drawing an ascending support line using the mirror-image logic: anchoring from the bottom of the move and snapping to the next confirmed higher low.
The two modes alternate automatically as market structure shifts between making lower highs and higher lows.
Dynamic breakpoint tracking
Unlike a fixed trendline, the breakpoints this script uses to define the line are re-evaluated continuously:
If a transition is only halfway confirmed (e.g. resistance broke but no higher low has formed yet) and price reverses back through the original anchor before that confirmation completes, the script recognizes the transition failed and reverts to the prior trend immediately, rather than waiting on a reversal that isn't materializing.
A stale-anchor safeguard prevents the line from getting permanently locked onto an old price level if the market structure it's tracking becomes irrelevant.
Inputs
Pivot Left/Right Bars — sensitivity of swing detection (smaller = faster but noisier, larger = smoother but more lag)
Max bars to search for anchor point — how far back the script looks when re-anchoring
Line colors/width, signal colors, and toggles for trend labels, pivot markers, and the debug status table
Notes
Pivot-based detection is inherently lagging by design (a swing can only be confirmed once bars exist on both sides of it), so the line reacts after structure is confirmed, not in real time.
Built for visualizing trend structure and potential trend-change points — not a standalone buy/sell signal generator. Combine with your own confirmation and risk management.
指標

Tech Leadership Map+ [Herman]Tech Leadership Map
Tech Leadership Map is a relative-market leadership indicator designed to show whether technology-focused market activity is currently leading, lagging, or moving without a clear advantage relative to the broader US equity market.
The indicator does not generate traditional buy or sell signals. Instead, it provides an additional market-context layer that can help traders evaluate whether current market participation supports or conflicts with the directional move they are analyzing.
It includes two selectable and independent leadership models:
* **Price**
* **Volume Pressure**
Both models convert several measurements into a standardized four-component composite score.
---
Why Tech Leadership Matters
Technology shares represent an important component of US equity index activity, particularly for Nasdaq-related instruments.
When technology is outperforming the broader market, Nasdaq-focused markets may be receiving stronger relative participation. When technology is underperforming, broader-market strength may not be confirmed by technology leadership.
This indicator attempts to make that relationship easier to observe directly on the chart.
It should be treated as a **relative-market context tool**, not as a standalone forecasting system.
---
Leadership States
The indicator evaluates four separate components.
Each component contributes:
**+1** = favors the selected technology leader
**0** = neutral / unavailable confirmation
**-1** = favors the benchmark
The resulting Composite Score can therefore range from:
**+4 to -4**
The default classification is:
** GREEN — Tech Leading**
Composite Score of +2 or higher.
Technology-oriented activity is showing stronger relative leadership than the selected benchmark.
** YELLOW — No Clear Edge**
Composite Score between -1 and +1.
The measurements are mixed and neither side has sufficient agreement to establish a clear leadership state.
** RED — Tech Lagging**
Composite Score of -2 or lower.
Technology-oriented activity is showing weaker relative leadership than the selected benchmark.
These colors describe the current relative-leadership condition. They do not represent predictions of future price direction.
---
# 1. PRICE MODE
The default Price model compares:
**QQQ — Price Leader**
with
**SPY — Price Benchmark**
Both symbols can be changed in the indicator settings.
The model evaluates four components.
### 1. Performance From RTH Open
The indicator measures the percentage performance of QQQ and SPY from the beginning of the configured US Regular Trading Hours session.
It then compares those performances.
If QQQ has performed better from the RTH open, the component favors the leader.
If SPY has performed better, it favors the benchmark.
---
### 2. Relative-Strength Ratio Slope
The indicator calculates the relative-strength relationship:
**QQQ / SPY**
The logarithm of this ratio is evaluated using a linear-regression slope.
A rising relative-strength relationship indicates improving technology leadership.
A falling relationship indicates weakening technology leadership relative to the benchmark.
---
### 3. Short-Term Momentum Difference
The model compares short-term rate-of-change momentum between the leader and benchmark.
By default, this component uses a 5-bar momentum comparison.
This allows the indicator to identify situations where both markets may be moving in the same direction while one is accelerating more strongly than the other.
---
### 4. Correlation-Break Confirmation
QQQ and SPY normally exhibit a relatively high degree of correlation.
The indicator measures correlation between their logarithmic returns.
When correlation falls below the model's internal threshold, the short-term momentum difference receives an additional confirmation vote.
The purpose of this component is to emphasize periods where relative movement becomes more meaningful because the two markets are no longer behaving as closely together.
---
# 2. VOLUME PRESSURE MODE
Volume Pressure provides an alternative model that does **not use QQQ/SPY price movement to determine leadership**.
The default market-internal sources are:
**NASDAQ: VOLDQ**
versus
**Broad Market / NYSE: VOLD**
These represent net up-volume minus down-volume market internals.
The symbols are editable because VOLDQ and VOLD represent different market universes and should not be interpreted as literal constituent-by-constituent equivalents of QQQ and SPY.
---
## Normalization
NASDAQ and broad-market internal series can operate on substantially different numerical scales.
For that reason, the indicator first normalizes each series independently before comparing them.
This prevents the raw numerical magnitude of one internal from automatically dominating the comparison.
---
## Volume Pressure Components
The model then evaluates four measurements.
### 1. Pressure Level
Compares the current normalized leader pressure with the normalized benchmark pressure.
---
### 2. Fast Pressure
Applies short-term smoothing to both normalized internal series and compares their relative position.
This helps reduce some bar-to-bar noise while preserving short-term changes in leadership.
---
### 3. Pressure Momentum
Measures the change in normalized internal pressure over the selected momentum lookback.
This identifies which market internal is currently improving or deteriorating faster.
---
### 4. Pressure Impulse
Each normalized internal is compared with its own slower baseline.
The difference between those impulses determines which market is showing the stronger deviation from its recent baseline.
---
# Chart Display
The default visualization uses colored dots placed along the chart.
The colors correspond directly to the current leadership state:
**Green = Tech Leading**
**Yellow = No Clear Edge**
**Red = Tech Lagging**
Optional chart-bar coloring can also be enabled.
By default, leadership dots are displayed only during the configured US Regular Trading Hours session:
**09:30–16:00 New York time**
This behavior can be changed in the settings.
---
# Statistics Table
The optional statistics table provides additional information about the active model.
Depending on the selected source, it displays:
* active leadership source
* current leadership state
* Composite Score
* individual component votes
* correlation in Price mode
* normalized internal gap in Volume Pressure mode
The table is intended to make the calculation transparent rather than displaying only the final color.
---
# How to Use It
The indicator is primarily intended as a **confirmation and market-context tool**.
For example, when analyzing a Nasdaq-related market, a trader may compare the current directional setup with the technology leadership state.
A bullish market setup occurring while technology is leading represents a different relative-market environment from the same setup occurring while technology is lagging.
Similarly, a bearish setup occurring while technology leadership is weakening may provide different contextual information from one occurring during strong technology leadership.
The indicator does not determine whether a trade should be entered. Entry, exit, risk management, market structure, liquidity, volatility, news conditions, and other factors remain separate trading decisions.
---
# Alerts
Three state-change alerts are available:
* Technology leadership becomes positive
* Technology leadership becomes negative
* Leadership becomes mixed
Alerts trigger when the composite state transitions into the corresponding condition.
---
# Repainting / Realtime Behavior
The indicator is designed without future-data references.
All external symbol requests use `lookahead_off`, and the script does not reference future bars or negative offsets.
However, values on the **currently forming realtime bar can change until that bar closes**, because the underlying markets and market internals are still updating.
Historical completed bars represent the final calculated state for those completed chart bars.
Users who require confirmed information should therefore evaluate the state after the relevant bar has closed.
---
# Data Availability
The indicator depends on external TradingView symbols.
Price mode requires valid data for the selected Price Leader and Price Benchmark.
Volume Pressure mode requires valid data for the selected market-internal symbols.
Availability of individual symbols can vary depending on TradingView data access, exchange coverage, account configuration, or symbol availability.
If the required data is unavailable, the indicator reports that state rather than attempting to substitute another source automatically.
---
# Originality
Tech Leadership Map combines two distinct approaches to relative-market analysis inside one standardized leadership framework.
Rather than displaying QQQ/SPY relative strength or market internals as isolated raw series, the indicator evaluates several independent characteristics of leadership and converts them into a transparent four-vote Composite Score.
The Price model evaluates:
* session-relative performance
* relative-strength trend
* relative momentum
* correlation-based confirmation
The Volume Pressure model independently evaluates:
* normalized internal pressure
* smoothed pressure leadership
* internal momentum
* pressure impulse
Both engines produce the same standardized leadership states, allowing users to compare price-based leadership with non-price market-internal participation using a consistent visual framework.
The complete Pine Script source code is published openly so users can inspect the calculations and understand exactly how each state is derived.
---
## Important Notes
This indicator is an analytical tool and is not intended to provide investment advice or guarantee future market performance.
Leadership describes a relative condition between the selected markets or market internals. It should not be interpreted as a prediction that the charted instrument must rise or fall.
Users should evaluate the indicator together with their own analysis, trading methodology, and risk-management process. 指標

MarketMaulers CISDMarketMaulers CISD marks the level where delivery changed state: the open of the run that raided a level and then failed to hold it. It runs on the chart timeframe and on up to two higher timeframes at once, and it draws one line per setup rather than a lane of candles, because the level is the whole product.
Potential · Confirmed · Invalidated
FROM ZERO: WHAT A CISD IS
Read it as a three-candle story.
C1 is the candle whose high or low is worth taking. C2 is the candle that takes it and closes back inside. C3 is the candle that opens afterwards, where the reclaim either gets proven or does not.
The CISD LEVEL is not C1's extreme and it is not C2's close. It is the OPEN of the consecutive same-direction run that did the raiding. That run is a sequence of candles all closing the same way, and its open is where the move that swept began. When price closes back through that open, the run that swept is now the run that failed. Delivery has changed state. That is the entire concept, and everything below is about identifying that one price honestly.
THE TIMEFRAME NAMES A GRANULARITY, NOT A CANDLE
This is the part most implementations get wrong, and it is the difference between a tool that fires several times an hour and one that marks something.
A CISD timeframe names the resolution you are confirming on. Its C1 and C2 candles come from one fractal step ABOVE it:
1m from 15m · 3m from 30m · 5m from 1H · 15m from 4H · 1h from 1D · 4h from 1W · 1D from 1M
So a 5m CISD is a 1H C1 and C2, confirmed on 5m closes. Hunting "the current 5m candle sweeps the previous 5m candle" is a different and much noisier thing that happens several times an hour and means little.
Two consequences follow, and both are visible.
• A CISD only draws when your chart timeframe is at or BELOW its own granularity. From a 15m chart a 5m CISD stays hidden, because the chart cannot resolve the closes that confirm it.
• A slot confirms at ITS OWN granularity. On a 5m chart the 15m slot waits for a 15m close, not a 5m one. Set a slot to CHART and the chart timeframe becomes the granularity, with its C2 still pairing one step up.
THE TWO-SIDED SWEEP RULE
A candle that takes BOTH sides of the prior candle is indecisive. It swept the highs and the lows, so there is no side it committed to and no direction to deliver in. No C2, no setup, either way. This gates everything and it is on by default.
MAULER MODE is the single exception and it is off by default. If that two-sided candle CLOSED beyond one of C1's extremes then it was decisive after all, and the setup stands. It loosens the strictest gate in the model, so it is worth turning on deliberately rather than leaving on.
WHERE THE LEVEL COMES FROM, AND WHY IT MOVES
The anchor is the open of the first candle of the current same-direction run. Only an opposite-close candle resets it. Wicks, extremes and dojis are transparent to it, and a run can span a candle boundary, because delivery often starts inside the previous candle.
Two rules keep that anchor honest.
• A RATCHET. Any candle opening beyond the current anchor drags the anchor to its own open. A rally pulls a dead anchor up with it, so a shallow wick past the extreme can never capture a stale run from hours ago. The anchor always sits at the origin of the CURRENT move.
• RE-ANCHORING TO THE FINAL SWEEP. When price sweeps, pulls back, then sweeps again further, the level moves to that last leg. The anchor is structural, a run open, so a bare noise wick past the extreme re-captures the same value. Only a genuine pullback and resweep shifts the mark.
WHAT POTENTIAL MEANS, AND THE ONE CASE THAT SURPRISES PEOPLE
Potential means one thing only: price has not closed through the level yet. It is not a statement about which candle the close belonged to.
So when the C2's own sealing close is already through the level, the CISD is CONFIRMED at that seal and draws that way immediately. There is no waiting for a later candle to say what has already happened.
That test runs at the seal and never in the middle of C2, because the level re-anchors every time price sweeps a new extreme inside the candle. A bar confirming against the level as it stood an hour ago would be confirming against a level that no longer exists.
INVALIDATION
A hunt dies when price takes the C2's own extreme before the level is reclaimed. That is a raw trade through it, not a close, because a trade is a trade at any resolution and the setup does not survive the manipulation extreme being taken back.
Failed levels are removed by default, which keeps every line on the chart a setup that is still live or one that actually worked. Turn on Keep failed and they stay as dotted, faded history with an invalidation tag, which is the honest picture when you are reviewing rather than trading.
WHY IT DOES NOT REPAINT
There is no security call anywhere in this script. The engine accumulates its own higher-timeframe candles from the bars it runs on rather than requesting them, so there is no lookahead idiom to get wrong and no repaint surface at all.
Confirmation reads the previous, always-complete bar, and only on a bar where the slot's own timeframe has rolled, which is what makes a 15m slot confirm on 15m closes rather than on whatever the chart happens to be. Every state change is judged on closed data.
THE TABLE
Three rows, one per slot, bull state and bear state. It reports what happened LAST rather than what has ever happened, so a side that confirmed and was later invalidated reads as invalidated. A readout that cannot go backwards is not a readout.
Deliberately independent of what draws. Most people run one slot on the chart and want the state of the other two without adding lines to the price pane.
ALERTS
CISD armed (potential) · CISD confirmed · CISD invalidated
Messages carry the slot timeframe, the direction, the event and the level price, so what arrives is a level you can act on rather than a notification that something happened somewhere. Create one alert on this indicator with the condition set to Any alert() function call and it carries every enabled event for every slot at once.
An optional killzone filter quiets alerts outside three editable windows. It touches alerts only. Outside your windows the chart is identical: setups still arm, confirm, draw and invalidate on exactly the same rules, you do not get pinged for them.
MADE TO FIT YOUR CHART
Three slots each with their own bull and bear colour. Potential and confirmed lines have separate style and width. Labels on or off with three text sizes. Three right-extension modes, including freezing a confirmed level at the bar it confirmed, which is the honest history: the level did its job there. Keep failed on or off, with a budget for how many finished levels stay per side. Table position, text size, and a toggle per section.
The kept-level budget goes to 250 a side, and the tooltip is blunt about what that means. TradingView caps a script at 500 lines and 500 labels total. Past roughly 80 a side with more than one slot on, the platform ceiling decides what you see rather than this number does. It is a budget, not a promise.
HOW TRADERS ACTUALLY USE IT
Start with one slot and leave the other two off. The default pair, 5m and 15m, is two different fractals on one chart, and running both before you have read either one on its own is how a clean idea turns into noise.
Leave Draw potential off at first. With it off, every line on your chart is a CISD that actually confirmed. Turn it on when you want to see the setups the tool was watching that never paid, which is a different and slower kind of study.
The invalidation alert is the underrated one. Knowing a level died is a stand-down, and stand-downs are cheaper than entries.
WHAT THIS TOOL IS NOT
It marks a level and reports what happened to it. It does not project targets, it does not size a position, it does not stack or merge zones, and it does not tell you the setup was good. Those are layers on top of a CISD rather than part of one, and this file marks the CISD.
Works on any market and any timeframe.
Display only. This marks a level and reports what happened to it, it does not fire buy/sell signals and it does not forecast. Educational tool, not financial advice.
Published open-source. The fractal pair table, the two-sided sweep gate, the delivery-run anchor and its ratchet, the re-anchor-to-final-sweep capture, the seal confirm, the per-slot granularity gate and the alert transport are all readable in the source. Everything above explains what it marks and how it decides what to mark; the code is there so you can check that the description is accurate rather than take it on faith. Read it, fork it, argue with the constants.
指標

指標

VIKING + AXE & SHIELD## VIKING + AXE & SHIELD — What This Indicator Does
**VIKING + AXE & SHIELD was built so you only need one TradingView indicator on your chart.**
Instead of stacking separate indicators for moving averages, RSI, Accumulation/Distribution, OBV, CMF, ADX, relative volume, relative strength, support/resistance and other context, this script combines them into **one overlay indicator and one compact information panel**. The goal is to keep the chart clean while still showing trend, momentum, volume, money flow, relative strength and important price levels in one place.
The indicator automatically works from the **timeframe you are currently viewing**. For example, if the chart is on 1H, the RSI and A/D calculations are based on hourly bars. On Daily, they use daily bars. On Weekly, they use weekly bars.
### Moving averages
VIKING plots four commonly used trend averages directly on the price chart:
* **9 EMA**
* **21 EMA**
* **50 SMA**
* **200 SMA**
The 9 and 21 EMAs are intended to show shorter-term trend and momentum, while the 50 and 200 SMAs provide broader trend structure. Their current prices are also printed beside the averages so you can immediately see where they are without moving the cursor over them.
Internally, the script also examines the relationship between these moving averages and price. It can recognize conditions such as bullish or bearish MA stacking, price reclaiming or losing moving averages, golden/death-cross conditions, and developing trend structures. Those calculations are kept in the script even though they are not all printed in the VIKING panel.
### AXE & SHIELD support and resistance
AXE & SHIELD is the support/resistance part of the system.
Rather than simply drawing every recent high and low, it detects pivot-based price zones and tracks how those zones behave after they are created. Zone width is adjusted using ATR, and nearby pivots can be merged into the same area rather than creating a cluttered chart full of almost-identical levels.
The script evaluates support and resistance using several ideas, including:
* how well price closes relative to the zone,
* how deeply price penetrates it,
* how strongly price reacts away from it,
* how many times the zone has already been tested,
* and whether the zone has actually broken.
This creates an internal **zone survival score** rather than assuming every support or resistance level has equal strength. The score itself is intentionally kept internal so the chart remains simple.
Support levels are shown in the selected support color and resistance in the selected resistance color. Provisional/unconfirmed levels can be shown with a dotted appearance, and the script can mark zones that have been swept.
The nearest support and nearest resistance are also exported to TradingView's data window/status line if enabled.
---
# The VIKING information panel
The panel condenses several indicators into a small area instead of requiring separate lower chart panes. It includes:
**ADX / 52W High**
**P-RVOL / RS**
**OBV / ADR%**
**CMF / Average Volume**
**RSI full readout**
**A/D Pressure full readout**
The panel position and text size are adjustable. Strong, caution and weak/broken conditions are color coded so the information can be scanned quickly.
## ADX — trend strength
ADX answers a simple question:
**How strong is the current trend?**
The script uses a 14-period DMI/ADX calculation.
* Above **25** = Strong
* Below **20** = Choppy
* Between 20 and 25 = Building
It also compares ADX with three bars ago and adds arrows to show whether trend strength is increasing or decreasing.
Example:
`ADX 30.6 Strong ↑`
means a relatively strong trend whose strength is still increasing.
Important: **ADX does not tell you whether the trend is bullish or bearish.** It measures the strength of the trend.
## 52W Hi — distance from the 52-week high
The panel calculates the highest price over approximately 252 bars and shows how far the current price is from that high as a percentage.
Example:
`52W Hi -8.2%`
means price is currently about 8.2% below its 52-week high.
This provides quick context about whether a stock is trading near leadership territory or well below previous highs.
## P-RVOL — projected relative volume
P-RVOL is more sophisticated than simply comparing today's volume with yesterday's volume.
The script builds a historical intraday volume curve using previous sessions. By default, it uses:
* the previous **20 sessions**,
* a **15-minute calculation timeframe**,
* and regular NYSE hours of **9:30 AM–4:00 PM New York time**.
It looks at how much volume normally occurs by the current point in the trading session and projects what the full day's volume may look like.
Example:
`P-RVOL 1.50x`
roughly means the current trading pace is projecting toward about **1.5 times normal session volume**.
The arrows show whether projected relative volume itself is increasing or decreasing.
This makes P-RVOL especially useful early in the trading day because you do not have to wait until the closing bell to know whether participation appears unusually strong.
## RS — relative strength
The RS rating measures the stock's performance relative to the S&P 500.
The calculation gives more weight to recent performance while also considering longer periods, using approximately:
* 63 trading days,
* 126 days,
* 189 days,
* 252 days.
The stock's performance is compared against SPX over those same periods.
The result is converted into an RS-style rating, and an arrow indicates whether relative strength is improving or deteriorating.
Example:
`RS 83 ↑`
means the stock is showing relatively strong performance and its relative-strength trend is improving.
## OBV — buying and selling pressure
On-Balance Volume looks at volume together with whether price closed higher or lower.
VIKING does not clutter the panel with OBV's huge raw cumulative number. Instead it examines the **five-bar change** and converts it into an easy description:
* Strong Buying ↑
* Buying ↑
* Strong Selling ↓
* Selling ↓
* Neutral →
That gives the useful information from OBV without needing an OBV pane.
## ADR% — average daily range
ADR% shows the stock's average trading range as a percentage over the previous 20 bars.
Higher ADR stocks generally make larger percentage moves, while lower ADR stocks generally move less.
For example:
`ADR% 4.94%`
means the stock has recently been moving through an average daily range of roughly 4.94%.
This gives a fast way to judge how volatile or active a stock normally is.
## CMF — Chaikin Money Flow
CMF measures where price closes within each candle's range and weights that behavior by volume over 20 periods.
Positive CMF generally indicates buying pressure, while negative CMF indicates selling pressure.
VIKING calculates both the current CMF value and its recent direction.
A reading such as:
`CMF +0.20`
suggests positive money flow.
A negative reading suggests the opposite.
## Average Volume and liquidity label
VIKING calculates average volume over 50 bars and adds a simple liquidity classification:
* **Liquid** = average volume above 500,000
* **Thin** = above 100,000
* **Avoid** = below 100,000
This is meant as a quick screening aid, not a universal definition of liquidity.
---
# RSI without needing an RSI pane
One of the main purposes of VIKING is to provide enough numerical information about RSI that a separate RSI pane is unnecessary.
The readout looks like:
`RSI 37.2 | Δ5 +1.9 | Dist -1.9 | Acc3 +9.3`
It contains four pieces of information.
### RSI
The first number is standard **RSI(14)**.
The script also calculates a **14-period SMA of RSI** as its baseline.
A simplified way to think about the current reading:
* above 60 = stronger momentum
* 40–60 = middle/transition area
* below 40 = weaker momentum
These same thresholds control the panel's RSI color.
### Δ5
`Δ5` means:
**How much has RSI changed over the previous five bars?**
Example:
`Δ5 +7.0`
means RSI is seven points higher than five candles ago.
`Δ5 -7.0`
means RSI is seven points lower.
Because it is based on bars, the meaning automatically changes with your chart:
* 1H chart = five hours
* Daily chart = five trading days
* Weekly chart = five weeks
This makes the same indicator useful across multiple timeframes.
### Dist
`Dist` is the distance between current RSI and its 14-period RSI moving-average baseline.
Example:
`RSI 55 | Dist +7`
means RSI is seven points above its recent baseline.
`RSI 55 | Dist -4`
means RSI may still be above 50, but it is actually below its recent RSI trend.
That distinction helps identify whether momentum is strengthening or weakening instead of relying only on the absolute RSI number.
### Acc3
`Acc3` measures **three-bar acceleration**.
The script compares RSI's move over the latest three bars with its move over the previous three bars.
This is useful because a single bad candle does not automatically destroy an otherwise improving momentum trend.
For example:
`RSI 42 | Δ5 +5 | Dist +3 | Acc3 +7`
can be read as:
RSI is still relatively low, but it has improved over five bars, moved above its recent baseline, and the recent three-bar move is stronger than the three bars before it.
So rather than simply knowing **where RSI is**, VIKING also tells you:
**where it came from, where it sits relative to its trend, and whether that movement is gaining or losing strength.**
---
# A/D Pressure without needing an Accumulation/Distribution pane
Standard Accumulation/Distribution is cumulative. Raw values can become extremely large and are difficult to compare between different stocks.
VIKING therefore converts A/D into a normalized **A/D Pressure** reading instead of displaying the raw cumulative number.
It examines the change in A/D over 20 bars and divides that change by the total volume over the same period. The result is converted to a scale capped between approximately **-100 and +100**.
The readout looks like:
`A/D -11 | Δ5 -5 | Dist -9 | Acc3 +6`
### A/D
The first number is the current normalized pressure.
Broadly:
* positive = accumulation pressure
* negative = distribution pressure
* near zero = relatively balanced
The panel colors stronger positive readings at +20 or higher and stronger negative readings at -20 or lower.
### A/D Δ5
This tells you how much normalized A/D pressure has changed over five bars.
`Δ5 +10`
means accumulation/distribution behavior has improved by 10 points over five candles.
`Δ5 -10`
means it has deteriorated.
### A/D Dist
A/D Pressure has its own **20-period moving-average baseline**.
`Dist` tells you how far current pressure is above or below that normal path.
Positive Dist means current A/D pressure is stronger than its recent baseline.
Negative Dist means it is weaker.
### A/D Acc3
Acc3 uses the same concept as RSI.
It compares the change in A/D Pressure during the latest three bars with the previous three bars.
This creates some very useful combinations.
For example:
`A/D -11 | Δ5 -5 | Dist -9 | Acc3 +6`
means:
**A/D is still negative, it is still worse than five bars ago, and it remains below its baseline — but the most recent three-bar behavior is improving.**
In other words:
**The condition is still weak, but it may be starting to turn.**
That is much more informative than simply displaying a raw A/D value.
---
# Stage and long-term trend context
The script also contains daily calculations involving the **200-day and 220-day moving averages**.
It checks whether price is moving above the 200-day average while the long-term average is flat or improving, including cases where price gaps completely above the prior 200-day average.
These calculations are designed to provide longer-term stage/trend context directly on the chart rather than adding another separate study.
---
# How to read the indicator as a whole
VIKING is not intended to make a trading decision from one number.
Its purpose is to let several independent pieces of evidence confirm or disagree with each other.
For example, a strong setup might show something like:
```text
ADX 31 Strong ↑
P-RVOL 1.45x ↑
OBV Strong Buying ↑
CMF +0.18
RS 82 ↑
52W Hi -4.2%
RSI 58.4 | Δ5 +7.2 | Dist +5.1 | Acc3 +4.0
A/D +28 | Δ5 +12 | Dist +9 | Acc3 +7
```
That would tell you:
**Trend strength is increasing, volume participation is elevated, OBV and CMF show buying pressure, the stock is relatively strong, it is close to its 52-week high, momentum is improving, and accumulation pressure is strengthening.**
The opposite combination would warn that multiple parts of the market structure are deteriorating.
The important idea is that **no individual reading needs to be treated as a buy or sell signal. VIKING is a compact market-context system.**
## Why it was built
Most TradingView layouts become crowded when you add:
RSI + A/D + OBV + CMF + ADX + relative volume + moving averages + support/resistance + relative strength.
VIKING + AXE & SHIELD is designed to replace that stack with **one indicator**.
Price stays as the main focus.
The moving averages and important support/resistance levels stay directly on the chart, while indicators that would normally require separate panes are converted into compact numerical or descriptive readings in the VIKING panel.
That gives you more chart space while still preserving information about:
**trend, momentum, participation, accumulation/distribution, money flow, volatility, relative strength and market structure.**
That is the core purpose of the script.
指標

Multi-Timeframe Trend & AlignmentComprehensive Technical Overview: Multi-Timeframe Trend & Alignment Pro
This custom script is an institutional-grade technical analysis dashboard designed for professional traders who demand multi-timeframe confirmation, structural alignment, and real-time performance tracking directly on their chart canvas. By unifying multiple Exponential Moving Averages (EMAs), Simple Moving Averages (SMAs), HTF (Higher Timeframe) momentum oscillators, and performance metrics into a single dynamic interface, the script eliminates chart clutter and provides an immediate read on market structure.
Key Architectural Features
Dual Moving Average Suite: Supports up to 10 customizable EMAs and 10 customizable SMAs, allowing traders to track short-term scalping triggers alongside long-term structural baselines simultaneously.
Dynamic Table Matrix: Automatically aggregates active moving averages, sorts them by price value in real time, calculates distance metrics (points and percentage from current price), and dynamically adjusts background coloring based on structural alignment.
Multi-Timeframe (MTF) Intelligence: Incorporates robust higher-timeframe metrics via request.security, evaluating trend health across EMAs, MACD, ADX trend strength, SuperTrend direction, and RSI without repainting issues.
Performance Percentage Tracking: Automatically computes and displays Day-to-Day (DTD), Week-to-Week (WTD), Month-to-Month (MTD), Year-to-Date (YTD), and 1-Year rolling performance benchmarks.
Clean Visual Management: Features native price scale label projections and conditional toggle controls to ensure a distraction-free trading workspace.
Input Customization Guide
Global Settings
Source: The price source used for all moving average calculations (default is close).
HTF Trend Timeframe: Selects the reference timeframe for higher-timeframe trend context (e.g., Daily, 4-Hour, Weekly).
EMA / SMA Settings
Show / Length / Width / Color: Inline controls to toggle individual averages on/off, adjust lookback lengths, set line thickness (1–4), and assign distinct color profiles.
Display Controls
Show Alignment Table: Toggles the real-time on-screen data matrix.
Show Performance %: Appends DTD, WTD, MTD, YTD, and 1-Yr return metrics to the summary table.
Show HTF Trend Metrics: Appends higher-timeframe technical indicators (MACD, ADX, SuperTrend, RSI) to the dashboard.
Trading Strategies & Practical Applications
Trend Stack Confluence: When shorter-length moving averages cleanly stack above longer-length averages while price holds above key HTF baselines, the table shifts to a bullish-aligned background, signaling institutional accumulation.
Mean Reversion & Distance Tracking: Use the Dist (Pts / %) column in the real-time table to gauge overextension. Extreme percentage deviations from core moving averages (like the 50 or 200 period lines) often highlight prime mean-reversion entries or profit-taking zones.
Multi-Timeframe Filter: Pair the primary chart execution with the embedded HTF metrics. Taking long setups only when the HTF EMA stack and SuperTrend register as bullish ensures alignment with dominant macro order flow. 指標

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

Volatility RegimeVolatility Regime
OVERVIEW
This indicator classifies the current market into one of three volatility regimes — Low, Medium, or High — and displays them in a separate panel below the price chart. Rather than measuring volatility in absolute terms, it evaluates how current volatility compares to its own recent history, so the classification adapts automatically to any instrument and timeframe without needing manual recalibration.
METHODOLOGY
Volatility is calculated as the standard deviation of logarithmic returns over a user-defined lookback period. That value is then compared to its own distribution over a longer historical window using a percentile rank calculation. The result is a 0-100 reading showing where current volatility stands relative to its own recent history, rather than relying on a fixed, one-size-fits-all threshold that would behave differently across instruments.
COMPONENTS
- Volatility Percentile Rank line: plots the 0-100 percentile reading of current volatility, colored according to the active regime.
- Threshold lines: two dashed horizontal lines mark the Low and High volatility thresholds (default 33 and 66), both adjustable.
- Panel background shading: the background of the indicator panel is tinted according to the active regime for quick visual reference.
- Regime label: a label on the most recent bar displays the current regime as text (LOW / MEDIUM / HIGH).
REGIMES
- Low Volatility Regime: percentile rank at or below the low threshold. Current volatility is compressed relative to its recent history.
- Medium Volatility Regime: percentile rank between the two thresholds. A transitional or average volatility state.
- High Volatility Regime: percentile rank at or above the high threshold. Current volatility is expanded relative to its recent history.
PURPOSE
This tool adds volatility context to trading decisions rather than generating direct buy or sell signals. Market behavior tends to differ meaningfully across volatility regimes, and being aware of the active regime can help with position sizing, stop placement, and identifying which type of setups are more likely to be relevant at a given time.
HOW TO USE IT
- Check the current regime shown in the panel before evaluating a setup on the main chart.
- Consider adjusting position size and stop-loss distance according to the active regime — wider stops and smaller size are generally more appropriate in high volatility conditions, and the opposite in low volatility conditions.
- A prolonged Low Volatility Regime can indicate the market is compressing and may be approaching an expansion phase.
- Volatility Length, Percentile Rank Lookback, and both threshold levels are adjustable in the settings to fit different instruments and timeframes.
NOTES
This indicator is a contextual tool intended to support discretionary or systematic analysis. It does not predict market direction and should be used alongside a broader trading methodology and proper risk management. 指標
