Three Drives Pivot Scanner [Trishul]1. Description
The Three Drives pattern is a structural price formation made up of three sequential directional drive-legs, each separated by a corrective retracement. Each successive drive extends beyond the last within defined Fibonacci proportions, while each retracement holds within a defined range relative to the preceding move. The completed structure is traditionally read as an exhaustion pattern, with the completion of the third drive forming a Potential Reversal Zone (PRZ).
Three Drives Pivot Scanner detects Three Drives structures automatically using a pivot based detection system and, provides two concurrent methods:
Pivot Confirmed — waits for the complete six-point structure to be confirmed.
Live Projection — projects the PRZ while the third drive is still forming and identifies when price first trades into the projected zone.
2. Features
Pivot-Based Structural Detection
Structural swing highs and swing lows are identified using Pine Script's built-in pivot functions. The pivot length is user adjustable, allowing the detector to be tuned from more reactive short-term structures to broader, slower moving structures. Confirmed pivots are stored in an array and evaluated sequentially to determine whether the resulting swing structure satisfies the Three Drives geometric requirements.
pivot high = ta.pivothigh(high, pivLen, pivLen)
pivot low = ta.pivotlow(low, pivLen, pivLen)
// default pivot length is 5.
// shorter pivot length produces more patterns,
Method 1 — Pivot Confirmed
The Pivot Confirmed method requires all six pivot points (start. three drives , two retracements) to already be confirmed pivots before plotting. This is the most structural complete interpretation but by nature introduces delay inherent in pivot confirmation. A confirmed pattern is rendered as a polyline connecting all six pivot points.
Method 2 — Live Projection
The Live Projection method is designed to identify the potential completion of a Three Drives pattern before the final drive is confirmed.
Once the first five pivot points have been established, Trishul calculates the Fibonacci based Projected Reversal Zone ( PRZ) for the anticipated third drive and projects that zone forward. Instead of waiting for a validated swing high/low on the current bar, the script actively scans forward bar-by-bar to identify the moment price first intersects the PRZ. This continuous, intra-bar scanning ensures the PRZ is never ignored or bypassed, capturing the earliest possible structural touch. The developing pattern is rendered as a bull/bear colored polyline with numbered drive labels (1, 2, 3) and a dashed projected-zone box. Unlike the Pivot Confirmed method, the Live Projection method does not require the third drive to subsequently become a confirmed pivot before the potential completion is identified. Both methods are plotted by default so users can compare and contrast their behavior, with the option to turn either one off.
Pattern Time–Price Symmetry
When in Live Projection, Trishul validates the Three Drives pattern using both price and time symmetry. It measures the bar width between Drive 1 and Drive 2 as a reference interval. To pass validation, the time elapsed between Drive 2 and Drive 3 must reach the projected reversal zone (PRZ) within a window of 0.5× to 2.628× that reference interval. Moves occurring too early lack structural development, while those taking too long break temporal symmetry and are rejected.
Pattern Age Filter
A maximum pivot array size and configurable maximum pattern bar-width settings keep only structurally recent patterns on the chart rather than accumulating stale historical ones indefinitely. 3. Future Development
Trishul is a demonstration of how a pivot-based architecture can be applied to automated pattern recognition. The underlying framework can be further expanded to identify or construct a variety of price structures including trend lines, channels and multi-leg patterns. Future planned development will extend the framework into harmonic pattern detection systems (Gartley, Butterfly, Bat, Crab, and others).
4. Default Settings
Pivot Point length: 5
Retracement Ratio: 0.5 - 0.886
Extension Ratio: 1.13 - 1.618
Tolerance: 0.9 - 1.1
3rd Drive Time Multiplier: 0.5 - 2.628
Max Pattern Bar Width: 300 bars
日本語概要 (Japanese Summary)
Three Drives Pivot Scanner は、3つの連続する推進波(ドライブ)と2つの調整波(リトレースメント)からなる構造的な価格パターンを自動検出する高機能インジケーターです。各波動はフィボナッチ比率に基づいて厳格に評価され、パターンの完成時にトレンド転換の可能性が高い領域である Potential Reversal Zone (PRZ) を形成します。内蔵されたジグザグ機能とピボットポイントのアルゴリズムを用いることで、相場の重要な節目を正確に捉えながら、ユーザーの設定に合わせたピボット長や比率の柔軟なカスタマイズを可能にしています。
本スクリプトの最大の特徴は、アプローチの異なる2つの検出方法をリアルタイムに同時提供する点にあります。6つすべての構造ポイントが完全に確定してから綺麗なパターンを描写する保守的な「Pivot-Confirmed」と、最初の5つのポイントから最終レッグの到達点を先読みして価格がPRZに達した瞬間にリアルタイム検知する「Live Projection」を搭載しています。これにより、確定済みの信頼性を重視するトレーダーと、未確定の段階から一歩先んじて反転ゾーンを狙いたいトレーダーの両方のニーズに同時に応えるインジケーターとなっています。
中文概要(Chinese Summary)
Three Drives Pivot Scanner 是一款結構分析指標,能自動檢測由三個連續推進浪(Drive)與兩個修正浪(Retracement)所組成的結構性價格形態。各個波段皆依據斐波那契比率進行嚴格評估,並在第三個推進浪完成附近形成可能發生趨勢反轉的目標區域(Potential Reversal Zone, PRZ)。該指標內建 ZigZag 功能與轉折點(Pivot Points)演算法,能精確捕捉市場的關鍵拐點,同時允許用戶根據自身需求,靈活調整轉折點長度、回撤與擴展比率及容許誤差。
本腳本的核心優勢在於同步提供兩種互補的偵測模式。保守的「Pivot-Confirmed」模式會等待所有六個結構點完全確認後,才在圖表上繪製出完整的形態,有效過濾虛假訊號;而「Live Projection」模式則在前面五個結構點成形時,便提前推算最終浪的落點,並在價格首次觸及 PRZ 預測分區的瞬間實時觸發告警。這項設計讓重視訊號確認的穩健型交易者,與傾向在形態完成前搶先佈局反轉點的左側交易者,都能兼顧各自的策略需求。
Disclaimer:
This script is a research tool for market structure analysis and educational purposes only. It does not constitute financial advice. Trading involves risk. 지표

HERTZ Order Block - Active Market Bias & Depletion [5M]HERTZ Order Block - Active Market Bias & Depletion
HERTZ Order Block is a market-structure-based Order Block analysis tool designed primarily for short-term cryptocurrency charts, with a particular focus on 5-minute analysis.
The indicator does not treat every opposite-colored candle as an Order Block. Instead, an Order Block can only be created after a confirmed structural event and a qualifying displacement move. The script then evaluates the resulting zone using multiple contextual factors, including displacement strength, candle structure, optional Fair Value Gap confirmation, optional candle-pattern confirmation, volume expansion, liquidity sweep context, zone size, age, retests, nearby opposing Order Blocks, and repeated-use depletion.
The purpose of the script is not to predict the next candle or guarantee a reversal. Its purpose is to identify structurally relevant Order Block zones, track how price interacts with them over time, rank their current importance, and summarize the balance between active bullish and bearish Order Blocks.
Order Block formation
A bullish Order Block is searched for after a confirmed bullish Break of Structure and bullish displacement. The script looks backward for a qualifying bearish candle that preceded the displacement and uses that candle as the source of the bullish zone.
A bearish Order Block uses the opposite process. After a confirmed bearish Break of Structure and bearish displacement, the script searches backward for a qualifying bullish candle and uses it as the source of the bearish zone.
Depending on the selected zone mode, the Order Block can be constructed from the refined portion of the source candle, its candle body, or its full high-to-low range.
Once an Order Block is created, its original price boundaries are preserved. The zone is not continuously relocated to follow price.
Confirmed lifecycle states
Each active Order Block has a lifecycle. These lifecycle states are primarily updated from confirmed bars so that an unclosed candle does not permanently change the historical state of a zone.
FRESH means that the Order Block has been created and has not yet completed a confirmed retest.
APPROACH means price has moved within the defined ATR-based approach distance of the Order Block.
IN ZONE means a confirmed price bar has interacted with the Order Block.
HOLD means the zone was tested and a later confirmed bar moved away from the zone in the expected direction by the required ATR-based confirmation distance.
These states are used not only for display purposes but also to control which Order Blocks are considered immediately actionable.
Action priority
The indicator separates structural importance from immediate trading relevance.
Structural Score (S) represents the current structural strength of an active Order Block after considering its original quality, displacement characteristics, age, mitigation status, opposing-zone conflict, and repeated-test depletion.
Action Score (A) represents how relevant an Order Block is to the current price interaction.
A distant Order Block is therefore not automatically labeled as the most important trading zone simply because it had a high initial quality score.
Only Order Blocks in the APPROACH or IN ZONE states are eligible for ACTION #1 or ACTION #2.
A FRESH zone that is still too far from current price can remain a RESERVE zone.
A completed HOLD also returns to reserve status rather than continuously encouraging entries after the original reaction has already occurred.
If opposing bullish and bearish actionable zones have similar scores, the indicator can display a WAIT condition instead of presenting a small numerical difference as a meaningful directional advantage.
Conflict-aware Order Blocks
Active bullish and bearish Order Blocks are not evaluated independently.
The script checks whether an opposing Order Block overlaps the current zone or is located close enough to interfere with the expected reaction path.
Strong and nearby opposing zones reduce the structural score of the affected Order Block. Multiple opposing zones can create an additional conflict penalty.
This allows the indicator to distinguish between a structurally isolated Order Block and one that is operating inside a congested bullish/bearish conflict area.
Repeated-test depletion
Order Blocks are not assumed to retain the same strength indefinitely.
A separate retest counter tracks independent interactions with each zone. Multiple consecutive candles remaining inside the same zone are treated as one interaction rather than multiple independent tests.
For another test to be counted, price must first leave the interaction and later return to the Order Block.
The default progressive depletion model is:
T1 - first successful test, no additional depletion.
T2 - moderate structural reduction.
T3 - stronger structural reduction.
T4 - substantial structural reduction.
T5+ - additional progressive depletion up to the configured maximum.
This mechanism is intended to represent the idea that repeatedly tested liquidity or order-flow areas may become less structurally significant as they are revisited.
The depletion values are scoring adjustments. They should not be interpreted as measured probabilities of failure.
Live warnings versus confirmed states
The indicator deliberately separates confirmed lifecycle information from intrabar warnings.
The confirmed state may continue to display HOLD, IN ZONE, or another locked state while the current realtime candle is still open.
AT RISK is a realtime warning that price is approaching the Order Block's invalidation boundary.
LIVE BREAK indicates that the current unconfirmed candle is temporarily trading beyond the relevant invalidation boundary.
These live warnings can appear and disappear while the realtime candle is forming. They do not by themselves rewrite the confirmed lifecycle of the Order Block.
With close-based invalidation, an Order Block is not permanently invalidated until the relevant candle closes beyond the zone boundary.
With wick-based invalidation, the configured wick condition is used instead.
Active Order Block Market Bias panel
The information panel in the upper-right corner summarizes the current balance between active bullish and bearish Order Blocks.
MARKET displays BULLISH, BEARISH, or NEUTRAL.
BULL DOM shows the bullish share of the active Order Block dominance calculation.
BEAR DOM shows the bearish share.
ACTIVE displays the number of active bullish and bearish Order Blocks.
TOP BULL identifies the strongest currently relevant bullish Order Block score and state.
TOP BEAR provides the equivalent information for bearish Order Blocks.
EDGE displays the difference between bullish and bearish dominance.
The market-bias calculation does not simply count bullish and bearish boxes. Each active Order Block is weighted according to its structural or actionable score, lifecycle state, and proximity to price. Conflict and repeated-test depletion are already reflected in the underlying structural evaluation.
An IN ZONE Order Block therefore contributes more immediate contextual importance than a distant and heavily depleted historical Order Block.
The Bull and Bear Dominance percentages are relative Order Block dominance measurements. They are not probabilities that price will rise or fall, and they should not be interpreted as expected win rates.
Scoring terminology
Q represents formation quality based on the qualifying contextual conditions available when the Order Block is identified.
RP is an internal reversal-power score derived from formation quality, Order Block size characteristics, and displacement strength.
S is the current Structural Score.
A is the current Action Score.
T1, T2, T3, etc. represent independent confirmed tests of a previously held Order Block.
ACTION #1 is the highest-ranked currently actionable Order Block.
ACTION #2 is the second-ranked actionable Order Block when available.
RESERVE identifies a structurally relevant zone that is not currently considered an immediate actionable interaction.
WAIT indicates that opposing actionable Order Blocks are sufficiently close in ranking that the script does not assign a meaningful directional advantage.
Intended use
The indicator is designed as a discretionary market-structure and context tool rather than an automated trading strategy.
On a 5-minute cryptocurrency chart, traders can use it to identify active demand and supply areas, observe whether price is approaching or testing those areas, compare opposing Order Block strength, recognize repeatedly tested/depleted zones, and monitor whether active Order Block structure currently favors the bullish side, bearish side, or neither side.
The indicator does not generate orders, calculate position size, or provide a complete risk-management system.
Calculation and repainting considerations
Order Block creation requires confirmed structural conditions. Historical Order Block boundaries are based on already available candle data and are stored when the zone is created.
Confirmed lifecycle transitions such as retests, holds, and close-based invalidations are evaluated using confirmed bars.
The realtime AT RISK and LIVE BREAK warnings are intentionally intrabar and can therefore change before the current candle closes. This behavior is expected and is visually separated from confirmed lifecycle states.
Users should distinguish between a confirmed state and a realtime warning when interpreting the chart.
Limitations
Order Blocks are subjective market-structure concepts and there is no universally accepted mathematical definition of the exact boundaries or validity of an Order Block.
ATR thresholds, structure lookbacks, zone construction methods, displacement requirements, and optional confirmation filters can materially affect which zones are detected.
Cryptocurrency volatility can also change significantly across symbols and market regimes. Settings appropriate for one asset or period may not behave identically on another.
A high Quality, Structural, Action, RP, Bull Dominance, or Bear Dominance value does not guarantee that price will react from a zone.
The indicator does not account for every possible source of market information, including news, fundamental events, exchange-specific liquidity conditions, hidden orders, or external derivatives positioning.
For these reasons, the indicator should be used as one component of a broader analysis and risk-management process rather than as a standalone prediction system.
What is different about this implementation
Instead of displaying every detected Order Block with equal importance, this implementation maintains a lifecycle for each zone and continually differentiates between formation quality, structural relevance, immediate action relevance, opposing-zone conflict, and repeated-use depletion.
Its state-locked FRESH / APPROACH / IN ZONE / HOLD workflow, progressive T1/T2/T3/T4 depletion model, conflict-aware scoring, live-warning separation, and active Order Block dominance panel are designed to reduce visual ambiguity and make the changing condition of each active zone easier to interpret.
Recommended starting context
The default parameters were designed with 5-minute cryptocurrency analysis in mind. They are starting values, not universally optimal settings. Users should evaluate the script on the symbol, timeframe, market conditions, and execution method relevant to their own analysis.
This indicator is provided for analytical and educational purposes. It does not constitute investment advice, does not guarantee future results, and does not claim that any displayed score represents a future return or a statistically guaranteed probability. 지표

지표

Adaptive T3 Hull [BackQuant]Adaptive T3 Hull
Overview
Adaptive T3 Hull is a configurable trend-following overlay that combines the lag-compensation structure of a Hull-style moving average with T3 smoothing and several optional mechanisms designed specifically to control overshoot, hooks and oscillating tails.
A conventional Hull construction gains responsiveness by comparing a faster and slower smoother, extrapolating their difference, and then smoothing the result again. This can produce a very responsive trend estimate, but the same lag compensation responsible for that responsiveness can also create exaggerated curvature around sharp reversals.
Adaptive T3 Hull makes that trade-off directly controllable.
The indicator replaces the traditional weighted-moving-average Hull stages with T3 smoothers and expands the basic Hull architecture with:
Adjustable fast/slow length relationships.
Adjustable Hull lag compensation.
Configurable final smoothing geometry.
Curvature-sensitive tail damping.
Optional asymmetric damping around turns.
An adaptive T3 volume factor.
An optional ATR-based velocity limiter.
Optional final lag compensation.
Trend-strength-dependent ribbon intensity.
Tail and curvature diagnostics in the Data Window.
The result is not intended to reproduce a standard HMA exactly. It is a generalized Hull-style framework in which the user can explicitly control the balance between responsiveness, smoothness and overshoot.
Core idea
Most trend smoothers face the same fundamental compromise:
More smoothing reduces noise but increases lag.
More lag compensation improves responsiveness but can create overshoot.
The Hull concept addresses lag by comparing a fast smoother with a slower smoother and projecting the difference forward.
A generalized form can be written as:
Hull Raw = Fast + Compensation × (Fast - Slow)
If Compensation is zero:
Hull Raw = Fast
No additional lag compensation is applied.
If Compensation is one:
Hull Raw = 2 × Fast - Slow
This reproduces the familiar compensation structure used in the standard Hull Moving Average.
Values between zero and one provide partial compensation.
Adaptive T3 Hull defaults to a substantially smaller compensation value. This is deliberate. It reduces the tendency for the projected line to extend beyond the fast smoother during sharp changes in direction.
The remaining responsiveness can then be controlled using the fast-length ratio, T3 characteristics and optional final generalization rather than relying entirely on aggressive Hull extrapolation.
Processing chain
The complete indicator can be understood as the following sequence:
Select the source and main Hull Length.
Derive a fast T3 length from the Fast Length Ratio.
Derive a final smoothing length from a configurable power-law relationship.
Calculate fast and slow T3 smoothers.
Measure velocity and curvature of the fast T3.
Normalize curvature using ATR.
Optionally reduce the active T3 Volume Factor during high curvature.
Recalculate the fast and slow T3 legs with the adaptive factor.
Measure the active curvature state.
Optionally reduce Hull compensation when curvature increases.
Construct the compensated fast-minus-slow T3 Hull.
Smooth that result through another T3 stage.
Optionally apply a final generalized lag-compensation stage.
Optionally limit extreme one-bar movement using ATR.
Determine trend from the final line slope.
Build a smoothed one-bar-offset ribbon around the result.
Each stage affects a different part of the lag-versus-overshoot problem.
T3 smoothing
The T3 is a multi-stage recursive smoother constructed from a sequence of exponential moving averages.
The script calculates six EMA stages:
E1 = EMA(Source)
E2 = EMA(E1)
E3 = EMA(E2)
E4 = EMA(E3)
E5 = EMA(E4)
E6 = EMA(E5)
Those stages are then combined using coefficients derived from the T3 Volume Factor.
The final T3 has the general form:
T3 = C1×E6 + C2×E5 + C3×E4 + C4×E3
where C1 through C4 change with the Volume Factor.
This construction allows T3 smoothing to maintain substantial smoothness while using coefficient-based compensation to reduce some of the lag created by repeated EMA filtering.
Important: T3 Volume Factor does not use trading volume
Despite its name, the T3 Volume Factor is not calculated from market volume.
It is a coefficient controlling the internal T3 response.
Changing it does not incorporate:
Exchange volume.
Volume profile.
OBV.
Money flow.
It changes how aggressively the internal EMA stages are combined.
Higher values generally increase compensation and responsiveness, but can also increase overshoot.
Lower values generally produce a more restrained and smoother response.
This relationship is particularly important in this indicator because Hull compensation and T3 compensation can interact.
An aggressive T3 followed by aggressive Hull extrapolation can produce substantially more tail behaviour than either technique alone.
Why combine T3 and Hull logic?
Hull-style smoothing and T3 smoothing approach lag reduction differently.
The Hull architecture uses:
A fast smoother.
A slow smoother.
The difference between them.
A final smoothing stage.
T3 uses:
Multiple recursive EMA stages.
A coefficient-controlled combination of those stages.
Adaptive T3 Hull combines both ideas.
Instead of:
Fast WMA.
Slow WMA.
Final WMA.
the indicator uses:
Fast T3.
Slow T3.
Compensated difference.
Final T3.
This produces a smoother underlying structure while retaining the ability to compensate for lag.
However, combining two lag-reduction mechanisms also makes overshoot control more important. Much of the indicator is therefore devoted to regulating that compensation dynamically.
Hull Length
Hull Length establishes the main smoothing horizon.
It is used to derive:
The slow T3 length.
The fast T3 length.
The final smoothing length.
Lower values:
React more quickly.
Track shorter trend changes.
Increase sensitivity to local curvature.
Can generate more frequent directional flips.
Higher values:
Produce broader trend estimates.
Reduce short-term variation.
Increase response delay.
Generally produce more persistent regimes.
Unlike a standard HMA, the relationship between these three smoothing stages is not fixed.
Fast Length Ratio
The fast T3 length is calculated as:
Fast Length = Hull Length × Fast Length Ratio
with the result rounded to a valid integer.
In a conventional Hull structure, the fast stage normally uses approximately half the main length.
Therefore:
Fast Length Ratio = 0.50
reproduces the familiar half-length relationship.
The default configuration uses a larger ratio, making the fast leg closer in length to the slow leg.
This matters because the difference:
Fast T3 - Slow T3
is the quantity used for lag compensation.
If the fast and slow stages are very different:
Their separation can become larger.
Hull compensation becomes stronger.
The resulting line can react faster.
Overshoot potential increases.
If their lengths are closer:
Their separation becomes smaller.
The compensation term becomes more restrained.
The final line generally becomes smoother.
Fast Length Ratio is therefore another direct control over the aggressiveness of the Hull projection.
Hull Compensation
Hull Compensation controls how much of the fast-versus-slow difference is added back to the fast T3.
The underlying formula is:
Hull Raw = Fast T3 + Effective Compensation × (Fast T3 - Slow T3)
Before adaptive damping is applied, Effective Compensation begins from the Hull Compensation input.
Compensation = 0
The raw line becomes the fast T3 itself.
No Hull-style extrapolation occurs.
Compensation = 1
The calculation becomes:
2 × Fast T3 - Slow T3
which matches the standard Hull lag-compensation form.
Compensation between 0 and 1
Only part of the fast-slow separation is extrapolated.
This creates a middle ground between:
Pure fast smoothing.
Full Hull compensation.
Compensation above 1
The difference is extrapolated even more aggressively than a conventional Hull construction.
This can create a highly responsive line, but it also increases the likelihood of:
Overshoot.
Hooks.
Large tails after sharp turns.
The default is intentionally conservative relative to a standard Hull.
What are Hull tails?
Hull-style moving averages can develop a distinctive oscillating or hooked appearance around strong reversals.
This occurs because the lag-compensation term is effectively extrapolating the difference between two smoothers.
Imagine the fast smoother accelerating upward while the slow smoother is still catching up.
The difference:
Fast - Slow
becomes positive.
Adding that difference to the fast smoother projects the result even further upward.
When price abruptly reverses, the fast smoother begins turning first while the slow smoother remains elevated.
The compensation term can then change rapidly and cause the completed Hull to:
Extend beyond the fast line.
Hook sharply.
Reverse with excessive curvature.
This is not necessarily an error in the Hull formula. It is a consequence of aggressive lag compensation.
Adaptive T3 Hull includes several independent tools for reducing this behaviour.
Final Hull smoothing
After the fast and slow T3 legs are combined, the raw Hull is smoothed again.
The final smoothing length is calculated from:
Length^Hull Smoothing Exponent × Final Smoothing Multiplier
This generalizes the standard Hull square-root stage.
A conventional HMA normally uses approximately:
sqrt(Length)
which is equivalent to:
Length^0.50
before rounding.
Hull Smoothing Exponent
The Hull Smoothing Exponent controls how strongly the final smoothing length grows as the main Hull Length increases.
Exponent = 0.50
Reproduces the square-root relationship used in the conventional Hull construction.
Exponent below 0.50
Produces a shorter final smoothing stage, particularly at larger main lengths.
This generally:
Increases responsiveness.
Allows more of the compensated movement through.
Exponent above 0.50
Creates a longer final smoothing stage.
This generally:
Reduces local variation.
Smooths more aggressively.
Adds response delay.
The script allows this relationship to be generalized instead of forcing the standard square-root rule.
Final Smoothing
Final Smoothing applies an additional multiplier to the derived root length:
Final Length = Length^Exponent × Root Multiplier
This gives a second level of control over the final stage without changing the underlying power-law relationship.
Higher values:
Increase final smoothing.
Reduce local hooks.
Slow the line.
Lower values:
Decrease final smoothing.
Increase responsiveness.
Allow more short-term curvature through.
The Smoothing Exponent controls how smoothing scales with Hull Length.
The Final Smoothing multiplier controls the overall magnitude of that final stage.
Curvature measurement
Adaptive tail damping requires a way to determine when the fast T3 is changing direction unusually quickly.
The indicator first calculates velocity:
Velocity = Fast T3 - Previous Fast T3
Previous velocity is:
Previous Velocity = Previous Fast T3 - Fast T3 two bars ago
Curvature is then approximated as the absolute change in velocity:
Curvature = |Velocity - Previous Velocity|
This is a discrete second-difference concept.
Velocity describes how quickly the smoother is moving.
Curvature describes how quickly that velocity itself is changing.
For example:
A steadily rising line can have positive velocity but low curvature.
A line suddenly flattening after a strong rise can have high curvature.
A sharp reversal can produce very high curvature.
This makes curvature particularly useful for detecting the conditions in which Hull overshoot tends to appear.
ATR normalization
Raw curvature is not directly comparable across instruments.
A $10 curvature movement is enormous for one market and negligible for another.
The script therefore normalizes curvature using ATR:
Normalized Curvature = Curvature / ATR
The result is capped at 1.
This creates an adaptive pressure measure between approximately:
0 = little curvature relative to recent range.
1 = very large curvature relative to recent range.
ATR is calculated using the Damping Normalization length.
This normalized curvature drives several optional adaptive mechanisms.
Damping Normalization
Damping Normalization controls the ATR period used when converting curvature into a relative value.
Short values:
Make the normalization respond rapidly to current volatility.
Allow damping pressure to change quickly.
Longer values:
Create a more stable volatility baseline.
Reduce rapid changes in normalized curvature.
This setting does not smooth the final T3 Hull directly.
It changes how the adaptive systems interpret curvature.
Adaptive Tail Damping
Adaptive Tail Damping dynamically reduces Hull Compensation when curvature becomes large.
The process can be summarized as:
Effective Compensation = Hull Compensation × (1 - Damping Pressure × Damping Strength)
When curvature is low:
Damping Pressure approaches zero.
Effective Compensation remains close to the selected Hull Compensation.
When curvature becomes large:
Damping Pressure increases.
Effective Compensation is reduced.
This means the indicator deliberately removes some of its lag compensation precisely when the fast T3 is bending sharply.
Why reduce compensation during curvature?
Hull compensation is most useful when the fast and slow smoothers are moving consistently in the same directional structure.
During a smooth trend:
The fast line leads the slow line.
Their separation can be used to reduce lag.
During a sharp turn:
The fast line may reverse before the slow line.
Their separation can become a poor estimate of useful forward compensation.
Extrapolating the full difference can create overshoot.
Adaptive damping therefore treats high curvature as a reason to trust the Hull extrapolation less.
Damping Strength
Damping Strength determines how much curvature can reduce Hull compensation.
At zero:
Curvature has no effect on compensation.
As the value increases:
High-curvature events remove progressively more compensation.
The line becomes more restrained around sharp turns.
At a Damping Strength of 1 and maximum normalized curvature, compensation can theoretically be reduced all the way toward zero.
This does not stop the underlying T3 from moving.
It removes the additional Hull extrapolation.
Asymmetric Turn Damping
By default, curvature damping can apply whenever the fast T3 experiences significant curvature.
Asymmetric Turn Damping makes the condition more selective.
When enabled, damping pressure is only applied when the current velocity is moving against the previous directional pace.
Conceptually:
A previously rising fast T3 is damped when its upward velocity begins weakening or reversing.
A previously falling fast T3 is damped when its downward velocity begins weakening or reversing.
This allows strong acceleration in the existing direction to retain more compensation while focusing the damping mechanism around deceleration and turning behaviour.
The purpose is to distinguish:
Curvature caused by trend acceleration.
Curvature caused by trend exhaustion or reversal.
This can preserve responsiveness during strong continuation while still suppressing tails around turns.
Adaptive T3 Volume Factor
Adaptive T3 Volume Factor provides a second curvature-sensitive damping mechanism.
Instead of changing the Hull compensation, this feature changes the internal T3 coefficient itself.
The active factor is approximately:
Active VF = Base VF × (1 - Normalized Curvature × VF Damping Strength)
subject to the configured minimum.
When curvature is low:
Active VF remains near the selected T3 Volume Factor.
When curvature rises:
Active VF is reduced.
The T3 becomes less aggressively compensated.
This attacks overshoot earlier in the processing chain.
Hull damping versus VF damping
The two mechanisms affect different stages.
Adaptive Tail Damping
changes how much:
Fast T3 - Slow T3
is extrapolated.
Adaptive T3 Volume Factor
changes how the T3 smoothers themselves are constructed.
Using both means curvature can reduce:
The aggressiveness of each T3 leg.
The aggressiveness of the Hull compensation between those legs.
This can strongly suppress tails but may also reduce responsiveness.
The controls are therefore optional and independently adjustable.
VF Damping Strength
VF Damping Strength controls how strongly curvature reduces the T3 Volume Factor.
Higher values:
Produce larger reductions during sharp curvature.
Increase smoothing around turns.
Can reduce T3 overshoot more aggressively.
Lower values:
Keep Active VF closer to the base setting.
Preserve more of the original T3 response.
Minimum VF
Minimum VF prevents the adaptive mechanism from reducing the active coefficient indefinitely.
It defines the lower bound used when Adaptive T3 Volume Factor is active.
This keeps the filter within a controlled response range during extreme curvature.
If the selected base Volume Factor is already below the requested minimum, the script does not force it upward above the base value.
Generalize Final Hull
Generalize Final Hull adds another optional lag-compensation stage after the main T3 Hull has already been completed.
A second smoothed version of the completed Hull is calculated.
The final target then becomes:
Hull Target = Hull Base + Generalization × (Hull Base - Second Hull)
This uses the same broad idea as Hull compensation:
Compare a faster estimate with a slower version.
Add part of their difference back to the faster estimate.
At zero Generalization:
The stage has no effect.
As Generalization increases:
The final result becomes more responsive.
Lag is reduced further.
Overshoot potential increases.
This option exists because the earlier tail controls allow the user to reduce aggressive compensation in the main Hull construction and, if desired, reintroduce a smaller amount of controlled responsiveness at the end.
Generalization
Generalization controls the amount of final compensation.
Lower values create subtle lag reduction.
Higher values increasingly extrapolate the difference between the first and second completed Hull smoothers.
This feature should be considered one of the more aggressive responsiveness controls in the indicator.
If the objective is maximum tail suppression, it can be left disabled.
Velocity Limiter
The Velocity Limiter addresses a different problem.
Curvature damping changes how the line is calculated.
The Velocity Limiter places a direct cap on how far the completed line is allowed to move in one bar.
The maximum permitted movement is:
Maximum Step = ATR × Max ATR / Bar
The desired change is:
Delta = Hull Target - Previous T3 Hull
That change is clamped between:
-Maximum Step
+Maximum Step
The final T3 Hull then advances by only the permitted amount.
Why use a velocity limiter?
Occasionally, a large price shock or a combination of aggressive settings can cause the completed Hull target to jump sharply.
The limiter acts as a final mechanical speed limit.
It can reduce:
Single-bar jumps.
Extreme hooks.
Shock-driven movement.
However, this comes with a clear trade-off.
If the market genuinely reprices very quickly, the limiter deliberately prevents the trend line from following the full move immediately.
It therefore introduces controlled lag.
Max ATR / Bar
This setting determines the maximum permitted single-bar movement in ATR units.
For example:
0.35 allows the completed line to move by no more than 0.35 ATR in one bar.
Lower values:
Create stronger movement suppression.
Produce smoother transitions.
Can significantly delay response to genuine breaks.
Higher values:
Interfere less often.
Allow larger legitimate moves.
The limiter is disabled by default because it is a strong constraint.
How the tail controls work together
The script provides several different ways to reduce tail behaviour because overshoot can originate at multiple stages.
Fast Length Ratio
Reduces fast-versus-slow separation.
Hull Compensation
Directly controls extrapolation of that separation.
Final Smoothing
Smooths the compensated output more heavily.
Adaptive Tail Damping
Reduces Hull compensation during curvature.
Asymmetric Turn Damping
Restricts that damping mainly to deceleration and turning behaviour.
Adaptive T3 Volume Factor
Makes the underlying T3 calculations more conservative during curvature.
Velocity Limiter
Caps the final single-bar movement.
Generalization
Moves in the opposite direction by optionally adding some final lag compensation back.
These controls are intentionally modular.
A user does not need to enable all of them.
Default design philosophy
The default settings intentionally do not reproduce a standard Hull Moving Average.
A standard Hull-like configuration would approximately use:
Fast Length Ratio near 0.50.
Hull Compensation near 1.00.
Hull Smoothing Exponent near 0.50.
Final Smoothing near 1.00.
The default Adaptive T3 Hull uses a much more restrained compensation structure.
This shifts the design away from maximum lag cancellation and toward smoother trend tracking with reduced tail behaviour.
The advanced controls then allow users to progressively move the model toward either:
More responsiveness.
More stability.
Trend determination
Trend direction is determined directly from the slope of the completed T3 Hull.
If:
Current T3 Hull > Previous T3 Hull
the direction becomes bullish.
If:
Current T3 Hull < Previous T3 Hull
the direction becomes bearish.
If the line is unchanged:
The previous state persists.
The trend does not depend on price crossing the line.
It depends on whether the adaptive T3 Hull itself is rising or falling.
Long and short signals
A long signal occurs when direction changes into the bullish state.
A short signal occurs when direction changes into the bearish state.
The markers therefore identify:
A change in slope regime.
They do not represent:
Guaranteed entries.
Price targets.
Stop levels.
Because the signal is based on local slope, more responsive configurations will naturally produce more flips during sideways conditions.
Ribbon construction
The optional band is not a conventional upper-and-lower volatility channel.
The main line is the current T3 Hull.
The secondary ribbon reference is calculated from a smoothed version of the previous-bar T3 Hull :
Ribbon Reference = WMA(T3 Hull , Band Smoothing)
The area between these two lines is filled with a gradient.
This creates visual separation between:
The current adaptive trend estimate.
A delayed and smoothed reference to its prior values.
The band therefore functions as a trend ribbon rather than a statistical volatility envelope.
Band Smoothing
Band Smoothing controls the WMA applied to the one-bar-offset Hull series.
Lower values:
Keep the ribbon reference close to the main line.
Produce a tighter band.
Respond quickly to direction changes.
Higher values:
Create a slower reference.
Widen the visual separation during sustained movement.
Create a smoother ribbon.
This input affects the visualization only.
It does not change:
The T3 Hull calculation.
Trend direction.
Signals.
Trend Strength
The indicator also calculates a normalized trend-velocity measure for visualization.
Raw strength is based on:
|Current T3 Hull - Previous T3 Hull| / ATR
and is multiplied by the Strength Sensitivity input.
The result is capped at 1 and then smoothed with an EMA.
This produces a normalized value from approximately:
0 = very little line movement relative to ATR.
1 = strong line movement relative to ATR.
This is a measure of trend-line velocity , not a statistical probability that the trend will continue.
Strength Smoothing
Strength Smoothing controls how quickly the visual strength estimate changes.
Lower values:
React quickly to acceleration and deceleration.
Create faster ribbon-intensity changes.
Higher values:
Produce steadier strength visualization.
Reduce flickering in the gradient.
It does not affect the underlying trend calculation.
Strength Sensitivity
Strength Sensitivity determines how quickly line velocity reaches the maximum normalized strength.
Higher values:
Cause smaller ATR-normalized movement to appear strong.
Increase gradient intensity more easily.
Lower values:
Require greater movement before maximum visual intensity is reached.
Strength-Weighted Gradient
When disabled, the ribbon uses a fixed gradient transparency.
When enabled, gradient intensity changes with Trend Strength.
As the T3 Hull moves more quickly relative to ATR:
The near portion of the ribbon becomes more visible.
The broader gradient becomes stronger.
When trend velocity is weak:
The ribbon becomes more subdued.
This is purely a visualization feature.
It does not alter:
Direction.
Signals.
Smoothing.
Tail damping.
Trend candles
The indicator can recolor the main chart candles according to the active T3 Hull slope state.
Bullish trend = selected Long Color.
Bearish trend = selected Short Color.
The candle colour describes the indicator regime, not the individual candle’s own open-to-close direction.
A bearish candle can therefore remain bullish-coloured while the T3 Hull is still rising.
Tail diagnostics
Several internal values are exposed in TradingView’s Data Window.
These provide insight into how the adaptive model is currently behaving.
Effective Hull Compensation
Shows the compensation actually being used after adaptive tail damping.
If adaptive damping is disabled:
It remains equal to Hull Compensation.
If damping is active:
It falls below the base value when curvature pressure increases.
This is useful for seeing when the indicator is automatically becoming more conservative.
Active T3 Volume Factor
Shows the T3 coefficient currently being used.
If Adaptive T3 Volume Factor is disabled:
It remains equal to the base Volume Factor.
When enabled:
It can decrease during high curvature.
Normalized Curvature
Shows the current curvature estimate after ATR normalization.
Values closer to 1 represent greater changes in fast-T3 velocity relative to recent range.
Trend Strength
Shows the smoothed normalized T3 Hull velocity as a percentage.
This is the same quantity used by the optional Strength-Weighted Gradient.
Tail Overshoot
The script also measures whether the final T3 Hull has extended beyond the fast T3 in the direction of the fast/slow separation.
An upper overshoot occurs when:
Fast T3 is above Slow T3.
Completed T3 Hull is above Fast T3.
A lower overshoot occurs when:
Fast T3 is below Slow T3.
Completed T3 Hull is below Fast T3.
When this happens, Tail Overshoot reports:
|T3 Hull - Fast T3| / ATR
This expresses the size of the overshoot in ATR units.
A value of zero means the completed Hull is not currently beyond the fast T3 under that definition.
This diagnostic is particularly useful when tuning:
Hull Compensation.
Damping Strength.
Fast Length Ratio.
Adaptive VF.
Final Smoothing.
Generalization.
How to interpret the indicator
Rising T3 Hull
A rising line indicates a bullish trend state.
The model’s completed combination of T3 smoothing, Hull compensation and any active damping controls is moving upward.
Falling T3 Hull
A falling line indicates a bearish trend state.
Smooth persistent slope
A stable slope with few direction changes generally indicates a cleaner trend environment for this style of filter.
Frequent colour changes
Rapid bullish/bearish transitions generally indicate:
Sideways price action.
A very responsive configuration.
Insufficient smoothing for the current market.
High normalized curvature
High curvature means the fast T3’s velocity is changing rapidly relative to ATR.
If adaptive controls are enabled, this is where:
Hull compensation may decrease.
T3 Volume Factor may decrease.
High tail overshoot
A larger Tail Overshoot value indicates the completed Hull has moved materially beyond the fast T3.
If the objective is a less tail-heavy line, possible adjustments include:
Reduce Hull Compensation.
Increase Final Smoothing.
Increase Fast Length Ratio.
Increase Damping Strength.
Enable Adaptive T3 Volume Factor.
Reduce or disable Generalization.
Enable the Velocity Limiter.
How to use the indicator
1. Trend regime filter
The most direct use is as a slope-based regime filter:
Rising T3 Hull = bullish trend state.
Falling T3 Hull = bearish trend state.
This can be combined with independent entry logic.
2. Trend transition signals
Long and short markers identify when the adaptive line changes slope direction.
These can be used as:
Regime-change alerts.
Confirmation for another setup.
Potential trailing-exit conditions.
They are not standalone guarantees of a sustained reversal.
3. Pullback reference
During a persistent trend, the T3 Hull can act as a smoothed directional reference.
Price returning toward the line while the line continues to slope in the original direction may represent a pullback within the existing regime.
4. Ribbon expansion
The distance between the current T3 Hull and its delayed WMA reference can visually highlight persistent movement.
A stronger ribbon separation can occur when the current adaptive trend estimate is moving away from its delayed historical reference.
5. Tail tuning
The Data Window diagnostics allow the indicator to be treated as a filter-design tool.
Users can observe:
When compensation is being damped.
How strongly curvature is elevated.
Whether the completed line is overshooting.
How the active T3 coefficient changes.
This can make parameter changes easier to understand than tuning solely by appearance.
Suggested tuning approaches
Smooth / reduced-tail configuration
For a calmer trend line:
Use lower Hull Compensation.
Use a larger Fast Length Ratio.
Increase Final Smoothing.
Enable Adaptive Tail Damping.
Use moderate or higher Damping Strength.
Leave Generalization disabled.
If strong shocks still create large movements:
Enable the Velocity Limiter.
Responsive configuration
For faster behaviour:
Reduce Fast Length Ratio toward the traditional half-length relationship.
Increase Hull Compensation.
Reduce Final Smoothing.
Reduce the Hull Smoothing Exponent.
Use a more aggressive T3 Volume Factor.
These changes generally increase overshoot risk.
Adaptive configuration
For responsiveness in normal conditions with additional protection near turns:
Use moderate Hull Compensation.
Enable Adaptive Tail Damping.
Enable Asymmetric Turn Damping.
Optionally enable Adaptive T3 Volume Factor.
This allows stronger compensation during smooth directional movement while automatically reducing it when the line begins to decelerate or turn.
Maximum tail-control configuration
For very aggressive tail suppression:
Low Hull Compensation.
Higher Final Smoothing.
Adaptive Tail Damping enabled.
Higher Damping Strength.
Adaptive T3 Volume Factor enabled.
Generalization disabled.
Velocity Limiter enabled.
This can create a very stable line, but the cost is additional lag.
How this differs from a standard Hull Moving Average
A conventional HMA normally uses:
WMA at half length.
WMA at full length.
2 × Fast - Slow lag compensation.
Final WMA around sqrt(Length).
Adaptive T3 Hull changes every major part of that architecture:
T3 replaces WMA.
Fast Length Ratio is configurable.
Hull Compensation is configurable.
The final smoothing exponent is configurable.
Final smoothing has an additional multiplier.
Compensation can adapt to curvature.
T3 behaviour can adapt to curvature.
Final movement can be ATR-limited.
An additional generalized compensation stage can be enabled.
It is therefore better understood as a generalized adaptive Hull framework than as a conventional HMA with a different smoothing length.
How this differs from a normal T3
A standard T3 produces one smoothed price estimate from repeated EMA stages and a fixed Volume Factor.
Adaptive T3 Hull uses multiple T3 calculations in a Hull-style structure:
Fast T3.
Slow T3.
Compensated fast-slow projection.
Final T3 smoothing.
It can also dynamically alter the T3 factor according to curvature.
The T3 is therefore a building block inside the larger trend model.
How this differs from simply smoothing an HMA
Applying an additional moving average to an HMA can reduce its tails, but it also adds lag after the overshoot has already occurred.
Adaptive T3 Hull attacks the problem at several earlier stages.
It can:
Reduce the fast-slow separation.
Reduce compensation itself.
Reduce compensation specifically around sharp turns.
Reduce the T3 factor during curvature.
Change the final Hull smoothing geometry.
Limit extreme final movement.
This provides more control than applying one additional smoothing layer to a completed HMA.
Parameter interaction
Many settings interact strongly.
Fast Ratio + Hull Compensation
A low Fast Ratio creates greater separation between fast and slow legs.
Combining that with high Hull Compensation can produce aggressive extrapolation.
Hull Compensation + Adaptive Damping
Hull Compensation defines the maximum starting compensation.
Adaptive damping determines how much of it survives during curvature.
T3 Volume Factor + Hull Compensation
Both can contribute to lag reduction.
High values in both stages may amplify overshoot.
Final Smoothing + Generalization
Final Smoothing adds lag and stability.
Generalization removes some of that lag again.
Using both allows the user to create a smooth base and then selectively reintroduce responsiveness.
Adaptive VF + Adaptive Hull Damping
Both respond to curvature but at different stages.
Enabling both can create strong protection around turns.
Velocity Limiter + all other controls
The Velocity Limiter is applied near the end of the pipeline.
It can therefore override an aggressive target generated by the preceding calculations.
Input guide
Source
Price series used by the complete indicator.
Hull Length
Primary calculation horizon.
T3 Volume Factor
Controls the internal T3 coefficient structure. It does not use trading volume.
Hull Compensation
Controls how much of the fast-minus-slow T3 separation is added to the fast T3.
Final Smoothing
Multiplies the final Hull smoothing length.
Adaptive Tail Damping
Reduces Hull Compensation during high curvature.
Damping Strength
Controls the amount of compensation reduction.
Damping Normalization
ATR horizon used to normalize curvature.
Fast Length Ratio
Controls the fast T3 length relative to the main Hull Length.
Hull Smoothing Exponent
Controls the power-law relationship used to derive the final smoothing length.
Asymmetric Turn Damping
Restricts curvature damping primarily to deceleration and turning behaviour.
Adaptive T3 Volume Factor
Reduces the T3 coefficient during high curvature.
VF Damping Strength
Controls how strongly curvature reduces the active T3 factor.
Minimum VF
Limits how far the adaptive T3 factor can be reduced.
Velocity Limiter
Caps final one-bar T3 Hull movement using ATR.
Max ATR / Bar
Defines the maximum movement allowed by the Velocity Limiter.
Generalize Final Hull
Enables an additional lag-compensation stage after the main T3 Hull.
Generalization
Controls the strength of that final compensation.
Strength-Weighted Gradient
Allows ribbon intensity to vary with normalized T3 Hull velocity.
Strength Smoothing
Smooths the visual trend-strength measure.
Sensitivity
Controls how quickly ATR-normalized movement reaches maximum visual strength.
Band Smoothing
Controls the delayed WMA reference used to build the ribbon.
Strengths
Combines T3 smoothing with a generalized Hull framework.
Directly exposes Hull lag compensation as a user control.
Provides multiple independent methods for reducing oscillating tails.
Uses ATR-normalized curvature for adaptive behaviour.
Can distinguish general curvature from decelerating/turning curvature.
Can adapt the T3 coefficient as well as Hull compensation.
Allows the standard Hull square-root smoothing relationship to be generalized.
Includes an optional ATR-based velocity limiter.
Provides optional final lag compensation for advanced tuning.
Includes real-time tail and curvature diagnostics.
Provides trend-strength-reactive visualization without altering signals.
Limitations
The indicator remains a reactive trend filter rather than a predictive model.
Increasing lag compensation generally increases overshoot risk.
Aggressive tail suppression generally increases lag.
Slope-based signals can whipsaw in ranging markets.
The large number of controls creates many interacting parameter combinations.
Over-tuning parameters to one asset or historical period can reduce robustness elsewhere.
The Velocity Limiter can delay response to genuine price shocks.
Generalization can reintroduce overshoot that earlier damping stages removed.
Trend Strength measures line velocity, not probability of continuation.
Tail Overshoot is a diagnostic relative to the fast T3, not a trading signal.
Causality and real-time behaviour
The calculations use current and historical data without intentional future references.
The indicator can therefore be evaluated causally on completed bars.
However, on a live unfinished candle:
The source can change.
The T3 stages can change.
Curvature can change.
Adaptive compensation can change.
The final slope can change.
A long or short signal can appear or disappear before bar close.
Users requiring confirmed trend transitions should evaluate signals on completed candles.
Alerts
The indicator includes three alert conditions:
T3 Hull Long: the completed T3 Hull changes into a rising trend state.
T3 Hull Short: the completed T3 Hull changes into a falling trend state.
T3 Hull Signal: either directional transition occurs.
Summary
Adaptive T3 Hull is a generalized trend smoother built around the idea that Hull-style lag compensation does not need to be fixed.
The model begins with fast and slow T3 smoothers rather than traditional WMAs. Their difference is used to compensate the fast T3 for lag, but the amount of compensation is directly configurable.
This alone allows the user to move continuously between:
A restrained fast T3.
A partially compensated Hull structure.
A conventional 2×fast-minus-slow construction.
More aggressive extrapolation.
The final smoothing stage is also generalized. Instead of forcing the conventional square-root Hull relationship, the user can control both the smoothing exponent and a separate multiplier.
The adaptive systems then focus specifically on the behaviour that often makes Hull-style smoothers difficult to tune: oscillating tails around sharp turns.
The script measures changes in fast-T3 velocity, normalizes that curvature using ATR, and can use the result to:
Reduce Hull compensation.
Reduce the T3 Volume Factor.
Apply damping only around deceleration and turns.
An optional velocity limiter provides a final ATR-based cap on extreme one-bar movement, while an optional generalized compensation stage can reintroduce controlled responsiveness after the main smoothing process.
The final line determines trend through its slope, while a delayed WMA reference forms the optional ribbon. Ribbon intensity can also respond to normalized trend velocity.
Adaptive T3 Hull is therefore designed less as one fixed moving-average formula and more as a configurable filter architecture for exploring the trade-off between lag, smoothness, responsiveness and overshoot .
Its default configuration intentionally favors a less tail-heavy response than a conventional Hull construction, while the advanced controls allow users to move the model toward either greater responsiveness or stronger damping depending on the behaviour they want from the trend filter.
지표

NX Flow■Overview
"NX Flow" is a next-generation confluence indicator that seamlessly merges pure Price Action with Order Flow dynamics.
While many traders focus solely on the shape of price movements, it is "Volume" and "Liquidity" that truly drive the market. This script is designed to project the fundamental essence of the market—institutional intent, structural shifts, and true buying/selling pressure—directly onto your main chart intuitively, without cluttering your workspace with complex lower-pane oscillators.
■TradingView House Rules & Educational Intent
This script is built strictly for educational purposes and fully complies with TradingView's House Rules. It utilizes absolutely NO repainting functions and NO lookahead features that reference future data. To ensure signal authenticity and maintain chart performance, heavy internal calculations (such as Volume Profile processing) are highly optimized and executed only when the candle is finalized (barstate.isconfirmed).
■Core Calculation Logic & Mathematical Rationale
The script mathematically evaluates the following elements. A signal is output only when the combined score exceeds your defined sensitivity threshold.
1. SuperTrend Baseline (Trend & Volatility)
Calculation: Base = hl2. Upper/Lower Bands = Base ± (Multiplier * ATR).
Why? Simple moving averages lag and ignore volatility. By using the median price and ATR, this model dynamically adapts to market noise, tightening during consolidation and widening during high volatility to prevent premature stop-outs.
2. Fibonacci Retracements (0.5 / 0.618)
Calculation: Range = Pivot High - Pivot Low. Dynamically calculates the 50% and 61.8% retracement levels of the most recent swing.
Why? These ratios are statistically proven mean-reversion zones where institutional algorithms frequently place limit orders. Calculating these automatically removes subjective drawing errors.
3. CVD (Cumulative Volume Delta)
Calculation: Delta = +Volume (if Close > Open) or -Volume (if Close < Open). Cumulates the net difference.
Why? Total volume shows activity, but CVD reveals "Intent." By separating buying/selling volume, it exposes hidden Order Flow, allowing you to spot divergences where smart money is distributing into retail buying pressure.
4. Volume Profile POC (Point of Control)
Calculation: Scans the high/low range over the last 200 bars, divides it into equal bins, and aggregates volume into the specific bin where the typical price (hlc3) traded. Finds the bin with the max volume.
Why? POC is the exact mathematical price where the most trading occurred—the "fairest" value agreed upon by buyers and sellers. It acts as a massive gravitational wall. To keep the chart clean, this is computed strictly via background array logic.
5. FVG (Fair Value Gap) & CHoCH (Change of Character)
Calculation: Detects 3-candle liquidity voids (FVG) and structural breaks of recent pivot highs/lows (CHoCH).
Why? Identifies the exact moment a sequence of highs/lows is broken and visualizes areas of inefficient pricing that the market will naturally seek to rebalance.
6. Smart Bias (MTF & VSA - Volume Spread Analysis)
Calculation: Validates execution timeframe VSA (Spread > 20 SMA & Volume > 1.5x 20 SMA) against the Higher Timeframe (default Weekly) EMA trend.
Why? Eliminates counter-trend fake-outs. If macro trend is bullish, it mathematically filters out micro bearish traps by demanding institutional effort (high volume/spread) aligns with the macro direction.
■Visual Interface: Cyber Volume Envelope
The wavy bands rendered at the top and bottom of the SuperTrend scale the current volume's strength against its moving average using an ATR multiplier. When volume spikes, the waves expand dynamically. This provides an immediate, intuitive read of the market's injected energy right on the price action, eliminating the need to look away at a separate volume indicator.
■How to Use
Trend Identification: Assess the immediate market environment using the color of the central SuperTrend line and its surrounding Cyber Bands.
Confluence Signals: A "BUY / SELL" label is triggered only when your required number of conditions (default 5 out of 7) align, combined with strict filters requiring above-average volume and sufficient candle body size.
Customize the Confluence Sensitivity and Higher Timeframe baseline in the settings to perfectly match your trading style.
This indicator and description are provided for educational and informational purposes only and do not constitute financial advice or a recommendation to buy or sell any financial instrument. Trading in financial markets involves a high degree of risk and may result in the loss of your entire capital. The signals and analysis provided by this script are based on historical data and probabilistic modeling, and do not guarantee future profits. The author accepts no liability for any losses or damages incurred as a result of using this script. All trading decisions must be made strictly at your own discretion and at your own risk.
지표

Liquidity Sweep Buy/Sell [v6]# Liquidity Sweep Buy/Sell
## Overview
**Liquidity Sweep Buy/Sell ** is a price-action indicator designed to identify potential **liquidity sweeps** around important swing highs and swing lows.
The indicator looks for situations where price moves beyond a previous high or low, takes the available liquidity, and then closes back inside the previous level.
It can help traders identify potential **reversal areas, BUY/SELL opportunities, entries, and exits**.
> **Important:** This indicator is a technical analysis tool, not a guarantee of future price movement. Always use proper risk management and confirm signals with your own analysis.
---
## 🔹 What Is Liquidity?
In simple terms, **liquidity** is an area where many orders may be located.
Common liquidity areas include:
* Previous swing highs
* Previous swing lows
* Equal highs
* Equal lows
* Previous session highs/lows
* Important support and resistance levels
For example:
If price forms a previous high and later moves above that high, traders may interpret this move as a **liquidity sweep**.
If price then quickly closes back below the previous high, it can indicate that the breakout failed and that price may potentially reverse.
---
# 🟢 How the BUY Signal Works
The indicator searches for a previous swing low.
When price moves below that liquidity level and then closes back above it, the indicator can generate a **BUY signal**.
### Example:
**Previous Low → Price Sweeps Below → Price Closes Back Above → BUY**
This can indicate that sell-side liquidity below the previous low has been taken.
The indicator can then display:
**🟢 BUY**
and
**BUY ENTRY**
---
# 🔴 How the SELL Signal Works
The indicator searches for a previous swing high.
When price moves above that liquidity level and then closes back below it, the indicator can generate a **SELL signal**.
### Example:
**Previous High → Price Sweeps Above → Price Closes Back Below → SELL**
This can indicate that buy-side liquidity above the previous high has been taken.
The indicator can then display:
**🔴 SELL**
and
**SELL ENTRY**
---
# 📈 EMA Trend Filter
The indicator includes an optional **EMA Trend Filter**.
By default, it uses the **200 EMA**.
### Bullish Environment
When price is above the EMA, the indicator favors BUY signals.
### Bearish Environment
When price is below the EMA, the indicator favors SELL signals.
This filter can help reduce signals that go against the broader market direction.
You can disable the EMA filter from the settings if you want to use pure liquidity-sweep signals.
---
# 📊 Volume Filter
An optional **Volume Filter** is also available.
When enabled, the indicator compares current volume with the average volume.
This can help traders focus on liquidity sweeps that occur with relatively stronger market activity.
The volume filter is disabled by default.
---
# 🎯 How to Use the Indicator
## Step 1 — Add the Indicator
Open TradingView and add:
**Liquidity Sweep Buy/Sell **
to your chart.
---
## Step 2 — Identify the Market Trend
First look at the 200 EMA.
### Price Above EMA
Focus more on:
**🟢 BUY signals**
### Price Below EMA
Focus more on:
**🔴 SELL signals**
---
## Step 3 — Look for Liquidity
Watch the red and green liquidity levels.
### Red Level
Represents a previous swing high and potential **buy-side liquidity**.
### Green Level
Represents a previous swing low and potential **sell-side liquidity**.
---
## Step 4 — Wait for the Sweep
Do not enter simply because price touches a liquidity level.
Wait for price to **sweep the level and close back through it**.
This is the important part of the setup.
---
## Step 5 — Confirm the Signal
A stronger setup can occur when:
**Liquidity Sweep + Trend Direction + Strong Candle + Volume**
all support the same direction.
For example:
**Price above 200 EMA → price sweeps a previous low → candle closes back above the low → BUY signal**
This gives you a more structured setup instead of entering randomly.
---
# 🧠 How Beginners Can Learn It
If you are new to liquidity trading, learn these concepts in this order:
### 1. Market Structure
Learn:
* Higher High
* Higher Low
* Lower High
* Lower Low
### 2. Support & Resistance
Understand how previous highs and lows can become important areas.
### 3. Liquidity
Learn why traders watch:
* Previous highs
* Previous lows
* Equal highs
* Equal lows
### 4. Liquidity Sweeps
Understand the difference between:
**Breakout**
and
**Liquidity Sweep**
A sweep moves through a level but then returns back inside it.
### 5. Confirmation
Learn to wait for the candle close rather than entering immediately when price touches a level.
---
# 💡 Simple Strategy Example
### BUY Setup
1. Price is above the 200 EMA.
2. A previous swing low is visible.
3. Price moves below that low.
4. Price closes back above the low.
5. BUY signal appears.
6. Look for confirmation before entering.
7. Place your stop-loss according to your own risk-management rules.
8. Target a logical resistance/liquidity area.
### SELL Setup
1. Price is below the 200 EMA.
2. A previous swing high is visible.
3. Price moves above that high.
4. Price closes back below the high.
5. SELL signal appears.
6. Look for confirmation before entering.
7. Place your stop-loss according to your own risk-management rules.
8. Target a logical support/liquidity area.
---
# ⚙️ Recommended Settings
### Beginner
* Swing Length: **5**
* EMA Filter: **ON**
* EMA Length: **200**
* Volume Filter: **OFF**
### More Signals
Reduce the swing length.
For example:
**3–5**
This can make the indicator more sensitive.
### Stronger / Fewer Signals
Increase the swing length.
For example:
**7–10**
This focuses more on larger swing points.
---
# ⏱️ Timeframe
The indicator can be used on multiple timeframes.
For beginners, consider studying:
* 5-minute
* 15-minute
* 1-hour
* 4-hour
Do not assume that a signal on a lower timeframe is automatically stronger than a signal on a higher timeframe.
A useful approach is to identify the larger trend on a higher timeframe and then look for liquidity sweeps on a lower timeframe.
---
# 🚨 Important Risk Warning
No indicator can predict the market with 100% accuracy.
Liquidity sweeps can fail, especially during:
* High-impact news
* Extremely volatile markets
* Low-liquidity periods
* Strong trend continuation
* Sudden market manipulation or large orders
Always use:
**Risk Management + Stop Loss + Position Sizing + Market Analysis**
Never risk money you cannot afford to lose.
---
# 🔔 Alerts
The indicator includes TradingView alert conditions for:
* 🟢 Liquidity BUY
* 🔴 Liquidity SELL
* Exit LONG
* Exit SHORT
You can create alerts from TradingView's **Create Alert** menu after adding the indicator to your chart.
---
# 📚 How to Practice
Before using this indicator with real money, open a TradingView chart and study historical examples.
For every signal, ask yourself:
1. Where was the liquidity?
2. Did price actually sweep the level?
3. Did the candle close back through the level?
4. What was the trend?
5. Was price above or below the 200 EMA?
6. Was there strong volume?
7. Where would the stop-loss logically go?
8. Where was the next liquidity/support/resistance area?
Keep a trading journal and record both winning and losing setups.
The goal is not to take every signal.
The goal is to **understand why the signal appeared**.
---
# ⭐ Final Note
**Liquidity Sweep Buy/Sell ** is designed to make liquidity-based price action easier to visualize.
Use the indicator as a **confirmation and analysis tool**, not as an automatic trading system.
The best results come from combining the indicator with:
**Market Structure + Liquidity + Trend + Confirmation + Risk Management.**
Trade smart. Protect your capital. Learn the setup before trading it live.
지표

Market State Router [Permutation + Eigenstructure]MSR-PX is an experimental quantitative market-regime and systemic-pressure framework designed to classify the environment surrounding price rather than operate as a conventional buy/sell oscillator.
Instead of asking only whether price is rising or falling, MSR-PX evaluates several dimensions of market behavior:
Is local price action ordered or disordered ?
Is movement directionally efficient or rotational ?
Are major cross-asset markets becoming systemically coordinated ?
Is the charted asset participating in the dominant market factor?
Are local and systemic forces aligned or in conflict?
Which market-state interpretation is most consistent with the current environment?
The result is a rule-based Market State Router that classifies conditions as Trend, Breakout, Mean Reversion, Event/Systemic Risk, No Trade, or Loading Data .
🧠 CORE ENGINE 1 — LOCAL PERMUTATION STRUCTURE
MSR-PX measures local price-order dynamics using normalized permutation entropy .
Default configuration:
Embedding dimension: 4
Ordinal patterns: 24
Permutation lookback: 250 bars
Permutation entropy examines the ordering of consecutive price observations rather than simply measuring return magnitude.
Lower entropy indicates that a smaller subset of ordinal patterns is dominating recent behavior, suggesting greater local structure.
Higher entropy indicates that ordinal patterns are being expressed more uniformly, suggesting increasing disorder.
MSR-PX ranks this structural measurement against its recent historical baseline so the router can evaluate structure relative to the market's own recent behavior.
⚡ CORE ENGINE 2 — DIRECTIONAL EFFICIENCY
Directional efficiency compares:
Absolute net displacement
against
Total bar-to-bar travel
over the selected lookback.
This helps separate two environments that may have similar volatility but very different internal behavior:
Price traveling efficiently in one direction
Price covering substantial distance while repeatedly reversing and rotating
Higher efficiency supports directional Trend and Breakout states.
Lower efficiency supports rotational and Mean Reversion interpretations.
🌐 CORE ENGINE 3 — CROSS-ASSET EIGENSTRUCTURE
MSR-PX builds a rolling 5 × 5 cross-asset correlation system from synchronized observations of:
The charted asset
SPY — U.S. equity risk
TLT — long-duration Treasury exposure
DXY — U.S. dollar
VIX — implied equity volatility
The benchmark symbols are configurable.
The cross-asset network updates only from synchronized observations, helping avoid partially populated correlation samples when benchmark data is unavailable.
MSR-PX then analyzes the matrix's eigenvalue spectrum to estimate how concentrated market behavior has become around a common factor.
Diagnostics include:
Dominant eigenvalue share
Spectral entropy
Common-factor concentration
Target loading on the dominant eigenvector
When the dominant eigenvalue becomes increasingly concentrated while spectral entropy contracts, the network is behaving more like a coordinated system and less like a collection of independent markets.
🌀 CORE ENGINE 4 — SYSTEMIC ABSORPTION
Systemic Absorption is an MSR-PX composite measure of cross-asset common-factor concentration.
It incorporates:
Dominant eigenvalue concentration
Inverse spectral entropy
Historical percentile normalization
The resulting measurement is designed to distinguish between:
Decoupled environments , where local price behavior dominates
Systemically coupled environments , where a shared cross-asset factor is exerting greater control
The term Absorption here does not refer to traditional order-flow or liquidity absorption.
It specifically represents MSR-PX's estimate of systemic cross-asset concentration relative to its own historical baseline .
🎯 CORE ENGINE 5 — TARGET-ATTRIBUTED FACTOR DIRECTION
A strong systemic factor does not imply that every asset is responding to that factor in the same direction.
MSR-PX therefore adjusts the dominant factor impulse using the charted asset's loading magnitude and loading sign on the dominant eigenvector.
Conceptually:
Factor Impulse × Target Loading Strength × Target Loading Direction
This allows the router to distinguish between:
A systemic factor becoming active
The charted asset participating in that factor
The charted asset responding inversely to that factor
Local price action conflicting with the target-attributed systemic direction
This target attribution is used when evaluating directional alignment and systemic conflict.
🚦 THE MARKET STATE ROUTER
The individual engines feed a priority-based classification system.
The router does not simply select whichever condition produces the largest number. Certain environments intentionally take precedence over normal directional states.
1. EVENT / SYSTEMIC RISK
The highest-priority state.
Event/Systemic Risk requires elevated systemic concentration together with either:
A sufficiently strong systemic factor impulse
Meaningful conflict between local price direction and the target-attributed dominant factor
This state is intended to identify environments where broader cross-asset forces may be dominating normal local relationships.
When active, the router readout emphasizes reduced aggression rather than attempting to predict a specific directional trade.
2. BREAKOUT LONG / BREAKOUT SHORT
Breakout requires a stronger combination of:
Ordered local structure
Sufficient directional efficiency
Systemic participation
Strong directional impulse
Agreement between local and target-attributed factor direction
Breakout represents the router's strongest coordinated directional state.
3. TREND LONG / TREND SHORT
Trend states identify directional environments characterized by:
Ordered structure
Sufficient directional efficiency
Active local directional impulse
Directional consistency with systemic forces when systemic concentration is elevated
Trend does not require the same degree of systemic impulse as Breakout.
4. MEAN REVERSION
Mean Reversion is favored when the environment shows a combination of:
Disordered local structure
Weak or decoupled systemic absorption
Low directional efficiency
This describes an environment where rotational interpretation may be more appropriate than directional continuation.
5. NO TRADE / LOADING DATA
No Trade means the router does not find sufficient evidence for one of the primary states.
Loading Data appears while the historical buffers required for permutation structure, synchronized correlation, eigenstructure, and percentile calculations are still populating.
These are intentional router outputs rather than errors.
📊 HOW TO READ MSR-PX
TREND LONG / SHORT
Local structure and directional efficiency support continuation in the routed direction.
BREAKOUT LONG / SHORT
Local direction and systemic participation are strongly coordinated.
This is the router's strongest directional participation regime.
MEAN REVERSION
Directional efficiency is weak, structure is disordered, and systemic coupling is limited.
The environment is behaving more rotationally than directionally.
EVENT / SYSTEMIC RISK
Cross-asset concentration is elevated and systemic impulse or local/systemic conflict has become unusually strong.
Normal local relationships may be less reliable during this state.
NO TRADE
Conditions are mixed, ambiguous, or insufficient for a stronger classification.
📈 STATE SCORE
MSR-PX includes an internal State Score summarizing the strength of evidence supporting the active regime.
This score is not a calibrated probability .
For example:
An 86% State Score does not mean there is an 86% probability that a trade will succeed.
It should be interpreted only as an internal regime-strength measurement derived from the router's component conditions.
🧪 FORWARD VALIDATION LOGGER
MSR-PX includes a built-in forward transition logger for research purposes.
The logger tracks whether detected systemic fragility conditions subsequently transition into an Event / Systemic Risk state within a configurable forward horizon.
It records information including:
Total fragility transitions
Warnings that reached Event/Systemic Risk
Warnings that expired without transition
Transition rate
Average transition time
Age of the currently pending observation
This logger is a forward transition diagnostic .
It is not presented as a complete trading backtest, statistical significance test, or proof of predictive profitability.
⏱️ TIMEFRAME GUIDANCE
MSR-PX is designed primarily for intraday market-state analysis .
5 minutes is the recommended starting timeframe for the default configuration because it provides a practical balance between responsiveness and cross-asset regime stability.
1 minute: Faster regime transitions and earlier sensitivity to changing conditions, with greater exposure to short-term noise.
5 minutes: Recommended default for active intraday regime analysis.
15 minutes: Slower and smoother regime context for traders who prefer less frequent state changes.
No timeframe should be interpreted as universally or statistically optimal.
Regime behavior should be evaluated independently for the market, session, and trading horizon being studied.
🌍 SESSION AND BENCHMARK CONSIDERATIONS
The default network uses U.S.-centric equity, rates, dollar, and volatility benchmarks.
When MSR-PX is applied to:
Futures
Cryptocurrency
Overnight sessions
International markets
Assets trading outside U.S. cash-equity hours
users should consider both the trading schedules and economic relevance of the selected benchmark symbols.
Because the eigenstructure engine depends on synchronized observations, benchmark selection and session availability matter.
🔬 WHAT MSR-PX IS — AND IS NOT
MSR-PX is a market-state research and contextual framework .
It is not:
A standalone buy/sell system
A guaranteed market predictor
A calibrated probability model
A replacement for risk management
A claim of statistically optimal thresholds
The state thresholds are currently rule-based rather than statistically learned .
The purpose of the project is to explore whether combining local ordinal structure, directional efficiency, cross-asset eigenstructure, systemic concentration, and target-specific factor attribution can provide useful context about the current market environment.
🔓 OPEN-SOURCE PHILOSOPHY
MSR-PX is published open source so the methodology can be inspected, challenged, modified, and independently tested.
The research question is whether combining:
Permutation Structure
Directional Efficiency
Cross-Asset Eigenstructure
Systemic Concentration
Target-Specific Factor Attribution
provides useful market-state information beyond what any one component provides independently.
Users are encouraged to inspect the implementation, test different markets and timeframes, experiment with alternative benchmark networks, and evaluate the router's behavior independently.
⚠️ LIMITATIONS
Important limitations include:
State thresholds are rule-based and are not claimed to be universally optimal.
Correlation and eigenstructure measurements are backward-looking.
Cross-asset relationships can change through time.
Different trading sessions can produce uneven benchmark availability.
Shorter timeframes can produce noisier regime transitions.
State Score is an internal strength score, not a statistical probability.
Historical behavior does not guarantee future behavior.
Regime classification does not itself constitute a trading signal.
DISCLAIMER
This indicator is provided for educational, analytical, and research purposes only .
Nothing presented by MSR-PX constitutes financial, investment, or trading advice.
Users are responsible for independently evaluating the methodology and determining whether information produced by the indicator is appropriate for their own research or decision-making.
지표

Acceptance-Retest indicator# Acceptance-Retest Dashboard
**Companion to the Sweep-Reclaim Dashboard.** Same four levels, same session logic, opposite
read on price behavior — this one tracks what happens when a level *doesn't* reject.
---
## What this script does
Most level-based tools only handle one outcome: price hits a level and reverses. But price at
a key level only ever does one of three things — **rejects, accepts, or chops** — and a
rejection-only tool is blind to two-thirds of that.
This script tracks the **acceptance** case: a level breaks, price *holds* beyond it instead of
snapping back, and a genuine continuation trade sets up on the retest or base that follows.
It automatically:
- Plots **PDH / PDL / ONH / ONL** — prior-day high/low and overnight high/low
- Detects a real breakout close (not just a wick) beyond any of the four levels
- Confirms the level actually held before treating it as a trade candidate
- Waits for a retest or a tight base to form, then triggers on the break of that structure
- Computes entry, stop, target and R:R automatically — no manual level math
- Tracks the trade live once triggered — active, target hit, stopped, or timed out — so you
always know whether the last signal is still good
- Fires a TradingView alert the moment a valid setup completes
Every signal on the chart is prefixed **`AR:`** so it's never confused with a rejection-style
signal from a different tool running on the same chart.
---
## The rule book — Acceptance-Retest methodology
### The core idea
At any key level, price does one of three things:
| Behavior | Candle signature | What it means |
|---|---|---|
| **Rejection** | Wick through, closes back inside | Liquidity grab — level held |
| **Acceptance** | Real body close beyond, price holds | Level flipped — trade the hold |
| **Chop** | Repeated wicks and closes both sides | No edge — stand aside |
This script exists for the middle row. If you're already running a rejection/sweep-style
system, this is built to sit alongside it, not replace it — they read the *same* event and
reach opposite, mutually exclusive conclusions from it.
### The sequence, step by step
**1. Breakout.** Price trades through one of the four levels.
**2. Close confirmation.** A candle **closes** beyond the level — a real body close, not a
wick poking through. No close beyond → not this setup.
**3. No-reclaim check.** The next couple of candles must **not** close back on the original
side. If price reclaims within that window, this was a rejection, not an acceptance — a
different setup entirely, and this script drops it.
**4. Hold — retest or base.** Once the no-reclaim check passes, price needs to show one of two
structures before an entry is considered:
- **Retest:** a pullback toward the level that holds and turns, forming a higher low
(bullish) or lower high (bearish).
- **Base:** a tight, low-overlap sideways range instead of a pullback — still evidence the
level is holding, just without giving a clean retest.
If neither forms within a reasonable window, the attempt expires. Extended, un-based moves are
not entries — they're skips.
**5. Entry.** The break of the retest high/low, or the break of the base range.
**6. Stop.** Beyond the retest or base structure point — never an arbitrary distance, and
capped relative to that level's typical range so a single trade can't take on outsized risk
just because the structural point happened to be far away.
**7. Target.** A measured-move projection from the breakout level, pulled in to the nearer
opposing level when one exists inside that projection.
**8. Filter.** Minimum reward-to-risk gate — trades that don't clear it are skipped, not taken
anyway at reduced size.
### What invalidates a setup after it's already tracking
- **A reclose back through the level** during the hold phase — the move never actually held.
- **No retest or base within the watch window** — extended without structure.
- **Stop distance beyond the risk cap** — the structural stop doesn't fit, so the trade is
skipped rather than resized to fit.
- **Outside the trading window** — signals outside the configured session are not taken.
### Managing an active signal
Every valid trigger is tracked automatically against three outcomes, all defined *before*
entry, never adjusted mid-trade:
1. **Target hit** — the projected level is reached.
2. **Stop hit** — price trades back through the structural stop.
3. **Time stop** — not resolved by a configured cutoff time, closed out regardless of where
price is at that moment. A trade that hasn't reached target isn't a trade still "working" —
it's a trade that should be closed and logged honestly.
A trade that runs *past* target after a time stop already closed it doesn't get to become a
retroactive winner. The discipline is the point — not squeezing the best possible outcome out
of hindsight.
---
## Dashboard guide
**Level rows (PDH / PDL / ONH / ONL):**
- **Price** — the level's current value
- **Stage** — idle, no-reclaim check, or watching for retest/base
- **Bars** — how long the current stage has been running
- **Last signal** — the most recent outcome for that level: a full trade, or a specific skip
reason (reclaimed, expired, stop beyond cap, R:R too low)
**Active trade row:**
- The single most recent valid signal, with entry / stop / target
- **Status** — ACTIVE, TARGET HIT, STOPPED, or EXPIRED, updated live every bar
A level clustered too close to another active level is marked accordingly and excluded from
detection until it separates — this prevents two overlapping levels from generating
contradictory signals at effectively the same price.
---
## Settings
- **Sessions** — must match your other level-based indicators exactly, or the four levels will
disagree across scripts on the same chart.
- **Planning** — ATR length, minimum R:R, and the stop-risk cap (scaled to both the level's
typical range and current volatility, so a calm prior session doesn't choke off signals on a
day that's actually moving hard).
- **Acceptance rules** — how many bars must pass without a reclaim, how long to wait for a
retest/base before giving up, and how tight a base range needs to be to count.
- **Trading windows** — the session(s) during which new signals are allowed to trigger.
- **Time stop** — the cutoff time for closing anything still open.
- **Display** — dashboard position, text size, and whether to draw the level lines and active
trade markers on the chart.
---
## Notes
- This script draws its own copy of PDH/PDL/ONH/ONL so it works standalone; running it
alongside a companion rejection-style script on the same chart is fully supported — the
level math is identical, so both agree on where the four levels sit.
- Designed for 5-minute charts on index futures and related instruments; behavior on other
timeframes or asset classes has not been validated.
- A single active-trade slot is tracked at a time. A new valid signal replaces the previous
one rather than stacking multiple simultaneous trades.
---
## Disclaimer
This script is a **decision-support and rule-automation tool**, not a signal service or
trading advice. It mechanizes a specific discretionary methodology — it does not predict
price, guarantee outcomes, or account for news, liquidity conditions, or market regime shifts.
Past behavior of any setup shown here is not indicative of future results. All trading
decisions, position sizing, and risk management remain the sole responsibility of the user.
Backtest and forward-test thoroughly before applying any setup with real capital.
지표

Linearity V1.0Linearity Research — Trend Quality & Move Detection
This indicator finds clean, low-chop upward price moves ("linear" moves) and scores how good each one is, then rolls those scores up into a single Linearity Score so you can quickly judge whether a stock tends to trend smoothly or in choppy, unreliable swings.
How a move is detected
- A move begins when price closes above its EMA (default length 21).
- It ends only after price closes back below the EMA and then makes a new low below the low of that breakdown bar — a two-step exit that avoids ending a move on a single EMA wick.
Qualifying a move
- Persistence = the % of bars in the move that closed above the EMA. This measures how smooth vs. choppy the move was.
Qualifying a move
- Persistence = the % of bars in the move that closed above the EMA. This measures how smooth vs. choppy the move was.
- Smooth moves (persistence ≥ the High Persistence Threshold) only need to clear a lower minimum peak-gain bar to qualify. Choppier moves must clear a higher bar. This keeps ragged-but-large rallies from scoring as well as genuinely straight-line moves.
Per-move score (0–100)
- Peak % gain — 40%
- Efficiency Ratio (net move ÷ total price path traveled; 1.0 = a straight line, lower = more back-and-forth) — 30%
- Persistence — 20%
- Max intra-move drawdown (light penalty) — 5%
- Pullback count (light penalty) — 5%
Linearity Score
Over a configurable lookback window (in years), the script averages the score, peak %, and Efficiency Ratio of every qualifying move, then adds a small bonus for having more qualifying moves (capped), producing one 0–100 Linearity Score. This, along with move count, average peak %, and average ER, is shown in an on-chart panel.
Visuals
- Green boxes mark each qualifying move, labeled with its peak % gain and score.
- Optional EMA plot.
- A configurable bottom panel shows either the Linearity summary or a detailed table of every qualifying move (dates, peak %, ER, persistence, drawdown, pullbacks, duration, score) — position, text size, and colors are all adjustable.
How to use it
Use the Linearity Score to screen for stocks whose historical rallies tend to be smooth and orderly rather than violent and choppy — useful for trend-following or momentum approaches that don't want to fight excessive volatility. Switch the bottom panel to the Detailed Table to audit exactly which historical moves are driving the score.
Note: this script only evaluates upward (bullish) moves triggered by EMA crossovers — it does not detect or score downtrends.
지표

지표

Dow Theory Market Structure ProDow Theory Market Structure Pro is a price-action indicator designed to help traders identify and interpret market trends using classic Dow Theory principles.
The indicator automatically detects confirmed swing highs and swing lows and classifies the evolving market structure as:
HH: Higher High
HL: Higher Low
LH: Lower High
LL: Lower Low
A sequence of Higher Highs and Higher Lows indicates a bullish structure, while Lower Highs and Lower Lows indicate a bearish structure. Mixed structures are classified as a range or transition phase.
Key Features
Automatic HH, HL, LH and LL identification
Swing-high and swing-low trend lines
Dynamic support and resistance levels
Bullish breakout and bearish breakdown signals
Bull, bear and range market classification
Trend-strength score from -2 to +2
Daily and weekly market-structure comparison
Multi-timeframe trend-alignment status
Price position within the current support-resistance range
Upside-to-downside distance calculation
Customisable dashboard, colours and display settings
Alert conditions for structural changes, breakouts and breakdowns
Trend-Strength Framework
The indicator assigns one point to each bullish structural condition and subtracts one point for each bearish condition:
+2: Strong Bull, with HH and HL
+1: Bullish Bias
0: Range or Transition
-1: Bearish Bias
-2: Strong Bear, with LH and LL
Support and Resistance
The latest confirmed swing high is displayed as resistance, while the latest confirmed swing low is displayed as support. These levels automatically update when a new pivot is confirmed.
A breakout signal occurs when price closes above the current confirmed resistance. A breakdown signal occurs when price closes below the current confirmed support.
Multi-Timeframe View
The dashboard compares Daily and Weekly Dow Theory structures to indicate whether the two timeframes are bullishly aligned, bearishly aligned or mixed.
Important Note
Swing points are confirmed using a user-defined Pivot Length. Because confirmation requires additional bars to form after a potential turning point, swing labels and structure changes appear with an intentional delay. Increasing Pivot Length identifies fewer, more significant swings, while decreasing it produces faster but more sensitive signals.
This indicator is intended for market-structure analysis and trend confirmation. It does not predict future price movements or provide standalone buy or sell recommendations.
Disclaimer
This script is provided for educational and analytical purposes only and does not constitute financial advice. Market-structure signals, support and resistance levels, breakouts, breakdowns and multi-timeframe readings may produce false or delayed signals. Users should perform independent analysis and apply appropriate risk management before making investment or trading decisions. 지표

Trend Following SuperSmoother - Accumulation Zones [JW]Trend Following SuperSmoother - Accumulation Zones
A Pine Script trend following indicator designed to identify systematic accumulation opportunities, profit-taking periods and broader position cycles using a smoothed oscillator framework.
The indicator is intended primarily for long-horizon analysis, with particular emphasis on distinguishing early trend reversals from pullbacks within established positive trends.
---------------------------------------------------------------------------------------------------------------------
Overview
The indicator combines a SuperSmoother-based oscillator and signal line with Bollinger-style oscillator bands and a state-based signal framework.
Rather than treating every oscillator crossover as an independent trading signal, it classifies market conditions into distinct phases:
- Early Reversal Accumulation
- Pullback Accumulation
- Profit-Taking
- Long / Out-of-Market Position Regimes
Signals are evaluated on confirmed candle closes to reduce intrabar noise.
---------------------------------------------------------------------------------------------------------------------
Indicator Components
SuperSmoother Oscillator
The core oscillator is smoothed to reduce short-term market noise while preserving changes in longer-term momentum.
Its colour identifies its current direction:
- Green: oscillator rising
- Red: oscillator falling
A separate signal line provides a slower reference against which changes in oscillator behaviour can be assessed.
Bollinger Bands
Upper and lower bands are calculated around the oscillator framework and are used to identify unusually extended oscillator conditions.
Unlike price Bollinger Bands, these bands operate within the oscillator pane and form part of the logic for identifying potential reversal and pullback setups.
---------------------------------------------------------------------------------------------------------------------
Accumulation Logic
1. Early Reversal
Early-reversal accumulation is designed to identify improving momentum following a sufficiently weak oscillator regime.
The setup begins when the oscillator has moved through the lower Bollinger boundary and subsequently satisfies the required rising/green conditions while remaining in the negative regime.
The exit condition depends on the state of the signal line when the setup occurs:
- If the signal line is below zero, accumulation continues until the signal reaches zero.
- If the signal line is already above zero, accumulation continues until the oscillator crosses the signal line from below.
This distinction prevents an early-reversal zone from remaining active indefinitely when the signal line was already positive at entry.
A large green triangle marks a confirmed early-reversal entry.
2. Pullback Accumulation
Pullback accumulation is intended for corrections occurring within an established positive oscillator regime.
The setup tracks an oscillator that has moved above the upper Bollinger boundary and subsequently falls back through it. Once the required falling/red condition is satisfied, a pullback accumulation period can begin.
This allows the oscillator to turn red either before or after crossing the upper band rather than requiring both events to occur on the same candle.
A smaller dark-green triangle marks the pullback entry.
---------------------------------------------------------------------------------------------------------------------
Profit-Taking
A profit-taking regime can begin when:
- the oscillator is above zero;
- the oscillator turns from rising to falling; and
- no higher-priority accumulation regime is active.
Profit-taking periods are displayed as light-red zones.
A small dark-red circle marks the beginning of a profit-taking phase.
Signal priority is:
Early Reversal > Pullback > Profit-Taking
This state hierarchy prevents accumulation and profit-taking zones from overlapping.
---------------------------------------------------------------------------------------------------------------------
Position-Cycle Signals
The indicator also provides a higher-level representation of the intended long-term position cycle.
Entry
A confirmed early-reversal signal marks the beginning of the primary long regime.
The oscillator pane displays:
- a green vertical entry line; and
- a green zero-axis regime line while the position remains active.
Exit
When the oscillator crosses below zero on a confirmed candle close:
- a large red circle marks the exit;
- a red vertical line identifies the transition; and
- the zero-axis regime changes from green to red.
The red regime continues until the next confirmed early-reversal entry.
This creates a continuous visual distinction between the indicator's long/holding regime and its out-of-market regime.
---------------------------------------------------------------------------------------------------------------------
Visual Signal Guide
Large green triangle -> Early-reversal entry / primary position entry
Small dark-green triangle -> Pullback accumulation
Small dark-red circle -> Profit-taking signal
Large red circle -> Oscillator below zero / primary position exit
Green background -> Accumulation zone
Light-red background -> Profit-taking zone
Green zero-axis regime -> Long / holding period
Red zero-axis regime -> Out-of-market period
Black hollow circles -> Regime change
---------------------------------------------------------------------------------------------------------------------
Design Philosophy
The indicator is designed around a simple idea: trend following does not necessarily require buying only after a trend has already become obvious.
Instead, the framework attempts to separate three useful stages of a longer market cycle:
1. accumulation during an emerging reversal;
2. additional accumulation during pullbacks within a positive trend; and
3. profit-taking as positive momentum begins to deteriorate.
The primary exit remains deliberately slower: a confirmed oscillator move below zero.
This makes the framework more suited to medium- and long-horizon trend participation than short-term trading.
---------------------------------------------------------------------------------------------------------------------
Alerts
Early-reversal and pullback entries are combined into a single TradingView entry alert condition, allowing both accumulation signal types to be monitored using one alert.
Signals are confirmed at candle close.
---------------------------------------------------------------------------------------------------------------------
The indicator can be applied across different securities and timeframes, although its parameters and behaviour should be evaluated for the characteristics of the underlying instrument. 지표

Price Gravity Research Engine [Effort and Displacement]Price Gravity Research Engine (PG-RE) is a market-state research indicator designed to measure how much normalized market effort is being consumed relative to the amount and efficiency of price movement that effort produces.
The core idea is simple:
Price becomes mechanically “heavy” when substantial effort produces little or inefficient displacement, and “light” when price travels efficiently with comparatively little resistance.
Rather than generating traditional buy/sell signals, PG-RE is built to describe the current movement environment .
Who it is for: PG-RE is especially suited to discretionary intraday, price-action, and market-structure traders who want a regime/context layer for distinguishing clean repricing from inefficient, effort-heavy travel.
What the engine measures
PG-RE evaluates three primary components:
1) Effort
Market activity is normalized relative to its expected baseline.
When usable volume is available, volume is used as the primary effort source.
A range-based activity proxy can be used as an alternative.
On intraday charts, PG-RE can normalize effort by time of day , helping prevent the open or close from being classified as abnormal simply because raw activity is naturally higher during those periods.
2) Displacement
Net price movement over the Gravity Window is measured using log returns and normalized against recent volatility.
This asks:
Has price actually traveled a meaningful distance relative to what volatility would normally imply?
3) Path Efficiency
PG-RE compares net displacement with the total path traveled over the same window.
A direct move has high path efficiency .
A back-and-forth move with little net progress has low path efficiency .
The Gravity model
PG-RE combines normalized effort, volatility-adjusted displacement, and path efficiency into one mechanical measure called Price Gravity .
In practical terms:
more effort with less progress tends to increase gravity
inefficient, rotational travel tends to increase gravity
strong, efficient displacement tends to reduce gravity
efficient movement achieved with relatively little effort represents lighter travel
Gravity is then interpreted relative to its own recent distribution , making PG-RE a regime tool , not a fixed-value oscillator.
It is designed to answer:
“How difficult is it for price to move right now, and is that difficulty changing?”
not:
“Should I buy or sell this bar?”
What is different about PG-RE
Rather than evaluating activity, volatility, or directional movement independently, PG-RE treats their relationship as the object of measurement.
Its primary output is therefore not momentum or volume itself, but the changing amount of normalized effort associated with efficient versus inefficient price travel.
Mechanical states
PG-RE classifies the current environment into several descriptive states:
PRESSURE
Elevated effort is producing unusually weak displacement while travel remains inefficient and gravity is building. Elevated activity is producing little clean progress.
VACUUM ↑ / ↓
Price is producing unusually strong and efficient displacement with comparatively low effort. Movement is encountering relatively little resistance.
ACTIVE REPRICING ↑ / ↓
Both effort and displacement are elevated while travel remains efficient. Price is moving materially and participation is substantial.
DRAG ↑ / ↓
A directional move remains underway, but gravity is increasing while path efficiency remains below the high-efficiency threshold. Progress is becoming mechanically heavier.
LIGHT TRAVEL ↑ / ↓
Displacement is strong and efficient while overall gravity is unusually low.
DEAD ROTATION
Effort and displacement are subdued while travel remains inefficient, producing little directional progress.
RELEASE ↑ / ↓
A recent high-gravity environment is followed by sharply easing gravity while path efficiency improves. Resistance that had previously constrained movement is dissipating.
NEUTRAL
No stronger mechanical condition currently dominates.
Reading the dashboard
PRICE GRAVITY
Current mechanical state.
WEIGHT
Whether gravity is currently HEAVY , NORMAL , or LIGHT relative to its recent distribution.
CHANGE
Whether gravity is BUILDING , STABLE , or EASING .
TRAVEL
Whether price movement is DIRECT , MIXED , or ROTATIONAL .
EFFORT
Whether normalized activity is HIGH , NORMAL , or LOW .
BALANCE
A directional asymmetry proxy combining close-location-weighted effort with cumulative upward versus downward path travel.
Important:
UPSIDE HEAVIER is not a bullish label, and DOWNSIDE HEAVIER is not a bearish label.
UPSIDE HEAVIER means the upward-side gravity proxy is relatively heavier than the downward-side proxy.
DOWNSIDE HEAVIER means the downward-side gravity proxy is relatively heavier than the upward-side proxy.
BALANCE should be interpreted as a relative resistance proxy , not as a direct measurement of buying/selling pressure or order flow.
Direction and gravity should therefore be interpreted separately.
How I use it
PG-RE works best as a market-structure context layer .
I primarily look for transitions between conditions such as:
HEAVY + BUILDING + ROTATIONAL
effort is being consumed without clean travel
LIGHT + DIRECT ↑/↓
price is traveling efficiently with relatively low gravity
PRESSURE → RELEASE
a previously constrained auction begins converting effort into cleaner movement
ACTIVE REPRICING → DRAG
a strong move remains active, but its mechanical efficiency is deteriorating
VACUUM → rising gravity
a low-resistance move begins encountering more opposition
Practical notes
PG-RE is adaptive and distribution-relative, so a “high” reading in one market or timeframe does not need to equal a “high” reading somewhere else in raw-value terms.
The current live bar can evolve as price, range, and volume develop.
The indicator contains no buy/sell labels and makes no forecast claim.
PG-RE measures model-implied movement difficulty from price, volatility, and volume/range data. It does not directly measure order-book liquidity, executed aggressor flow, or physical market resistance.
A warm-up period is required before distribution-relative states become available.
Its purpose is to structure the relationship between effort, displacement, path efficiency, and changing market resistance within one coherent framework.
Quick Use Guide
Start with PRICE GRAVITY and WEIGHT to judge whether the market is mechanically heavy, normal, or light.
Check CHANGE to see whether gravity is building, stable, or easing.
Use TRAVEL to separate direct movement from churn.
Use EFFORT to judge how much participation is present behind the move.
Use BALANCE to identify directional asymmetry in relative resistance.
Treat states as context , not trade arrows.
지표

VIX Seasonal Analog Composite█ OVERVIEW
VIX Seasonal Analog Composite draws three lines in a separate pane: the average seasonal path of all complete years of VIX history, a composite of the historical years whose year-to-date VIX path most closely resembles the current year, and the current year's own VIX path. The script requests CBOE:VIX daily closes directly, so it displays VIX seasonality on any chart symbol: applied to an S&P 500 chart, the pane still shows the VIX. All lines are expressed as a percentage of each year's first daily VIX close, and both seasonal lines are projected forward to the end of the current calendar year. The thesis is that the remainder of a VIX year can be contextualized by the average behavior of prior years, and more specifically by the subset of prior years that have tracked the current year most closely so far.
█ HISTORY / BACKGROUND
Seasonal averaging is a long-standing technique in technical analysis: normalize each historical year to a common starting point, average across years by position in the calendar, and read the result as the instrument's typical annual path. Applied to the VIX Index, it captures the well-documented tendency of implied volatility to trough in summer and firm into autumn. Its main weakness is that every year receives equal weight, so years with no resemblance to current conditions dilute the picture.
The analog-year refinement addresses this. Instead of averaging all history, it ranks past years by their similarity to the current year's realized path and averages only the closest matches. Variants of this approach appear in institutional volatility research. The specific similarity metric, selection count, and construction details vary by practitioner and are generally not disclosed. This script implements one explicit, reproducible version of the method for the VIX with all parameters exposed as inputs.
█ HOW IT WORKS
The script runs a single accumulation pass over the chart's daily history and defers all computation and drawing to the last bar.
1. On every chart bar, the script requests the CBOE:VIX daily close through `request.security`. Calendar-year boundaries are detected with `year(time)`. The first available VIX close of each year becomes that year's anchor. Every subsequent VIX close is stored as close divided by the anchor, indexed by trading-day-of-year (0 to 252), in a persistent matrix with one row per year. Bars where the VIX returns no data, such as chart history predating 1990, are skipped.
2. On the last bar, completed years are screened for eligibility: a year must contain at least the minimum number of observations (default 200 trading days) to enter any calculation. The current year is always excluded from the historical pools.
3. The seasonal average is computed per trading-day index as the arithmetic mean of the normalized values of all eligible years at that index.
4. Analog ranking begins once the current year has at least the minimum elapsed days (default 10). For each eligible year, the script computes the root mean square error between that year's normalized path and the current year's normalized path over the trading days elapsed so far, skipping missing pairs. Years are ranked by ascending RMSE and the closest N (default 10) are selected. The analog composite is the per-day mean of the selected years across the full 253-day span, including days the current year has not yet reached.
5. Both seasonal lines are drawn as polylines anchored to bar time: actual bar times for elapsed days, then projected dates stepped one calendar day at a time with weekends skipped for the remainder of the year.
6. The current-year line is drawn over elapsed days only. By default it is linearly rescaled so that its year-to-date range maps onto the vertical range of the two seasonal curves, emulating a second axis within a single-scale pane. A label at its last point shows the true unrescaled year-to-date percentage.
7. A table in the top right lists the selected analog years and their RMSE scores.
Ranking is recomputed on every update, so the analog set can rotate as the current year develops.
█ HOW TO USE
Apply the indicator to any daily chart of a symbol that trades on the US equity session calendar, such as an S&P 500 index chart or the VIX itself. The pane always displays VIX seasonality regardless of the chart symbol, which allows the seasonal context to sit directly beneath the index you are analyzing. The logic counts trading days within calendar years using the chart's bars, so it is designed for the daily timeframe only; other resolutions will produce meaningless day indexing. VIX daily history extends to 1990, so a chart with sufficient loaded history builds seasonal pools from roughly three and a half decades of complete years.
The gray line is the unconditional seasonal script: what an average year looks like. The colored composite line is the conditional version: what years resembling this one looked like, including how they finished. The red line is the current year. Divergence between the current year and the composite indicates the year is departing from its closest historical precedents; the table shows which years those precedents are and how tight the fits are (lower RMSE means closer). A rotating analog table across weeks means the current year lacks a stable historical match, which is itself information.
The projected segments beyond the current date are historical averages extended in time. They describe how past years behaved from this calendar point onward. They are not forecasts.
█ SETTINGS
• Top analog years : number of closest historical years in the composite. Default 10.
• Min trading days for an eligible year : observation floor for a year to enter any pool. Default 200.
• Min elapsed days before analog ranking : current-year data required before ranking begins. Default 10.
• Show all-year seasonal average : toggles the gray average line. Default on.
• Show top-N analog composite : toggles the composite line. Default on.
• Show current-year YTD line : toggles the current-year path. Default on.
• Rescale YTD onto seasonal range (RHS-style) : maps the current-year line onto the seasonal
curves' vertical range for readability. Default on.
• Project remainder of year : extends the seasonal lines to year end. Default on.
• Show analog year table : toggles the analog list with RMSE scores. Default on.
• Average color , Analog composite color , YTD color : line colors.
• Line width : width of all three lines. Default 2.
█ WHAT MAKES IT ORIGINAL
Published seasonality scripts typically plot a single all-year average. This script adds a similarity-ranked analog layer computed entirely on the chart: it maintains a full year-by-trading-day matrix of normalized paths, scores every eligible historical year against the current year by RMSE on each update, and averages only the closest matches, so the composite is conditional on how the current year has actually traded rather than on the calendar alone. The construction is fully disclosed and parameterized, including the similarity metric, the selection count, and the eligibility gates. The forward projection is drawn with time-anchored polylines so both seasonal paths extend beyond the last bar to year end, and the current-year line uses an optional range-mapping transform to keep all three curves readable on a single pane scale, with a label preserving the true value.
█ NOTES / LIMITATIONS
• Daily timeframe only. The trading-day indexing that underlies every calculation assumes one bar
per trading day.
• The analog set is re-ranked on every recalculation using the current year's realized path. The
composite line therefore changes shape as the year develops, including its already-drawn portion.
This is inherent to the method, and it means the line you see today is not the line you would
have seen a month ago. Treat it as a conditional historical average, not a signal history.
• The pane always shows the VIX. The chart symbol supplies only the bar grid and timeline.
• Trading-day indexing follows the chart symbol's bars. Chart symbols whose sessions differ from
the US equity calendar, such as symbols with weekend bars or non-US holiday schedules, will
misalign the day indexing. Use a chart symbol on the US equity session.
• The seasonal pools depend on the chart's loaded bar depth and on VIX data availability from
1990. A chart with shallow history averages over fewer years, and less than two complete years
of overlap draws no seasonal lines at all. Chart bars predating 1990 contribute nothing.
• Partial first years, and any year below the observation floor, are excluded by the eligibility
gate.
• Years are capped at 253 trading days; any bars beyond that index within a year are ignored.
• Forward projection steps calendar days and skips weekends but not exchange holidays, so
projected dates drift a few days long by December. Alignment between curves is by trading-day
index and is unaffected.
• With rescaling on, the pane axis is literal for the seasonal lines only. The current-year line's
axis position is a range mapping; read its true value from the label at its endpoint. Early in
a year, a small realized range makes the rescaled line visually exaggerated.
• All output is drawn over the current calendar year plus its projection. The pane is empty over
prior history, which is expected: prior years are inputs to the curves, not drawn objects.
• The script draws with polylines, a label, and a table only, and declares no plot series, so the
pane scale derives from the drawings.
• Nothing in this script is validated as predictive. Both curves are descriptive averages of
historical paths. 지표

지표

Sweep-Reclaim Dashboard-Entry-Alert Sweep-Reclaim Dashboard tracks four key intraday levels — prior-day high (PDH),
prior-day low (PDL), overnight high (ONH), and overnight low (ONL) — and flags
only the specific failed-breakout pattern this script is built around: price
sweeps through one of these levels and then reclaims it (closes back on the
original side) within a limited number of bars, without accepting beyond it.
WHAT IT DOES
Pre-market: builds PDH/PDL from the regular session and ONH/ONL from the
overnight session, checks whether any two levels sit too close together to be
treated as separate zones ("clustered"), and estimates a stop distance from the
previous day's ATR.
Live: watches each active level for a sweep, then runs every reclaim through
five hard rules before calling it valid:
1. Closes beyond the level did not exceed the configured maximum (more than
that is acceptance, not a sweep, and the setup is dead).
2. Price reclaimed the level within the configured max bar count.
3. Sweep depth fell between a configurable minimum (filters out noise/brushes)
and maximum (filters out sweeps that are actually breakouts).
4. The reclaim bar's close sits deep enough into its own range (a
configurable top/bottom fraction) to show real rejection, not a weak wick.
5. Candle color matches the trade direction, if that filter is enabled.
Valid signals also have to fall inside one of two configurable trading windows
and clear a minimum reward:risk versus the nearest opposing level (which is
used as the target). Only then does the script plot a signal label with entry,
stop, target, and R-multiple, and optionally fire an alert.
DASHBOARD
Toggle between two dashboard modes:
- Inputs only: shows the raw levels, previous-day ATR, the ATR-based stop
estimate, current price, and whether price is inside the overnight range —
deliberately does NOT compute direction or R:R for you, if you want to keep
doing that step by hand.
- Full table: computes direction, target, distance, expected R:R, and a
watch/skip verdict for every active level in real time, plus a running list
of any level currently mid-sweep.
A "Study mode" hides close-counts and rule verdicts so you can practice reading
the setups yourself before letting the script confirm them. A "Debug row" shows
the script's raw internal session/level state, useful for verifying it agrees
with any separate PDH/PDL/ONH/ONL reference indicator on your chart.
VISUAL RISK BOXES
Every valid signal draws an entry line, a stop-loss line, and one or two
target lines (T1 at 2R, T2 at the nearest non-swept opposing level), plus
shaded green/red zones showing the profit and loss areas at a glance. Lines
and zones auto-extend to the right while the trade is still open, and each
line/label turns green with a checkmark when its target is hit, or red with
an X when the stop is hit — so you can see how a signal actually played out
without leaving the chart. Only the most recent signal's box is shown at a
time. Box length, colors, and fills are all configurable.
ALERTS
One configurable pre-market "plan" alert per day listing each active level,
direction, target, and estimated R from the ATR-based stop estimate — and one
alert per valid live signal, if enabled.
NOTES
- The live target/R:R math for a signal excludes any opposing level that has
already been swept during the session; the once-daily plan alert message
does not apply that exclusion, so the two can point at different levels
mid-session — check the live dashboard/signal for the level actually being
traded.
- Originally built and tuned against QQQ on a 5-minute chart. Threshold inputs
(cluster tolerance, sweep depth, stop multiplier) are percentage-of-price
based so they scale across instruments, but re-validate the defaults before
relying on this for other symbols or timeframes.
- This is a decision-support indicator, not an auto-trading strategy: it does
not place orders and carries no backtest/win-rate claims. All signals require
the trader's own risk management and judgment.
- The four session inputs (time zone, RTH session, overnight session, session
days) must match any separate PDH/PDL/ONH/ONL indicator on your chart
exactly, or the two will disagree.
This script is provided for educational and informational purposes. It is not
financial advice, and past patterns matching these rules do not guarantee
future results. 지표

Multi-Confirmation Swing IndicatorMulti-Confirmation Swing Indicator is a multi-confirmation technical analysis indicator designed for traders who want to analyze trend direction, momentum, support/resistance, breakouts and potential swing entries from one chart.
Instead of relying on a single indicator, the system combines several independent components to provide a broader view of market structure.
The indicator combines:
EMA trend structure
RSI momentum confirmation
Smoothed Heikin Ashi
Dynamic trendlines with breakout detection
Volume-based support and resistance zones
Zone Shift trend detection
Trend initiation and retest levels
Impulse MACD
Swing BUY/SELL signals
Support/resistance breakout and hold signals
The objective is not to predict every market move, but to help traders determine whether multiple pieces of technical evidence are aligned.
How to Read the Indicator
The easiest way to use the indicator is to think of it as a confirmation system.
Don't treat every individual marker as a trade signal.
Instead, look for confluence.
🟢 Bullish Environment
A stronger bullish setup occurs when several of the following are aligned:
EMA 21 > EMA 55
Price is above the EMA structure.
EMA 21 and EMA 55 are rising.
RSI is above the bullish threshold.
Smoothed Heikin Ashi is bullish.
Zone Shift indicates an upward trend.
Price breaks above a resistance/trendline.
Former resistance begins behaving as support.
Impulse MACD confirms positive momentum.
A BUY signal appears after the above conditions align.
The more confirmations that agree, the stronger the overall technical picture.
🔴 Bearish Environment
A stronger bearish setup occurs when:
EMA 21 < EMA 55
Price is below the EMA structure.
EMA 21 and EMA 55 are falling.
RSI is below the bearish threshold.
Smoothed Heikin Ashi is bearish.
Zone Shift indicates a downward trend.
Price breaks below support/trendline.
Former support begins behaving as resistance.
Impulse MACD confirms negative momentum.
A SELL signal appears after the above conditions align.
Again, the objective is confirmation rather than prediction.
Understanding the Main Components
1. EMA Trend Structure
The EMA component uses three moving averages:
Fast EMA — 9
Trend EMA — 21
Major Trend EMA — 55
The basic interpretation is:
Bullish
Price > EMA 9 > EMA 21 > EMA 55
Bearish
Price < EMA 9 < EMA 21 < EMA 55
This helps identify whether short-, medium- and longer-term momentum are aligned.
The EMA settings can be adjusted from the indicator inputs.
2. RSI Confirmation
RSI is used as a momentum filter.
Default thresholds:
Bullish: RSI > 55
Bearish: RSI < 45
The purpose isn't to simply buy when RSI is high or sell when RSI is low.
Instead, RSI helps answer:
"Is momentum supporting the current trend?"
3. Smoothed Heikin Ashi
The Smoothed Heikin Ashi component attempts to reduce some of the noise present in normal candles.
It can help visually identify:
bullish phases
bearish phases
trend transitions
continuation periods
A series of bullish Smoothed Heikin Ashi candles together with bullish EMA structure provides stronger trend confirmation than either component alone.
Likewise for bearish conditions.
4. Dynamic Trendlines
The trendline component identifies swing highs and swing lows and creates dynamic trendlines from them.
It can identify:
Upward breakout
Price breaks through a descending resistance trendline.
Downward breakout
Price breaks through an ascending support trendline.
The B markers represent detected trendline breaks.
These are useful for identifying potential changes in short-term market structure.
5. Volume-Based Support & Resistance
The support/resistance component identifies potential zones around significant pivot areas while incorporating volume information.
The zones can help traders identify:
potential support
potential resistance
support breaks
resistance breaks
resistance becoming support
support becoming resistance
Example
If resistance is broken:
Resistance → Support
A subsequent successful retest of that level can provide additional bullish confirmation.
Similarly:
Support → Resistance
can provide bearish confirmation after a downside break.
6. Zone Shift
Zone Shift provides another view of the broader trend.
It uses a combination of:
EMA
HMA
price range/distance
trend initiation level
The indicator can switch between bullish and bearish states.
It also identifies potential retests of the trend initiation level.
This can be particularly useful for swing traders because it provides context beyond a single candle.
7. Impulse MACD
Impulse MACD provides an additional momentum layer.
It helps identify:
positive momentum
negative momentum
momentum expansion
momentum contraction
It should not be interpreted independently as a buy/sell system.
Instead, use it as another confirmation layer.
BUY Signal
The BUY signal is designed to appear when the primary swing-trend conditions become bullish.
The underlying logic considers factors such as:
EMA trend
EMA alignment
EMA slope
price position relative to the fast EMA
two-bar confirmation
RSI momentum
The system also prevents repeated BUY labels while the same bullish condition remains continuously active.
Ideal interpretation
Trend + momentum + structure + confirmation = stronger setup
Not:
"BUY label = guaranteed buy."
SELL Signal
The SELL signal works in the opposite direction.
It considers:
bearish EMA trend
bearish EMA alignment
declining EMA structure
price below the fast EMA
two-bar confirmation
RSI weakness
Repeated SELL signals are also filtered.
How I Recommend Using It
Rather than trading every signal, use a 3-stage approach.
Stage 1 — Identify the Trend
First ask:
Is the market bullish, bearish or unclear?
Look at:
EMA 21/55
EMA stacking
Zone Shift
Smoothed Heikin Ashi
If these disagree significantly, consider the market unclear.
Stage 2 — Look for Structure
Once the trend is identified, look for:
support/resistance
trendline breakout
breakout/retest
resistance becoming support
support becoming resistance
This helps avoid entering simply because an indicator changed color.
Stage 3 — Look for Momentum Confirmation
Finally check:
RSI
Impulse MACD
EMA slope
BUY/SELL confirmation
A setup where multiple components agree is generally more interesting than an isolated signal.
Example Bullish Setup
A potential swing-long setup could look like:
1. EMA 21 > EMA 55
↓
2. Price > EMA 9 > EMA 21
↓
3. Zone Shift turns bullish
↓
4. Resistance/trendline breaks
↓
5. Price retests the broken resistance
↓
6. RSI remains above bullish threshold
↓
7. Impulse MACD supports bullish momentum
↓
8. BUY signal appears
This creates a confluence-based setup rather than relying on one indicator.
Example Bearish Setup
The reverse:
EMA 21 < EMA 55
↓
Price < EMA 9 < EMA 21 < EMA 55
↓
Zone Shift bearish
↓
Support/trendline breaks
↓
Retest fails
↓
RSI below bearish threshold
↓
Impulse MACD bearish
↓
SELL signal
Again, this is a framework for analysis—not a guarantee of future price movement.
Best Use Cases
The indicator is primarily designed for:
Swing Trading
Good fit for traders holding positions for several candles to several weeks.
Trend Following
Useful when markets establish clear directional movement.
Breakout Trading
The trendline and support/resistance components can help identify structural breaks.
Breakout Retests
Useful for watching former resistance become support or former support become resistance.
Trend Confirmation
Useful when traders want multiple technical factors visible on a single chart.
What This Indicator Is NOT
This is important for the TradingView publication.
This indicator does not guarantee profitable trades or predict future prices.
It should not be treated as:
financial advice
a standalone automated trading system
a guarantee of trend continuation
a guaranteed entry/exit system
a substitute for risk management
Signals can fail, particularly during:
sideways markets
low-volume markets
sudden news events
high volatility
false breakouts
Always combine the indicator with appropriate position sizing and risk management. 지표

Initial Balance Auction Intelligence by DGTInitial Balance Auction Intelligence (ɪʙAUC) - Market State Engine
ɪʙAUC is an Auction Market Theory framework that tracks how price develops after the Initial Balance (IB), rather than treating it as static support/resistance. Using configurable post-IB auction windows, it identifies:
Acceptance · Failed Auction · Retest / Continuation · Rejection · Two-Sided Auction
combining price location, extension relative to IB width, close strength, and retest behavior - producing Regime, Bias, Phase, Auction State, cumulative Pressure, Quality, Maturity, and Invalidation levels, with an optional dashboard and alerts on confirmed transitions.
Initial Balance & Auction States
The Initial Balance (IB) is the range established during the selected opening session, with IBH / IBL as boundaries and IBM as midpoint. Session and timezone are configurable (chart Exchange timezone or a range of predefined markets), allowing the framework to adapt to different markets and sessions.
Once the IB completes, ɪʙAUC evaluates each subsequent auction window ( 5/10/15/30 min , configurable) against it:
* PROBING ABOVE/BELOW - live, tentative; price beyond a boundary while the window is still forming
* ACCEPTED ABOVE/BELOW - a completed window closes outside the IB
* FAILED ABOVE/BELOW - price extends beyond a boundary but closes back inside
* CONTINUATION - after acceptance, a retest of that boundary holds
* REJECTION - after acceptance, a retest fails and price moves back through it
* TWO-SIDED AUCTION - both IB extremes tested and rejected - a more rotational, conflicted read
Only completed windows confirm a state transition; probing states are live/developing information.
Visuals: Decision Candles & Projections
Decision Candles (optional) visualize the developing auction window's High/Low and Open/Close, highlighted when the window interacts with IBH or IBL - live information until the window completes.
Initial Balance Projections (optional) extend reference levels above IBH and below IBL at 0.5×, 1.0×, and 1.5× the IB range . These are reference levels for evaluating potential range extension - not predicted or guaranteed targets .
Metrics & Dashboard
Conviction/Quality combines close strength, IB-relative extension, and retest behavior to grade confirmed events - Acceptance/Continuation use acceptance criteria, while Failed/Rejection/Two-Sided use failure criteria. Maturity tracks how long a state has held (Early → Developing → Mature → Exhausted).
Pressure is a bounded −100..+100 reading, accumulated across the whole session from confirmed transitions. Bias reflects only the current event. These are deliberately different questions and can disagree - Pressure is not order-flow, volume, or a probability.
Regime (session character: Balanced / Rotational / Expansion / Failed Expansion / Trend Auction) and Phase (lifecycle stage: Balance → Probe → Acceptance → Retest → Expansion/Rotation → Exhaustion) provide higher-level context on top of the raw auction state.
The optional dashboard shows Regime, Bias, Phase, Auction State, Pressure, Quality, and Next (the next structural event or retest level plus its invalidation price), each with a contextual tooltip.
How to Read It
ɪʙAUC is a contextual framework, not a standalone signal . Read Regime, Bias, Phase, Pressure, Quality, and Invalidation together - acceptance can support continuation, failed auctions can signal reversion toward balance, and two-sided auctions can favor rotation.
Alerts fire on confirmed transitions ( Accepted/Failed Above/Below, Two-Sided, Continuation, Rejection ) and include the relevant level, instrument, and IB session context.
Important Notes
Designed for intraday timeframes ≤ 30 minutes ; the engine operates only when this condition is met.
Session and timezone should match the market being analyzed.
Uses 1-minute lower-timeframe data on higher intraday charts for precise auction-window construction.
Live probes/Decision Candles are developing information; state transitions confirm only when the selected auction window completes.
DISCLAIMER
This script is intended for informational and educational purposes only. It does not constitute financial, investment, or trading advice. All trading decisions made based on its output are solely the responsibility of the user.
지표

Guassian Filtered TEWMA - [JTCAPITAL]Guassian Filtered TEWMA - is a modified way to use Gaussian filtering, Weighted Moving Averages (WMA), Triple Exponential Moving Averages (TEMA), and a dual-length averaging structure for Trend-Following.
The indicator is designed to create a smoother representation of market direction by processing price through multiple layers of smoothing. Instead of relying on a single moving average, the script first applies a Gaussian filter to the selected price source, then builds two separate TEWMA calculations using different lengths, averages those two calculations together, and finally applies another Gaussian filter to the combined result.
The result is a visually smooth trend-following structure that attempts to reduce short-term price noise while retaining the underlying directional movement of the market.
The indicator does not use future price data in its calculations. The BUY and SELL labels are generated when the detected direction changes from bullish to bearish or from bearish to bullish.
The indicator works by calculating in the following steps:
Price Source Selection
The script begins with the selected price source, which is set to Close by default. TradingView's input.source allows the user to select another available price series if desired.
This selected source becomes the raw input for the first Gaussian filtering stage.
The purpose of beginning with a configurable source is to allow the smoothing process to be applied to different representations of price rather than forcing the entire calculation to use only the closing price.
First Gaussian Filter
The selected price source is passed through a custom Gaussian filter.
The Gaussian filter looks backward over a user-defined number of bars, controlled by the Length parameter. For every historical bar inside this window, the script calculates a Gaussian weight using the following mathematical relationship:
Weight = exp(-0.5 * (i / Sigma)^2)
Here, i represents how many bars back the calculation is looking, while Sigma controls how quickly the weighting decreases as the calculation moves further into the past.
The current bar receives the largest weight because i = 0 . As the script moves further backward, the Gaussian weight becomes progressively smaller.
Each historical source value is multiplied by its corresponding Gaussian weight. These weighted values are then added together and divided by the total sum of all weights.
In simplified form:
Gaussian Filter = Sum(Source × Weight) / Sum(Weight)
This produces a weighted average where more recent data has greater influence than older data.
Unlike a simple moving average, where every observation inside the window receives the same weight, the Gaussian filter gradually reduces the influence of older observations.
This makes the first filtering stage useful for reducing short-term fluctuations before the data enters the TEWMA calculations.
Defining the Primary TEWMA Length
The script defines a primary TEWMA length using the Length input.
By default, this value is 84 .
This length is used as the basis for the first TEWMA calculation and determines how much historical information is incorporated into that moving average structure.
A larger value generally produces a slower and smoother response, while a smaller value generally produces a faster and more responsive response.
Creating the Secondary TEWMA Length
The script does not simply use one TEWMA length.
Instead, it creates a second length by multiplying the primary length by the Multi parameter.
The calculation is:
Secondary Length = Primary Length × Multi
With the default settings:
84 × 1.75 = 147
The result is then rounded to the nearest whole number because moving-average lengths must be integer values.
Therefore, the default secondary length is 147 .
This creates two different trend speeds: one relatively faster TEWMA and one slower TEWMA.
Weighted Moving Average Calculation
The first TEWMA structure begins by calculating a Weighted Moving Average of the Gaussian-filtered source.
The WMA gives greater importance to more recent observations and progressively less importance to older observations inside its calculation window.
This provides another layer of directional smoothing while maintaining more responsiveness to recent price changes than a simple moving average would normally provide.
The WMA therefore forms the first stage of each TEWMA calculation.
Triple Exponential Moving Average Calculation
After calculating the WMA, the script passes that result through TradingView's TEMA function.
TEMA stands for Triple Exponential Moving Average .
TEMA is designed to reduce the lag that can occur with conventional moving averages by combining multiple exponential moving-average calculations.
Conceptually, a TEMA can be represented as:
TEMA = 3 × EMA1 - 3 × EMA2 + EMA3
where EMA1 is the first exponential moving average, EMA2 is an EMA of EMA1, and EMA3 is an EMA of EMA2.
In this script, TEMA is applied to the WMA output rather than directly to raw price.
This creates the TEWMA structure used by the indicator.
Fast TEWMA
The first complete TEWMA calculation uses the primary Length .
The calculation can therefore be represented conceptually as:
TEWMA1 = TEMA(WMA(Gaussian-filtered source, Length), Length)
With the default parameters, the Gaussian-filtered source is first processed with an 84-period WMA and that result is then processed through an 84-period TEMA.
The purpose is to combine the weighting characteristics of WMA with the lag-reduction characteristics of TEMA.
Slow TEWMA
The second TEWMA uses the calculated secondary length.
The calculation is:
TEWMA2 = TEMA(WMA(Gaussian-filtered source, Secondary Length), Secondary Length)
With the default settings, the secondary length is 147.
Because this calculation uses a longer period, TEWMA2 generally reacts more slowly to changes in price than TEWMA1.
This gives the indicator two different representations of the underlying trend.
Dual TEWMA Averaging
The two TEWMA calculations are then combined using an arithmetic average:
TEWMA = (TEWMA1 + TEWMA2) / 2
The script uses math.avg to perform this calculation.
This is an important part of the indicator's structure.
Instead of allowing the shorter TEWMA or longer TEWMA to independently determine the final trend representation, both are given equal weight.
The faster TEWMA contributes responsiveness, while the slower TEWMA contributes additional stability.
Averaging them creates an intermediate representation between the two trend speeds.
Second Gaussian Filter
After the two TEWMA calculations are averaged, the resulting TEWMA is passed through the Gaussian filter again.
This creates the final Gaussian series.
The second Gaussian filtering stage further smooths the already-smoothed TEWMA structure.
The resulting sequence is therefore:
Price Source → Gaussian Filter → WMA → TEMA → TEWMA1
and simultaneously:
Price Source → Gaussian Filter → WMA → TEMA → TEWMA2
The two TEWMAs are then averaged:
TEWMA1 + TEWMA2 → Average TEWMA
and finally:
Average TEWMA → Gaussian Filter → Final Gaussian Trend Line
This multi-stage architecture is the central concept of the indicator.
Trend Direction Detection
Once the final Gaussian-filtered TEWMA has been calculated, the script compares its current value with its previous value.
The bullish condition is:
Gaussian > Gaussian
If the current Gaussian value is higher than the previous bar's value, the indicator considers the trend to be bullish.
The bearish condition is:
Gaussian < Gaussian
If the current Gaussian value is lower than the previous bar's value, the indicator considers the trend to be bearish.
Therefore, the trend direction is determined by the slope of the final Gaussian-filtered TEWMA , rather than by a price crossing a traditional moving average.
Persistent Trend State
The script uses a persistent variable called Signal to maintain the current trend state.
A bullish condition sets:
Signal = 1
A bearish condition sets:
Signal = -1
Because the variable is declared using var , its previous value is retained until a new bullish or bearish condition updates it.
This creates a persistent binary trend state:
1 = Bullish
-1 = Bearish
This state is subsequently used to determine the colors of the plotted lines and to identify actual transitions between bullish and bearish conditions.
Trend Visualization
When the signal is bullish, the script uses the defined BullColor .
When the signal is bearish, the script uses the defined BearColor .
The same trend state is applied to the Gaussian line, both TEWMA lines, and the averaged TEWMA line.
This means the entire indicator structure changes color together when the detected trend direction changes.
The visual design therefore allows the user to identify the current directional state without having to inspect the numerical values of the individual calculations.
BUY Signal Detection
A BUY label is only created when the persistent signal changes from bearish to bullish.
The condition is:
Signal > 0 and Signal < 0
This means the indicator must have been bearish on the previous bar and bullish on the current bar.
The BUY label is therefore not printed on every bullish bar.
Instead, it is printed only at the transition from a bearish state to a bullish state.
The label is positioned using the lowest value among the four primary plotted lines:
Gaussian
TEWMA
TEWMA1
TEWMA2
This places the BUY label below the lowest part of the indicator structure for that bar.
SELL Signal Detection
The SELL condition works in the opposite direction.
A SELL label is created when:
Signal < 0 and Signal > 0
This means the previous bar was bullish while the current bar is bearish.
Like the BUY label, the SELL label is only generated at a trend-state transition.
The SELL label is positioned using the highest value among the Gaussian line, TEWMA, TEWMA1, and TEWMA2.
This places the SELL label above the highest part of the indicator structure.
Buy and Sell Conditions:
The indicator's directional logic is deliberately straightforward.
Bullish Trend
A bullish trend is detected whenever the final Gaussian-filtered TEWMA is rising compared with the previous bar.
Gaussian > Gaussian
When this condition occurs, the persistent signal state becomes 1 , and the indicator structure is displayed using the bullish color.
Bearish Trend
A bearish trend is detected whenever the final Gaussian-filtered TEWMA is falling compared with the previous bar.
Gaussian < Gaussian
When this condition occurs, the persistent signal state becomes -1 , and the indicator structure is displayed using the bearish color.
BUY Label
A BUY label is only generated when the signal changes from:
Bearish → Bullish
This prevents a BUY label from appearing on every bar during an already-established bullish trend.
SELL Label
A SELL label is only generated when the signal changes from:
Bullish → Bearish
This similarly prevents repeated SELL labels during an established bearish trend.
It is important to understand that these labels represent changes in the calculated trend direction . They are not entries generated by a backtested strategy, and the indicator does not calculate position size, stop-loss levels, take-profit levels, risk/reward ratios, or trade performance.
The script also does not contain an additional momentum, volume, volatility, or market-regime filter. The signal is determined specifically by the direction of the final Gaussian-filtered TEWMA.
Features and Parameters:
* Source - Selects the price series used as the initial input. The default source is Close.
* Gaussian Length - Determines how many historical bars are included in each Gaussian filtering calculation. The default is 30.
* Sigma - Controls the shape and decay of the Gaussian weighting function. The default is 6.0. Higher values make the weighting decay more gradually, allowing older observations to retain more influence. Lower values concentrate the weighting more strongly toward recent observations.
* TEWMA Length - Defines the primary length used by the first WMA and TEMA stages. The default is 84.
* Multi - Multiplies the primary TEWMA length to create the second TEWMA length. The default is 1.75.
* Secondary TEWMA Length - Automatically calculated as the primary length multiplied by Multi and rounded to the nearest integer. With the default settings, this produces 147.
* TEWMA1 - The faster of the two TEWMA calculations.
* TEWMA2 - The slower of the two TEWMA calculations.
* TEWMA - The arithmetic average of TEWMA1 and TEWMA2.
* Final Gaussian - A second Gaussian-filtered version of the averaged TEWMA and the primary trend line used for determining direction.
* Trend Coloring - All major plotted lines use the same bullish or bearish color according to the current Signal state.
* BUY Labels - Appear when the calculated trend state changes from bearish to bullish.
* SELL Labels - Appear when the calculated trend state changes from bullish to bearish.
* Visual Ribbon - The script uses filled areas beneath the Gaussian, TEWMA1, TEWMA2, and averaged TEWMA lines to create a layered visual representation of the trend structure.
Specifications:
Gaussian Filter
A Gaussian filter is a weighted smoothing method based on the Gaussian, or normal, distribution.
Instead of assigning identical importance to every observation in the lookback window, the Gaussian filter gives the most recent observation the greatest weight and progressively reduces the influence of observations further in the past.
In this script, the Gaussian weighting is calculated using:
Weight = exp(-0.5 × (i / Sigma)^2)
The weighted observations are then normalized by dividing their weighted sum by the total sum of the weights.
This normalization is important because it ensures that the output remains on a comparable price scale rather than simply becoming the sum of the weighted observations.
The Gaussian filter is used twice in this indicator.
The first application smooths the selected price source before it enters the TEWMA calculations.
The second application smooths the averaged TEWMA after both trend calculations have been combined.
This creates a multi-stage smoothing architecture in which the raw price is progressively transformed into a smoother representation of directional movement.
Gaussian Length
Gaussian Length determines the number of historical observations included in each Gaussian filter.
With a default value of 30, the filter examines the current observation and the preceding 29 observations.
Increasing the length expands the historical window and can produce a smoother result.
Reducing the length shortens the window and generally allows the filter to respond more quickly to changes in price.
Length therefore represents the time window over which the Gaussian smoothing is performed.
Sigma
Sigma controls the distribution of the Gaussian weights.
The weighting function is:
exp(-0.5 × (i / Sigma)^2)
When Sigma increases, the weight decreases more slowly as the calculation moves backward through history.
Consequently, older observations retain more relative influence.
When Sigma decreases, the weight falls more rapidly, concentrating more of the calculation around recent observations.
Sigma therefore controls the shape of the smoothing kernel , while Length determines the size of the historical window.
These two parameters work together rather than independently.
Weighted Moving Average (WMA)
A Weighted Moving Average assigns progressively different weights to observations within its lookback period.
Recent observations receive greater importance than older observations.
Compared with an SMA, this allows the average to react more strongly to recent changes in the underlying series.
The WMA is used here after the initial Gaussian filtering.
This means the WMA does not operate directly on raw price. It operates on an already-smoothed price series.
The combination therefore uses two different weighting mechanisms: Gaussian weighting in the first stage and WMA weighting in the TEWMA construction.
Triple Exponential Moving Average (TEMA)
TEMA stands for Triple Exponential Moving Average.
It is designed to reduce some of the lag associated with traditional moving averages by combining three levels of exponential averaging.
Conceptually:
EMA1 = EMA(Source)
EMA2 = EMA(EMA1)
EMA3 = EMA(EMA2)
and:
TEMA = 3 × EMA1 - 3 × EMA2 + EMA3
The subtraction terms help compensate for some of the lag introduced by repeated exponential smoothing.
In this indicator, the TEMA is applied to the WMA output, creating the TEWMA structure.
TEWMA
TEWMA in this script refers to the combination of a Weighted Moving Average followed by a Triple Exponential Moving Average.
The basic structure is:
Gaussian Filter → WMA → TEMA
This is not simply a conventional moving average. It is a layered smoothing process.
The Gaussian filter reduces short-term fluctuations first.
The WMA then applies recency-weighted averaging.
The TEMA subsequently processes the WMA output with a lag-reduction-oriented exponential structure.
The resulting TEWMA therefore combines several different approaches to smoothing and weighting price data.
Dual-Length TEWMA Structure
One of the defining characteristics of this indicator is that it does not rely on one TEWMA.
It calculates two.
TEWMA1 uses the primary length.
TEWMA2 uses a longer length determined by the Multi parameter.
The shorter calculation is generally more responsive to directional changes, while the longer calculation incorporates a broader historical window and therefore generally changes more slowly.
Combining these two speeds creates a balance between responsiveness and stability.
Multi
The Multi parameter controls the relationship between the two TEWMA lengths.
The calculation is:
Secondary Length = Primary Length × Multi
For example, with a primary length of 84 and Multi of 1.75:
84 × 1.75 = 147
This means the user can control the separation between the faster and slower TEWMA without manually entering two separate lengths.
A larger Multi creates a larger difference between the two smoothing speeds.
A smaller Multi brings the two TEWMA lengths closer together.
Averaged TEWMA
After TEWMA1 and TEWMA2 are calculated, the script takes their arithmetic mean:
TEWMA = (TEWMA1 + TEWMA2) / 2
This gives both TEWMA calculations equal influence.
The purpose is to prevent the final intermediate trend representation from depending exclusively on either the faster or slower calculation.
The averaged TEWMA acts as a central representation between the two trend speeds.
Second Gaussian Smoothing Stage
The averaged TEWMA is passed through another Gaussian filter.
This creates the final Gaussian series that drives the trend-state calculation.
The second Gaussian stage is particularly important because the TEWMA average has already combined two different smoothing speeds.
Applying Gaussian smoothing afterward further reduces short-term fluctuations in that combined signal.
The final result is therefore substantially more processed than the original price source.
Slope-Based Trend Detection
The indicator does not determine direction using a price crossover.
Instead, it evaluates whether the final Gaussian series is increasing or decreasing.
Rising Gaussian = Bullish
Falling Gaussian = Bearish
This makes the indicator fundamentally a slope-based trend detector .
The actual numerical distance between price and the trend line is not used for determining the signal.
The critical variable is whether the final filtered series is moving upward or downward from one bar to the next.
Persistent Signal State
The Signal variable stores either 1 or -1.
A value of 1 represents bullish direction.
A value of -1 represents bearish direction.
This persistent state is what allows the script to distinguish between an ongoing trend and an actual transition.
For example, if the indicator remains bullish for 20 consecutive bars, it does not generate 20 BUY labels.
Instead, the BUY label is generated when the state changes from -1 to 1.
Likewise, a SELL label is generated only when the state changes from 1 to -1.
Trend Colors
The script defines a bullish blue color and a bearish purple color.
The same color state is applied to the Gaussian line, TEWMA1, TEWMA2, and the averaged TEWMA.
This makes the indicator function visually as a unified trend structure rather than presenting each component as an independently colored indicator.
Indicator Ribbon
The script creates filled regions underneath each of the four main lines.
The visible upper boundary is the respective indicator line, while the lower boundary is calculated as:
Indicator Value × 0.9
This creates a visual area beneath each line.
These fills are primarily a visualization feature . The 0.9 multiplication does not participate in the trend calculation, signal generation, or Gaussian filtering.
The BUY and SELL logic is based on the actual Gaussian and TEWMA values, not on these filled areas.
Highest and Lowest Values
The script calculates:
Lowest = minimum of Gaussian, TEWMA, TEWMA1, and TEWMA2
and:
Highest = maximum of Gaussian, TEWMA, TEWMA1, and TEWMA2
These values are used only to determine the vertical placement of the BUY and SELL labels.
The lowest value is used for BUY labels so that they appear beneath the indicator structure.
The highest value is used for SELL labels so that they appear above the indicator structure.
These calculations do not influence the actual trend state.
Why Combine Gaussian Filtering, WMA, and TEMA?
The main purpose of combining these calculations is to approach the problem of trend detection from several different smoothing perspectives.
A single moving average can be relatively sensitive to price fluctuations or relatively slow depending on its length.
The Gaussian filter introduces a smooth, gradually declining weighting structure.
The WMA places greater emphasis on recent observations.
The TEMA introduces a different smoothing mechanism designed to reduce some of the lag associated with repeated exponential averaging.
By combining these methods sequentially, the indicator does not depend on one type of smoothing alone.
The first Gaussian filter reduces noise before the TEWMA calculations begin.
The WMA emphasizes more recent information.
The TEMA processes that weighted series through a multi-stage exponential structure.
Two different TEWMA lengths then provide two different trend speeds.
Averaging those two speeds creates an intermediate trend representation.
Finally, a second Gaussian filter smooths that combined result.
The overall architecture can therefore be summarized as:
Price → Gaussian Filter → Dual WMA/TEMA → Average → Gaussian Filter → Trend Direction
The objective is not to predict the future price with certainty. Instead, the design attempts to produce a smoother representation of directional movement that can make broader trend changes easier to observe.
Why Use Two TEWMA Speeds?
The use of two TEWMA lengths provides a balance between responsiveness and stability.
The shorter TEWMA reacts more quickly to changes in the filtered source.
The longer TEWMA reacts more slowly and incorporates a larger historical window.
If only the shorter calculation were used, the trend representation could react more quickly but would also be more exposed to short-term fluctuations.
If only the longer calculation were used, the resulting trend representation would generally be more stable but slower to respond to changes.
Averaging the two creates a middle ground.
This is one of the central design choices of the indicator.
Why Apply Gaussian Filtering Twice?
The first Gaussian filter operates on the source before the TEWMA calculations.
Its role is to prepare the input by reducing short-term fluctuations before the moving-average calculations are performed.
The second Gaussian filter operates after the two TEWMAs have been averaged.
Its role is different: it smooths the final combined trend representation.
Using the filter at both stages creates a layered smoothing process rather than relying on one smoothing operation.
How to Use the Indicator
The indicator can be used primarily as a visual trend-following tool.
When the plotted structure is bullish in color and the final Gaussian line is rising, the calculated trend state is bullish.
When the plotted structure is bearish in color and the final Gaussian line is falling, the calculated trend state is bearish.
The BUY label identifies the transition into a bullish state.
The SELL label identifies the transition into a bearish state.
Users can use these transitions as potential points of interest for further analysis.
However, the indicator should be interpreted within the context of the market, timeframe, and instrument being analyzed. A trend-following calculation can naturally react differently during persistent trends compared with sideways or highly volatile conditions.
Understanding the Parameters
Length controls the Gaussian lookback window.
Sigma controls the distribution of Gaussian weights.
TEWMA Length controls the primary WMA/TEMA smoothing period.
Multi controls the relative distance between the faster and slower TEWMA.
Increasing the Gaussian Length generally increases the amount of historical data included in the filtering process.
Increasing Sigma generally spreads the Gaussian weighting more broadly across the available lookback window.
Increasing the TEWMA Length generally creates a slower and smoother trend representation.
Increasing Multi increases the difference between the two TEWMA speeds.
There is no universally optimal combination of these parameters. Different markets, instruments, and timeframes can exhibit substantially different price behavior, so users should evaluate parameter choices according to their own application.
Limitations and Important Considerations
This indicator is a trend-following tool and should not be interpreted as a prediction mechanism.
Because the script uses several layers of smoothing, changes in the final trend line can occur after the underlying price movement has already begun.
This is an inherent characteristic of smoothing-based trend indicators. More smoothing can reduce short-term fluctuations, but it can also make the resulting trend representation less responsive to sudden price changes.
Conversely, reducing the smoothing parameters can make the indicator respond more quickly while potentially exposing the trend state to more short-term fluctuations.
The BUY and SELL labels should therefore not be interpreted as guaranteed trade entries or exits.
The script is an indicator , not a TradingView strategy . It does not calculate historical strategy performance, win rate, profit factor, drawdown, position sizing, commissions, slippage, stop-losses, take-profit levels, or risk/reward ratios.
No performance or accuracy claims are made by this publication.
The indicator also does not contain a volume filter, volatility filter, momentum filter, market-regime filter, or higher-timeframe confirmation mechanism. The directional state is determined specifically by the slope of the final Gaussian-filtered TEWMA.
The Gaussian filter uses historical indexing based on the selected Length . Consequently, the available historical data and Pine Script's historical-reference limitations can affect how large the Gaussian Length can practically be set on a chart.
As with any moving-average-based calculation, insufficient historical bars can also result in unavailable values during the initial portion of a chart until enough data exists to perform the required calculations.
The script does not intentionally reference future bars. Its Gaussian filter uses the current bar and historical bars only.
On a realtime, still-forming candle, however, the current source value can change as new ticks arrive. Because the final trend calculation depends on the current bar's value, the current trend state and any signal condition can change while the realtime candle is still forming. Users should therefore distinguish between an evolving realtime bar and a confirmed historical bar.
What Makes This Indicator Different?
The purpose of this script is not simply to combine unrelated indicators.
Its components are directly connected to a single objective: constructing a smoother trend representation.
The Gaussian filter is used to reduce noise.
The WMA introduces recency weighting.
The TEMA processes the weighted series through a multi-stage exponential structure.
Two TEWMA lengths provide different trend speeds.
The two TEWMAs are averaged to create a combined trend representation.
A second Gaussian filter smooths that combined representation.
Finally, the slope of that final series determines the bullish or bearish state.
The combination therefore has a specific architectural purpose rather than being a collection of unrelated indicators.
The indicator's core concept can be summarized as:
Smooth the source → build two trend speeds → combine them → smooth the combined trend → detect its direction.
In Summary
Guassian Filtered TEWMA - is a multi-stage trend-following indicator built around a combination of Gaussian filtering, Weighted Moving Averages, Triple Exponential Moving Averages, and dual-length trend calculations.
The process begins by smoothing the selected price source with a Gaussian filter.
The filtered source is then processed through two separate WMA-to-TEMA structures using different lengths.
The resulting TEWMA1 and TEWMA2 calculations are averaged together.
That average is passed through a second Gaussian filter to produce the final trend line.
The script then compares the current final Gaussian value with its previous value.
A rising final Gaussian represents a bullish trend state.
A falling final Gaussian represents a bearish trend state.
When the state changes from bearish to bullish, a BUY label is generated.
When the state changes from bullish to bearish, a SELL label is generated.
The resulting indicator is therefore designed to provide a visually smooth representation of directional market movement while retaining two different underlying trend speeds within the calculation.
As always, the indicator should be evaluated in the context of the instrument, timeframe, market conditions, and the user's broader analysis rather than being treated as a standalone guarantee of future price direction.
Enjoy!
지표

Macro Supersector Matrix & Stock Alignment Dashboard** Overview:
The "Macro Supersector Matrix & Stock Alignment Dashboard" is an intermarket analysis tool designed for swing traders and portfolio managers looking to track institutional capital flows across major US market sectors.
Instead of monitoring 11 individual ETF charts, this dashboard groups the S&P 500 sectors into "3 Core Supersectors" and dynamically tracks whether your current charted asset is aligned with broader market health.
** Core Mechanics & Supersector Architecture:
1. Growth / Risk-On Supersector:
- Aggregates **XLK** (Technology), **XLY** (Consumer Discretionary), and **XLC** (Communications).
2. Economic Cyclicals Supersector:
- Aggregates **XLF** (Financials), **XLI** (Industrials), **XLB** (Materials), and **XLE** (Energy).
3. Defensive / Safe-Haven Supersector:
- Aggregates **XLV** (Healthcare), **XLP** (Consumer Staples), **XLU** (Utilities), and **XLRE** (Real Estate).
** Key Features:
- Institutional Volume Filter (🔥 Symbol): Highlights when sector movement is supported by above-average daily volume (SMA 20), indicating institutional participation rather than low-volume drift.
- Dynamic Stock Mapper: Automatically identifies the sector for mega-cap stocks (e.g., AAPL, NVDA, TSLA, JPM, LLY) and compares their intraday performance against macro sector flows.
- Macro Health Bias (0-100%): Weighted quantitative score determining whether current market broad-breadth conditions favor long or short swing trades.
- Pine Script v6 Codebase: Fully optimized with consolidated multi-timeframe requests to ensure fast loading times and zero repainting. 지표

Dealer Gamma Regime Proxy** Overview:
The "Dealer Gamma Regime Proxy" provides a quantitative estimation of Market Maker / Dealer Gamma Exposure (GEX) dynamics by evaluating structural volatility compression and expansion cycles.
In options markets, Dealer Gamma position dictates how market makers hedge their underlying Delta:
- Long Gamma (+GEX): Dealers trade *against* the trend (buying dips, selling rallies), suppressing market volatility and creating mean-reverting environments.
- Short Gamma (-GEX): Dealers trade *with* the trend (selling into drops, buying into rallies), accelerating price moves and increasing volatility.
** Key Features & Methodology:
1. Volatility Ratio Proxy:
- Compares short-term ATR (14) against its long-term baseline SMA (50).
- Long Gamma Regime (Green Overlay): ATR is below baseline. Indicates volatility suppression, tight consolidations, or steady upward grinds.
- Short Gamma Regime (Red Overlay): ATR spikes above baseline. Indicates market maker delta-hedging acceleration, breakout potential, or heightened risk of sharp liquidations.
2. Integrated VWAP Bands:
- Plots Session VWAP alongside standard deviation bands to serve as high-probability mean-reversion targets during Long Gamma regimes.
3. Institutional Real-Time Dashboard:
- Displays current regime status, volatility ratio, and tactical execution environment directly on your chart overlay.
** Practical Applications:
- Long Gamma Environments (Green): Favor mean-reversion setups, grid trading, and buying VWAP band bounces.
- Short Gamma Environments (Red): Favor trend-following breakouts, momentum trades, and wider stop-losses due to increased volatility.
- Asset Compatibility: Highly effective for options-heavy assets including S&P 500 (ES1! / SPY), Nasdaq 100 (NQ1! / QQQ), and Mega-Cap Equities (AAPL, TSLA, NVDA). 지표

Quantitative Monthly Seasonality Dashboard** Overview
The "Quantitative Monthly Seasonality Dashboard" is an advanced statistical overlay designed to evaluate calendar anomalies, historical performance metrics, and volatility filters for swing traders and portfolio managers.
Instead of relying solely on traditional seasonal tendencies (e.g., "Sell in May"), this indicator calculates a multi-factor **Quant Score (0-100)** by cross-referencing historical monthly win rates, profit factors, average returns, and current daily market volatility.
** How It Works
1. Historical Month Backtest: Evaluates the current calendar month across a user-defined historical lookback period (default: 20 years).
2. Key Metrics Evaluated:
- Win Rate (%): Historical percentage of positive-closing months.
- Profit Factor: Gross gains divided by gross losses for the specified month.
- Average Return (%): Expected mean return for the month.
3. Volatility Expansion Filter (Bollinger Bandwidth): Measures 20-day daily Bollinger Bandwidth to ensure the market is in an expansion/trending regime rather than a low-volatility squeeze.
4. Proprietary Quant Score (0-100): Combines and normalizes all quantitative metrics into a single rating score:
- Eligible (Long): Triggers when the asset passes win rate, profit factor, and volatility thresholds.
- Flat / No Trade: Indicates insufficient historical edge or suppressed volatility.
---
** Features & Capabilities:
- Non-Repainting Logic: Uses strict `lookahead_off` multi-timeframe requests to preserve backtest accuracy without forward bias.
- Real-Time Month Tracker: Monitors current live month returns against historical benchmarks.
- Customizable Thresholds: Fully adjustable win rate requirements, profit factor filters, and historical lookback windows.
** Best Practices:
- Top-Down Filter: Apply on Daily or Monthly charts across major indices (SPY, ES1!, QQQ), Commodities (USOIL, XAUUSD), and Mega-Cap Stocks.
- Macro Alignment: Combine this seasonal quantitative score with order flow tools or macro regime indicators to build high-probability multi-timeframe strategies. 지표

Institutional Breadth & Momentum Panel (ADD & TICK)** Overview
The **Institutional Breadth & Momentum Panel (ADD & TICK)** is a specialized real-time order flow and intermarket dashboard designed for intraday traders operating index futures (ES, NQ, YM, RTY) and major equities.
Rather than relying on traditional lagging momentum oscillators, this tool combines two core market internal metrics directly from the New York Stock Exchange (NYSE):
1. NYSE TICK ( USI:TICK ): Measures institutional aggression and order flow pressure in real time.
2. NYSE Advance-Decline Line ( USI:ADD ): Tracks broad-market participation and overall underlying market health.
** Key Components
1. NYSE TICK (Histogram)
The TICK measures the net difference between stocks trading on an uptick versus a downtick across the entire market.
- Institutional Buying Surge (+1000 Threshold):** Highlighted in solid green. Indicates aggressive institutional buying, short squeezes, or strong breakout momentum.
- Institutional Selling Panic (-1000 Threshold):** Highlighted in solid red. Indicates institutional liquidation, stop sweeps, or strong downward pressure.
- Neutral / Rotation Zone:** Softly colored histogram tracking intraday balance between buyers and sellers.
2. NYSE ADD (Orange Line)
The Advance-Decline Line provides top-down confirmation of market direction:
- An ascending ADD confirms that price rallies are backed by broad-market participation.
- A flat/descending ADD during price rallies signals divergence and potential exhaustion.
** Key Features:
Pine Script v6 Codebase: Clean, non-repainting execution utilizing historical closed bars (`close `) for intermarket symbol requests to guarantee backtest accuracy without lookahead bias.
- Built-In Alerts:** Integrated alert conditions triggered when the NYSE TICK crosses extreme institutional thresholds ($\pm 1000$).
- Customizable Symbols:** Allows custom data feed tickers (`USI:ADD`, `INDEX:ADD`, etc.) to fit your specific market data provider settings.
** Best Practices & Practical Application:
- Intraday Execution: Optimized for 1-minute, 5-minute, and 15-minute timeframes on E-mini S&P 500 (ES1!), Nasdaq (NQ1!), and SPY/QQQ.
- Breakout Confirmation:** Use extreme TICK readings (+1000 / -1000) to confirm key level breakouts.
- Exhaustion Trades:** Look for extreme TICK spikes occurring at key daily support/resistance levels to identify high-probability mean-reversion setups.
지표
