Entry TerminalEntry Terminal — Market Structure, FVG & Liquidity Suite
Entry Terminal is a multi-component market structure and execution framework. It combines confirmed structure shifts, liquidity levels, rejected blocks, FVG/IFVG zones, Fibonacci projections, ATR boundaries, higher-timeframe reference levels, and contextual momentum data.
Main Features
Confirmed CHoCH and directional BOS structure detection.
Live BLVL candidates classified as Trend Continuation or Potential CHoCH.
Bullish and bearish Rejected Block detection using wick percentage and ATR filters.
Rejected Block retest tracking.
FVG, Breaker and IFVG detection with configurable mitigation rules.
FVG overlap filtering, midpoint visualization, raids, and directional filtering.
Structured execution sequence:
CHoCH → Rejected Block → RB Retest → BOS/FVG → Final FVG Retest
Optional BUY/SELL labels after the complete sequence.
Previous-regime HH/LL liquidity targets.
Optional 0.5 ATR target zones above HH and below LL.
Two-pivot liquidity trend lines with confirmed break markers.
CHoCH-based ATR High/Low boundaries.
ATR boundary breaks classified as MATCH or COUNTER relative to the CHoCH direction.
CHoCH-based one-way ATR trailing line.
Fibonacci Entry Box, reaction zones, and dynamic expansion zones.
Selected higher-timeframe Opening Price.
Previous HTF High/Low lines originating from their exact wick candles.
HTF levels freeze when first touched.
Dashboard with:
USDT Dominance correlation and structure
Risk-On/Risk-Off context
DI+ and DI−
ADX
Momentum
Elder Force Index
Optional VWAP, SMA, EMA, and WMA overlays.
Individual and combined alerts for major events.
Suggested Entry Workflow
Long Setup
Wait for a confirmed bullish CHoCH.
Observe whether the ATR High breaks with a MATCH result.
Wait for a bullish Rejected Block to form and receive a valid retest.
Require a bullish BOS and bullish FVG association.
Consider entry when price returns to the final bullish FVG and the indicator prints BUY.
Use the Entry Box, HTF opening price, USDT.D context, and dashboard readings as additional context—not mandatory signals.
Short Setup
Wait for a confirmed bearish CHoCH.
Observe whether the ATR Low breaks with a MATCH result.
Wait for a bearish Rejected Block to form and receive a valid retest.
Require a bearish BOS and bearish FVG association.
Consider entry when price returns to the final bearish FVG and the indicator prints SELL.
Evaluate the HTF opening price, PH/PL levels, USDT.D structure, and dashboard conditions before execution.
Risk and Target Framework
Potential invalidation may be placed beyond the Rejected Block, final FVG, or relevant swing.
Potential targets include HH/LL liquidity, ATR target boxes, HTF previous levels, and Fibonacci reaction zones.
Position size should be calculated from the invalidation distance.
Avoid risking a fixed position size without accounting for volatility.
Dashboard values are contextual and should not be treated as mandatory filters.
Important Behavior
Pivot-based structures require right-side confirmation and therefore appear after the pivot is confirmed.
Primary structural events and execution signals are confirmed on closed bars.
This is an indicator, not an automated strategy, and it does not place or manage orders.
Users should independently test all settings for their symbol, timeframe, fees, and execution conditions.
Disclaimer
This script is provided for educational and informational purposes only. It does not constitute financial, investment, or trading advice. No indicator can predict market movements or eliminate the risk of loss. Even high-quality setups may fail or be stopped out. Always perform your own research, use appropriate risk management, and consult a qualified financial professional where necessary. The author assumes no responsibility for trading decisions, losses, or damages resulting from the use of this script. مؤشر

مؤشر

Trend Trigger | EMA Trend Filter + MTF Stochastic Entry with ATROverview
This strategy combines two proven, independent mechanisms rather than inventing a new indicator: a slow-moving EMA trend filter decides which direction is permitted, and a higher-timeframe-confirmed stochastic oscillator decides when to actually enter. Trend and timing are handled by separate logic layers so each does one job well, instead of stacking multiple overlapping conditions that rarely align.
How it works
Trend permission (EMA 38/62): Trades are only allowed in the direction the EMA fast/slow relationship currently supports — longs when fast > slow, shorts when fast < slow. This keeps the strategy from fighting the prevailing trend. This filter can be disabled for a pure counter-trend/mean-reversion test.
Entry timing (MTF Stochastic): The current-timeframe %K/%D stochastic must cross through the midline (50) with rising/falling momentum, and the same stochastic recalculated on the next higher timeframe (auto-stepped: 1m→5m, 1h→4h, 1D→1W, etc.) must agree in direction. This is the same core logic as classic MTF stochastic systems — entries are timed at momentum inflection points that are confirmed on a broader structural timeframe, not just the noisy current one.
Staged, ATR-based risk management: Every position opens with an ATR-scaled hard stop. Once the trade reaches a configurable R-multiple (default 1.0R), the stop moves to breakeven — locking in "no loss" without capping upside. Past a second, larger R-multiple (default 1.5R), the stop begins trailing using ATR (not fixed ticks), so the trailing distance scales with the instrument's actual volatility instead of an arbitrary number.
Secondary exits: A stochastic-fade exit (mirroring the entry logic in reverse) and an optional trend-flip exit close the trade early if the higher-timeframe signal reverses or the EMA trend turns against the position. A time-stop closes any trade that's gone nowhere after N bars.
Distinctive features
Trend and timing are decoupled — you can test pure momentum-timing (trend filter off) versus trend-confirmed pullback entries (trend filter on) with one toggle.
No fixed-tick trailing stop — every risk parameter (initial stop, breakeven trigger, trailing distance) is ATR-scaled, so the same settings behave sensibly across instruments with very different volatility (e.g., a $30 stock vs. a $60,000 crypto asset) without manual re-tuning.
Risk-based position sizing ties trade size directly to the ATR stop distance and a fixed % of equity risked per trade, rather than a flat share/contract count.
A compact confirmation meter (colored bar table) shows trend + stochastic alignment strength at a glance — no cluttered multi-line oscillator overlays on the chart.
Tips for use
Test with the trend filter both on and off separately — they represent genuinely different strategies (trend-following pullback entries vs. pure momentum reversal) and will perform differently depending on the instrument's regime.
Start testing on liquid instruments and a base timeframe of 1H or higher — the automatic higher-timeframe step needs enough bars underneath it to be meaningful; very low timeframes (1–5 min) compress the "higher timeframe" confirmation into something almost as noisy as the entry timeframe itself.
Check Average Win vs. Average Loss in the Strategy Tester, not just win rate — this strategy is built to keep those two numbers close together (via the breakeven/trailing stages), and that ratio is a better health check than win rate alone.
The breakEvenR and trailStartR inputs interact — a very tight breakeven trigger combined with a very close trail can choke off winners before they develop; a very loose one leaves more of the position exposed to giveback. Both are worth walking through several combinations on your specific instrument and timeframe rather than assuming one setting is universally correct.
This is a rules-based tool, not a guarantee — past backtest results don't ensure future performance, and all trading involves risk of loss.
استراتيجية

Buy/Sell ZonesBuy/Sell Zones
Overview
Buy/Sell Zones is a market structure indicator designed to identify potential shifts in directional order flow through Change of Character (CHOCH) events.
When a confirmed swing level is broken in the opposite direction of the previous structural break, the indicator creates a new:
BUY ZONE after a bullish CHOCH.
SELL ZONE after a bearish CHOCH.
Each zone includes a structure-break line, a directional range box, an entry level, projected range targets, optional confirmation filters, deviation markers, alerts, and a reference-asset HUD.
The indicator is not designed to predict every market reversal. Its purpose is to provide a structured visual framework for analyzing transitions between bullish and bearish market conditions.
Market Structure Detection
Swing highs and lows are detected using a configurable fractal length.
The default Fractal Length is 12. A higher value produces fewer but more significant structural levels, while a lower value reacts more quickly to short-term price action.
A structure break can be confirmed in two ways:
Close Beyond Level: The candle must close beyond the swing level.
Wick Beyond Level: The candle only needs to trade beyond the swing level.
Requiring a candle close generally produces fewer and more conservative signals.
CHOCH Logic
The indicator tracks the direction of the most recent structural break.
A bullish break following a bearish structural state creates a BUY ZONE.
A bearish break following a bullish structural state creates a SELL ZONE.
Repeated breaks in the same direction update the structural state but do not automatically create another CHOCH zone.
BUY and SELL Zone Boxes
The directional boxes are designed to display the complete price range between the originating structure level and the candle that breaks it.
BUY ZONE Box
For a bullish structure break:
The left edge begins at the pivot-high candle.
The right edge ends after the candle that breaks the pivot high.
The upper boundary is the broken pivot-high level.
The lower boundary is the lowest wick formed between the pivot and the breakout candle.
The box uses the bullish color scheme.
SELL ZONE Box
For a bearish structure break:
The left edge begins at the pivot-low candle.
The right edge ends after the candle that breaks the pivot low.
The lower boundary is the broken pivot-low level.
The upper boundary is the highest wick formed between the pivot and the breakdown candle.
The box uses the bearish color scheme.
The box borders use a dotted style to keep the zones visible without making the chart excessively heavy.
Structure Lines and Zone Labels
Every accepted zone includes a directional line connecting the originating pivot to the structure-breaking candle.
BUY ZONE: Green structure line with the label positioned above it.
SELL ZONE: Red structure line with the label positioned below it.
The label is placed near the time-based midpoint of the structure line.
The Zone Label Distance (ATR) setting controls the vertical distance between the label and the line. Because the distance is normalized with ATR, the label placement adapts to different assets, prices, and volatility conditions.
Entry Level
The midpoint of the CHOCH signal candle’s range is treated as a potential entry reference.
Bullish CHOCH midpoint: LONG ENTRY LEVEL
Bearish CHOCH midpoint: SHORT ENTRY LEVEL
This is a reference level rather than an automatic trade signal. Traders may combine it with retests, lower-timeframe confirmation, volume behavior, candle structure, or their own risk-management model.
Range Projection Levels
The signal candle’s full high-to-low range is used as the projection unit.
The indicator initially displays:
+0.5
+1
+1.5
+2
+3
+4
-0.5
-1
-1.5
-2
-3
-4
These levels can be used as potential reaction areas, expansion targets, profit-management references, or invalidation zones.
Automatic Long-Trend Expansion
To support extended directional moves, additional levels are activated automatically:
When price trades above +4, the indicator reveals +5, +6, +7, and +8.
When price trades below -4, the indicator reveals -5, -6, -7, and -8.
The additional levels remain hidden until the corresponding +4 or -4 boundary is crossed.
Optional Filters
All filters are optional and can be enabled independently.
VWAP Direction Filter
When enabled:
BUY ZONE creation requires price to close above the session VWAP.
SELL ZONE creation requires price to close below the session VWAP.
The VWAP line can be displayed separately.
EMA Trend Filter
The EMA filter is disabled by default, with a default length of 20.
When enabled:
BUY ZONE creation requires price to be above the EMA.
SELL ZONE creation requires price to be below the EMA.
Relative Volume Filter
This filter compares current volume with average volume.
A zone is rejected when current volume is below the selected multiple of its moving average.
This can help remove structure breaks that occur during relatively weak participation. It may be less useful on instruments that do not provide reliable centralized volume data.
ATR Zone-Size Filter
The signal candle’s range is normalized against ATR.
Zones can be rejected when their signal candles are:
Too small relative to current volatility.
Excessively large relative to current volatility.
This helps prevent unusually narrow or highly extended candles from generating unwanted zones.
Confirmed-Bar Filter
When enabled, a zone is created only after the structure-breaking candle has closed.
This reduces intrabar signal changes and is particularly useful for alerts.
Minimum Bars Between Zones
A configurable cooldown can be applied between accepted CHOCH zones.
This is useful for reducing clustered signals during sideways or highly volatile conditions.
Return-to-Range Detection
The indicator can monitor price movement beyond the outer +4 and -4 boundaries.
If price trades above +4 and later closes back inside the active range, a bearish return-to-range event is detected.
If price trades below -4 and later closes back inside the active range, a bullish return-to-range event is detected.
The visual marker is disabled by default and can be enabled from the Deviation Marker settings.
Return-to-range detection does not automatically imply a reversal. It identifies a possible failed expansion or deviation that may require additional confirmation.
Reference Asset Zone HUD
The indicator includes a configurable HUD that tracks the latest structural zone of another asset on the current chart timeframe.
The HUD displays:
Selected reference asset.
Reference asset’s current BUY or SELL zone.
Mapped signal for the chart.
Current timeframe.
Direct or inverse mapping mode.
The HUD size can be set to:
Tiny
Small
Normal
Large
The default size is Normal.
Why Is USDT Dominance the Default Reference?
The default reference symbol is:
CRYPTOCAP:USDT.D
USDT Dominance represents the percentage of the total cryptocurrency market capitalization held in Tether.
It is commonly monitored as a broad crypto risk-flow reference:
Rising USDT.D can indicate that capital is moving toward stablecoins and away from risk assets.
Falling USDT.D can indicate that capital is rotating from stablecoins into cryptocurrencies.
For this reason, the HUD uses inverse mapping by default:
USDT.D BUY ZONE → Chart SELL ZONE
USDT.D SELL ZONE → Chart BUY ZONE
For example, when analyzing BTC, ETH, or another cryptocurrency, a bullish structural state in USDT.D may represent defensive capital flow and therefore map to a bearish signal for the crypto chart.
This relationship is not constant and can weaken or temporarily reverse. The reference HUD should be used as contextual confirmation rather than as an independent entry system.
Reference Ideas for Other Markets
Any TradingView-supported symbol can be selected as the HUD reference asset.
Gold Traders
Gold traders may consider monitoring:
TVC:DXY — U.S. Dollar Index
TVC:US10Y — U.S. 10-Year Treasury Yield
A directly related gold instrument or futures contract
Gold frequently has an inverse relationship with the U.S. dollar. Therefore, traders using DXY as the reference may prefer inverse mapping:
DXY BUY ZONE → Gold SELL bias
DXY SELL ZONE → Gold BUY bias
Treasury yields can also affect gold, but the relationship may change depending on inflation expectations, real yields, monetary policy, and risk sentiment.
Nasdaq Traders
Nasdaq traders may consider:
CBOE:VIX — Volatility Index
TVC:US10Y — U.S. 10-Year Treasury Yield
TVC:DXY — U.S. Dollar Index
NASDAQ:QQQ or a related Nasdaq futures symbol for direct confirmation
The VIX is generally used with inverse mapping:
VIX BUY ZONE → Nasdaq SELL bias
VIX SELL ZONE → Nasdaq BUY bias
Higher Treasury yields can pressure growth and technology stocks, but this relationship is regime-dependent. DXY may also influence risk assets and multinational technology companies, although it should not be treated as a fixed inverse signal.
When using a positively correlated reference asset, disable Invert Reference Signal to use direct mapping.
Alerts
The indicator provides three optional alert conditions:
BUY Zone Created
Triggered when a new BUY ZONE passes all enabled filters and is created.
SELL Zone Created
Triggered when a new SELL ZONE passes all enabled filters and is created.
Price Returning to Range
Triggered when price trades beyond +4 or -4 and subsequently closes back inside the active range.
Each alert can be enabled or disabled independently from the indicator settings.
After enabling an alert option, create the corresponding alert through TradingView’s alert dialog. Using Once Per Bar Close is recommended when confirmed signals are preferred.
Important Usage Notes
Pivot-based market structure requires future bars to confirm a swing. Signals are therefore intentionally delayed by the selected pivot strength.
Confirmed historical pivots do not change after confirmation.
Break conditions can change during a live candle when the confirmed-bar filter is disabled.
The reference HUD uses the chart timeframe.
Relationships between markets are dynamic and may change across volatility, liquidity, macroeconomic, and monetary-policy regimes.
Enabling multiple strict filters can significantly reduce the number of zones.
The indicator does not calculate position size, stop loss, risk-to-reward, commission, slippage, or portfolio exposure.
Disclaimer
This indicator is provided for informational and educational purposes only. It does not constitute financial, investment, trading, or legal advice and should not be interpreted as a recommendation to buy or sell any asset. Market structure signals, projected levels, reference-asset relationships, and inverse correlations can fail or change without warning. Historical performance and visual examples do not guarantee future results. Always perform your own research, confirm signals independently, use appropriate risk management, and consult a qualified financial professional before making trading or investment decisions. The user assumes full responsibility for all trading decisions, profits, and losses. مؤشر

MAD Volatility Trail [BackQuant]MAD Volatility Trail
Overview
MAD Volatility Trail is a robust trend-following overlay built from a rolling median and Median Absolute Deviation rather than a conventional moving average and standard deviation.
The indicator estimates a central price using the rolling median, measures how widely recent prices are distributed around that median using MAD, converts that dispersion into adaptive upper and lower bands, and then transforms those bands into one-sided trailing boundaries.
The result is a persistent bullish or bearish trend regime with:
A robust median-based center.
MAD-derived volatility bands.
Optional ATR minimum band width.
One-sided trailing support and resistance.
Optional median-slope confirmation.
Bullish and bearish regime flips.
Strength-reactive gradient and glow.
Post-flip bloom visualization.
Trend-coloured candles.
Signal and alert support.
The main distinction is statistical.
Most volatility trails rely on:
Means.
Standard deviation.
ATR.
MAD Volatility Trail instead uses:
Median.
Median Absolute Deviation.
Median-based statistics are substantially less sensitive to isolated extreme observations, making the framework useful when the user wants a trend structure that is less influenced by individual spikes or outliers.
Core concept
The indicator separates the problem into four stages:
Estimate a robust rolling center using the median.
Measure robust dispersion around that center using MAD.
Build upper and lower adaptive deviation bands.
Convert those raw bands into persistent trailing trend boundaries.
The resulting trail behaves conceptually like a volatility-aware regime filter, but its volatility estimate comes primarily from the empirical distribution of price around its median.
Why median instead of mean?
A conventional arithmetic mean is calculated by summing all observations and dividing by their count.
Every value directly affects the result.
This makes the mean sensitive to outliers.
Consider a simplified sample:
100
101
101
102
150
The extreme value at 150 pulls the arithmetic mean upward substantially.
The median is simply the middle observation after sorting:
Median = 101
The single extreme observation has much less influence.
This property is called robustness .
In markets, isolated large candles, gaps, liquidation events and temporary price spikes can distort mean-based statistics. Median-based calculations intentionally reduce the influence of those individual observations.
Rolling median
For each bar, the indicator collects the selected Source values across the MAD Lookback.
It then calculates the exact median of the available observations.
For an odd number of observations, the median is the middle sorted value.
For an even number, the median lies between the two central observations according to the median implementation.
The resulting value becomes the statistical center of the trail.
Unlike an EMA or RMA, the median is not recursively smoothed.
It is recomputed from the actual distribution of values inside the current rolling window.
Early-history behaviour
At the beginning of the chart, the script ignores unavailable historical values.
This means the first valid median calculations may use fewer observations than the full MAD Lookback until sufficient chart history has accumulated.
Once the complete lookback is available, the calculation uses the full selected window.
Median Absolute Deviation
After calculating the rolling median, the script measures the absolute distance of every observation from that median:
Absolute Deviation = |Value - Median|
It then takes the median of those absolute deviations:
MAD = Median(|Xi - Median(X)|)
This is the Median Absolute Deviation .
MAD measures the typical distance of observations from the median.
It serves a role similar to standard deviation, but the mathematics and statistical behaviour are different.
Why MAD is robust
Standard deviation squares deviations from the mean.
Large deviations therefore receive disproportionately large influence.
A single extreme observation can:
Move the mean.
Create a very large squared deviation.
Increase the final standard deviation substantially.
MAD does not square deviations.
It calculates absolute distance and then takes another median.
Extreme values therefore have limited ability to change the result unless enough of the underlying sample shifts.
This gives MAD a high resistance to outliers.
In practical chart terms, one unusual wick or shock candle is less likely to inflate the statistical width as dramatically as it could under a standard-deviation model.
MAD versus standard deviation
The two measures answer related but different questions.
Standard deviation
Measures squared dispersion around the arithmetic mean.
MAD
Measures median absolute dispersion around the median.
Standard deviation is highly useful when a mean-and-variance framework is desired.
MAD is useful when robustness to unusual observations is more important.
The indicator does not claim one is universally superior.
It intentionally uses MAD because the purpose is to construct a robust trend boundary.
MAD Scale
Raw MAD is not numerically identical to standard deviation.
Under a normal distribution, MAD is usually multiplied by a consistency factor of approximately 1.4826 when the goal is to make it comparable to standard deviation.
The indicator exposes this scaling directly:
Robust Deviation = Raw MAD × MAD Scale
The script default is 1.4655.
The input remains fully adjustable, so users who want the conventional normal-consistency approximation can set the factor near 1.4826.
This scale does not change the median itself.
It changes only the size of the deviation estimate used to build the bands.
Deviation Factor
After scaling MAD, the indicator applies the Deviation Factor:
MAD Width = Scaled MAD × Deviation Factor
This acts as the main sensitivity control.
Lower values:
Create narrower raw bands.
Place the trail closer to price.
Produce more frequent regime changes.
Higher values:
Create wider bands.
Require larger movement for reversals.
Produce more persistent trend states.
The MAD Scale and Deviation Factor both affect width, but they represent different concepts.
MAD Scale calibrates the statistical dispersion estimate.
Deviation Factor determines how much of that estimated dispersion is used for the trend envelope.
Raw MAD bands
The raw bands are:
Upper MAD Band = Median + Band Width
Lower MAD Band = Median - Band Width
Before trailing logic is applied, these bands can move freely upward or downward with:
The rolling median.
MAD dispersion.
Any active ATR floor.
These are statistical envelopes around the median.
They are not yet the final trend trail.
ATR Minimum Width
MAD can become extremely small when recent prices are tightly clustered.
In very low-dispersion conditions, this may place the raw bands extremely close to the median.
That can create excessive sensitivity to minor price fluctuations.
The optional ATR Minimum Width provides a secondary floor.
The script calculates:
ATR Floor = ATR(ATR Length) × ATR Floor Multiplier
When enabled:
Band Width = max(MAD Width, ATR Floor)
This means MAD remains the primary volatility model, but the bands cannot contract below the selected ATR-based threshold.
Why use an ATR floor?
MAD and ATR measure different aspects of market behaviour.
MAD measures:
Dispersion of the selected source around its rolling median.
ATR measures:
Bar-to-bar trading range.
Gaps relative to the previous close.
A market can have:
Low median dispersion.
But still produce meaningful intrabar range.
The ATR floor can prevent the trail from becoming unrealistically tight under those conditions.
ATR floor disabled
With ATR Minimum Width disabled, the entire structural width comes from:
MAD × MAD Scale × Deviation Factor
This produces the purest MAD-based version of the indicator.
ATR Length
ATR Length controls the volatility horizon used only for the optional minimum-width calculation.
It does not affect:
The rolling median.
Raw MAD.
Scaled MAD.
Note that the visual glow and bloom later in the script use a fixed ATR(14), separate from this ATR Length input.
Trailing bands
The raw MAD bands are converted into one-sided trails.
This is the stage that turns a statistical envelope into a persistent trend system.
Two independent trails are maintained:
Lower Trail.
Upper Trail.
Lower Trail
When the previous trigger remains above the previous Lower Trail, the new Lower Trail is:
max(Current Raw Lower Band, Previous Lower Trail)
This means the Lower Trail can:
Move upward.
Remain unchanged.
But cannot move downward while the condition remains active.
This creates a ratcheting support structure.
If the trigger falls below the prior Lower Trail, the trail is allowed to reset to the new raw lower band.
Upper Trail
When the previous trigger remains below the previous Upper Trail, the new Upper Trail is:
min(Current Raw Upper Band, Previous Upper Trail)
This means the Upper Trail can:
Move downward.
Remain unchanged.
But cannot move upward while the condition remains active.
This creates a ratcheting resistance structure.
If the trigger rises above the previous Upper Trail, the band can reset to the current raw upper value.
Why trailing the bands matters
A raw median-deviation envelope moves in both directions.
If those raw bands were used directly for trend changes:
The threshold itself could retreat toward price.
Small changes in median or MAD could produce unstable reversals.
The one-sided trail introduces hysteresis .
Hysteresis means that once a trend regime is established, the threshold required to reverse it remains on the opposing side.
This reduces the tendency to flip repeatedly around the rolling median.
Flip Trigger
The user can choose which series is used when evaluating trail breaks:
Close.
Source.
Close
Uses the candle close regardless of which series is used for the MAD calculation.
This is the conventional option.
Source
Uses the selected Source input.
For example, if HLC3 is selected as the Source:
The median is calculated from HLC3.
MAD is calculated from HLC3.
The trail can also be triggered by HLC3.
This keeps the center, dispersion and reversal trigger based on the same source.
Initial trend state
The trend begins in a neutral state.
Once a valid rolling median is available:
Trigger at or above Median = bullish initialization.
Trigger below Median = bearish initialization.
This initial assignment is not treated as a bullish or bearish flip.
Flip signals occur only after the indicator has already established one regime and later transitions into the opposite regime.
Bullish flip
A bullish regime change requires:
Trigger to move above the Upper Trail.
Current trend not already bullish.
Optional bullish median-slope confirmation to pass.
Once confirmed:
Trend becomes bullish.
The Lower Trail becomes the active trend boundary.
A bullish signal can be displayed.
Bearish flip
A bearish regime change requires:
Trigger to move below the Lower Trail.
Current trend not already bearish.
Optional bearish median-slope confirmation to pass.
Once confirmed:
Trend becomes bearish.
The Upper Trail becomes the active boundary.
A bearish signal can be displayed.
Active trend trail
The final displayed trend boundary depends on the regime:
Bullish = Lower Trail.
Bearish = Upper Trail.
This means the line automatically moves to the opposite side of price when a complete regime change occurs.
Median Slope Confirmation
The optional Median Slope Confirmation adds a directional requirement to trend reversals.
For a bullish flip:
Current Median > Median from Slope Lookback bars ago
For a bearish flip:
Current Median < Median from Slope Lookback bars ago
This requires the robust statistical center itself to move in the direction of the proposed new trend.
Why confirm with median slope?
Price can briefly cross a trail while the underlying median remains flat or continues moving in the opposite direction.
Slope confirmation can reject some of these events.
For example:
A bullish trail break with a still-falling median may represent:
A temporary rebound.
A liquidity sweep.
Noise inside a larger bearish structure.
Requiring the median to rise adds another layer of confirmation.
The trade-off is lag.
A genuine reversal may cross the trail before the rolling median has clearly changed direction.
Slope Lookback
Slope Lookback controls how far back the median is compared.
Lower values:
Respond more quickly.
Require only a very local median turn.
Higher values:
Require a broader directional shift.
Produce stronger confirmation.
Can delay reversals.
This same lookback is also used in the visual slope-strength calculation even when slope confirmation itself is disabled.
Break Trail On Flips
When enabled, the displayed trail is temporarily hidden on the actual regime-flip bar.
This creates a visual break between:
The previous regime’s trail.
The new regime’s trail.
Without the break, the plotting engine can draw a connecting segment from one side of the market to the other.
That connection has no analytical meaning.
Break Trail On Flips affects visualization only.
It does not affect:
Trend state.
Raw bands.
Trail calculations.
Signals.
Robust trend structure
The complete structural model can therefore be summarized as:
Rolling Median determines robust center.
MAD determines robust dispersion.
MAD Scale calibrates the dispersion.
Deviation Factor determines band distance.
Optional ATR floor prevents excessive compression.
Raw bands form the initial envelope.
Ratchet logic creates trailing support and resistance.
Opposite-trail breaks determine regime changes.
Optional median slope confirms those reversals.
This combination is what separates the indicator from simply plotting median ± MAD.
Visual strength model
The script calculates a separate Trend Strength value used only to control the presentation of the gradient and glow.
It does not alter:
Trend direction.
Trail levels.
Flip conditions.
Trend Strength combines:
Price distance from the active trail.
Absolute rolling-median slope.
Distance Strength
The script first measures:
Trail Distance = |Close - Active Trail|
This is normalized by the current band width.
The normalized distance is capped when price reaches twice the active band width away from the trail.
Conceptually:
Close to trail = low distance strength.
Far from trail = high distance strength.
This reflects how separated price is from the current structural boundary.
Slope Strength
The indicator also measures:
|Current Median - Median |
This value is normalized by the current band width and capped at one.
The purpose is to compare median movement against the current statistical width.
A steep median relative to the band width produces stronger visual slope strength.
Combined Trend Strength
The final visual strength is:
70% Distance Strength.
30% Median Slope Strength.
and is capped at one.
The distance component receives greater weight because the visual system places more emphasis on how strongly price is separated from the active trail.
Again, this number is not a probability, forecast or additional signal.
It is a visual intensity measure.
Layered gradient
The area between the active trail and current close is divided into several intermediate levels.
The script creates reference points approximately:
15% of the distance from trail to price.
35%.
60%.
82%.
Then the final segment to price.
These create five layered gradient regions.
The layers become progressively more transparent as they move away from the trail.
This gives the trail visual depth without turning the entire area between price and structure into one solid block.
Gradient direction
The geometry of the gradient is determined by whether close is above or below the active trail.
The colour itself comes from the current bullish or bearish trend regime.
The gradient therefore visualizes:
The active trend colour.
The distance between price and trail.
The relative strength of the trend visualization.
The gradient does not determine the regime.
Trend-strength gradient response
Higher Trend Strength reduces transparency in several layers.
This makes the ribbon more visible when:
Price is strongly separated from the trail.
The rolling median is moving meaningfully.
Lower strength produces a softer appearance.
This allows the visual presentation to communicate more than simple bullish or bearish state.
Flip bloom
The indicator includes a temporary post-flip bloom.
The bloom is derived from the number of bars elapsed since the most recent bullish or bearish transition.
Importantly, in the current implementation the bloom begins after the flip bar:
Flip bar: no bloom boost.
1 bar after flip: maximum bloom.
2 bars after flip: reduced bloom.
3 bars after flip: smaller residual bloom.
Afterward: bloom disappears.
The relative bloom strengths are:
1.00
0.55
0.25
This emphasizes the early bars following a newly confirmed regime change.
Why bloom after the flip?
The flip itself can optionally contain a break in the trail.
Applying the bloom to the following bars emphasizes the newly established active trail rather than drawing a large effect around a temporarily hidden flip point.
The bloom is cosmetic.
It does not modify the underlying calculations.
Trail glow
The active trail can also display a persistent glow.
Glow width is based on:
ATR(14) × a factor that increases with Trend Strength
This ATR(14) is fixed for visualization and is independent of the user-selected ATR Length used by the optional minimum-width floor.
The glow therefore becomes slightly wider as visual trend strength increases.
Two layers are used:
A tighter inner glow.
A broader outer glow.
The inner glow responds more strongly to Trend Strength and post-flip bloom.
Rolling Median display
The rolling median can be displayed independently from the trail.
This is useful for studying the difference between:
The current robust center.
The statistical raw bands.
The ratcheting trend trail.
During a bullish regime, the active Lower Trail can remain below the rolling median.
During a bearish regime, the active Upper Trail can remain above it.
The median is not itself the trend signal.
Raw MAD Bands display
The raw upper and lower MAD bands can also be shown.
These lines make it easier to see how the trailing logic differs from the unrestricted statistical envelope.
Raw bands:
Can move in either direction.
Trailing bands:
Can ratchet in only one direction while their persistence condition remains active.
The gap between raw and trailing levels illustrates the hysteresis introduced by the trend logic.
Trend candles
The script can redraw candles on the main chart using the active trend colour.
Bullish regime:
Uses the selected Bullish colour.
Bearish regime:
Uses the selected Bearish colour.
The candle colour represents the persistent trail regime, not whether each individual candle closed higher or lower.
A bearish candle can therefore remain bullish-coloured while the broader MAD Trail regime remains bullish.
Signal markers
Bullish and bearish markers appear only on complete transitions between established regimes.
A bullish marker requires:
Previous trend = bearish.
Current trend = bullish.
A bearish marker requires:
Previous trend = bullish.
Current trend = bearish.
Initial trend assignment does not generate a flip marker.
How to interpret the indicator
Bullish regime
A bullish state means price has previously broken above the opposing Upper Trail and the Lower Trail is now active.
The Lower Trail can be interpreted as:
Dynamic trend support.
A structural invalidation reference.
A trailing regime boundary.
Bearish regime
A bearish state means price has broken below the opposing Lower Trail and the Upper Trail is active.
The Upper Trail can be interpreted as:
Dynamic resistance.
A bearish invalidation reference.
A trailing regime boundary.
Price close to trail
When price approaches the active trail:
Visual distance strength decreases.
The gradient becomes softer.
The market is closer to the regime boundary.
This does not guarantee a reversal.
A healthy trend can repeatedly retest its active trail.
Price far from trail
When price moves substantially away:
Distance Strength rises.
The visual effect becomes stronger.
This indicates greater separation from the active structural boundary.
It should not automatically be interpreted as a better entry.
A market can be strongly extended and simultaneously close to exhaustion.
Median and trail rising together
During a bullish regime, a rising median combined with a rising Lower Trail indicates:
The robust center is moving upward.
The structural support boundary is also advancing.
This represents cleaner directional alignment.
Median flattening while trail remains bullish
The persistent regime can remain bullish while the median begins flattening.
This indicates:
The trend has not yet been invalidated.
But the robust center is no longer advancing as strongly.
The visual slope-strength component may weaken under this condition.
Raw band expansion
If MAD increases:
Raw bands widen.
Trail reset levels can move farther away.
This means recent source values are becoming more dispersed around the median.
Raw band contraction
If MAD falls:
The raw envelope tightens.
If the ATR floor is disabled, the structure can become substantially narrower.
If the ATR floor is enabled, contraction stops once the selected minimum width is reached.
How to use the indicator
1. Trend regime filter
Use the persistent trail state as directional context:
Bullish trail regime = prioritize long-side setups.
Bearish trail regime = prioritize short-side setups.
The trail does not define a complete trading system by itself.
2. Pullback structure
During a bullish regime, the Lower Trail can provide a dynamic reference for deeper pullbacks.
During a bearish regime, the Upper Trail can provide a reference for rallies.
The farther price moves from the trail, the greater the current structural separation.
3. Regime transitions
Bullish and bearish flips identify moments when price has crossed completely through the opposing robust-deviation trail.
These may be used as:
Trend-change alerts.
Confirmation for another entry method.
Potential exit conditions.
4. Median confirmation
Users who want more selective signals can enable Median Slope Confirmation.
This can be especially useful when:
The market is choppy.
Price frequently sweeps through statistical boundaries.
5. Pure robust-volatility mode
Disable the ATR Minimum Width to make band width depend only on:
Rolling MAD.
MAD Scale.
Deviation Factor.
This produces the purest version of the model.
6. Hybrid robust-volatility mode
Enable ATR Minimum Width when the MAD channel becomes too narrow for the instrument or timeframe.
This preserves MAD as the primary engine while adding a conventional range-based safety floor.
Input guide
Source
Series used for the rolling median and MAD calculation.
MAD Lookback
Controls the number of observations used for the rolling median and dispersion estimate.
Shorter values adapt faster.
Longer values create a broader and more stable distribution.
MAD Scale
Multiplier applied directly to raw MAD.
The commonly cited normal-distribution consistency factor is approximately 1.4826; the script default is 1.4655.
Deviation Factor
Controls the final width of the MAD envelope.
ATR Minimum Width
Prevents the active band width from falling below an ATR-derived floor.
ATR Length
Controls the ATR used by the optional floor.
ATR Floor
Controls the minimum width as a multiple of ATR.
Median Slope Confirmation
Requires the rolling median to move in the direction of a proposed trend flip.
Slope Lookback
Controls how far back the current median is compared.
It also influences the visual slope-strength calculation.
Flip Trigger
Selects Close or Source for trail-break detection.
Break Trail On Flips
Creates a visual discontinuity on transition bars.
How this differs from a standard Supertrend
A conventional Supertrend generally uses:
A price midpoint such as HL2.
ATR as the full band-width model.
MAD Volatility Trail instead uses:
Rolling median as its center.
Median Absolute Deviation as its primary width.
ATR only as an optional minimum floor.
The trail mechanics are conceptually related, but the statistical foundation is different.
How this differs from Bollinger Bands
Bollinger Bands normally use:
A moving average.
Standard deviation.
Symmetrical raw bands.
MAD Volatility Trail uses:
Rolling median.
Median Absolute Deviation.
One-sided trailing bands.
Persistent trend-state logic.
Bollinger Bands are primarily a statistical envelope.
MAD Volatility Trail converts its robust statistical envelope into a trend-regime system.
How this differs from median ± MAD alone
A simple median-MAD indicator would plot:
Median.
Median + MAD width.
Median - MAD width.
Those bands would move freely.
This indicator adds:
Ratchet logic.
Persistent bullish/bearish state.
Opposite-trail break conditions.
Optional median-slope confirmation.
Signals and alerts.
The raw statistical model is therefore only the first stage.
MAD versus ATR
ATR measures the size of trading ranges.
MAD measures dispersion of the selected source around its median.
They can behave very differently.
For example:
A volatile but mean-reverting market can have large ATR with relatively controlled median dispersion.
A persistent directional displacement can produce increasing MAD even if individual candle ranges are moderate.
The optional floor allows both concepts to coexist without replacing the MAD foundation.
Robust statistics and financial markets
Financial return and price distributions frequently contain:
Outliers.
Large jumps.
Skew.
Fat tails.
Mean-and-standard-deviation models remain extremely useful, but robust alternatives can provide different information when unusual observations are present.
Median and MAD belong to a family of robust statistical tools designed to reduce sensitivity to extreme sample values.
This does not make the resulting indicator immune to market shocks.
If enough of the rolling window moves, the median and MAD will also move.
The advantage is primarily that one isolated observation has less influence.
Strengths
Uses an exact rolling median.
Uses exact Median Absolute Deviation rather than an approximation.
More resistant to isolated outliers than mean/standard-deviation envelopes.
Provides a configurable MAD scale.
Supports a pure MAD or MAD-plus-ATR hybrid width.
Converts robust statistics into persistent trend boundaries.
Uses one-sided trail logic to reduce rapid regime switching.
Provides optional median-direction confirmation.
Separates signal logic from visual strength.
Includes dynamic gradient, glow and post-flip visualization.
Exposes raw MAD, scaled MAD, active band width and Trend Strength in the Data Window.
Limitations
The indicator is reactive rather than predictive.
Robust statistics do not eliminate whipsaws.
A very short MAD Lookback can still react sharply.
A very long lookback can delay adaptation to new regimes.
Median calculations can remain unchanged across several bars and then move discretely as the rolling sample changes.
Higher Deviation Factors reduce reversals but increase confirmation lag.
The ATR floor changes the model from pure MAD dispersion to a hybrid MAD/ATR structure.
Median Slope Confirmation can reject false breaks but also delay genuine reversals.
Extreme readings in the visual-strength system are not probabilities of continuation.
Glow and bloom are cosmetic and should not be treated as separate signals.
Computational considerations
Unlike many moving averages, the exact rolling median and MAD calculations require the script to build and process the values inside the selected window.
For each bar:
The rolling source sample is collected.
Its median is calculated.
Absolute deviations from that median are calculated.
A second median is calculated from those deviations.
Larger MAD Lookbacks therefore require more work than a simple recursive EMA or ATR calculation.
This is the cost of calculating the robust statistics directly.
Causality and live-bar behaviour
The indicator uses current and historical values without intentional future-looking references.
On completed historical bars, the model is causal.
On a live unfinished bar:
The Source can change.
The current rolling median can change.
MAD can change.
Raw bands can change.
A trail break can appear or disappear.
Users who require confirmed regime changes should evaluate signals at bar close.
Data Window
The indicator exposes four useful diagnostic values.
Raw MAD
The unscaled median absolute deviation.
Scaled MAD
Raw MAD multiplied by the selected MAD Scale.
Active Band Width
The actual band width after:
MAD scaling.
Deviation Factor.
Optional ATR minimum floor.
Trend Strength
The visual-strength score expressed from approximately 0 to 100.
This is calculated from trail distance and median movement.
It is not part of the trend-flip logic.
Alerts
The indicator includes:
MAD Trail Bullish: established bearish regime changes to bullish.
MAD Trail Bearish: established bullish regime changes to bearish.
MAD Trail Flip: either regime transition occurs.
Summary
MAD Volatility Trail builds a trend-following regime from robust statistics.
The calculation begins with an exact rolling median of the selected Source.
Rather than measuring dispersion with standard deviation, the script calculates the Median Absolute Deviation:
MAD = Median(|X - Median(X)|)
The raw MAD is scaled and multiplied by a configurable Deviation Factor to create the statistical width around the rolling median.
The resulting raw upper and lower bands are:
Median + Band Width.
Median - Band Width.
An optional ATR minimum floor prevents these bands from becoming excessively narrow during low-dispersion conditions.
The raw envelope is then transformed into one-sided trailing boundaries.
The Lower Trail can ratchet upward while price remains above it, while the Upper Trail can ratchet downward while price remains below it.
These trails create hysteresis and form the actual regime-switching structure.
A bearish regime turns bullish only when the selected trigger breaks above the opposing Upper Trail, optionally while the rolling median itself is rising.
A bullish regime turns bearish only when the trigger breaks below the Lower Trail, optionally while the median is falling.
The active Lower Trail is displayed during bullish regimes and the active Upper Trail during bearish regimes.
A separate visual-strength model measures price-to-trail distance and median slope relative to the active band width. That score controls gradient and glow intensity but does not alter signals.
The result is a robust alternative to conventional mean-, standard-deviation- and ATR-centered trend trails.
Rather than allowing individual extreme prices to dominate its statistical center and dispersion estimate, MAD Volatility Trail uses the median twice: once to define the center of the distribution and again to define the typical absolute distance from that center.
This creates a trend framework designed around robust location, robust dispersion and persistent trailing structure .
مؤشر

Pivot MA StructurePivot MA Structure— Complete User Guide
1. General Purpose
This indicator combines several independent market-reading components into one framework:
Pivot-controlled directional moving averages
Bullish and Bearish market-structure shifts
Pre-break structure candidates
Trend-continuation markers
Shift-direction MA retests
Anchored VWAP equilibrium
RSI 50 equilibrium
Fair Value Gaps and breakers
Long/Short health scores
A real-time information dashboard
Selectable alerts
It is an indicator, not an automated strategy. It does not place orders, calculate position size, or automatically manage stop-loss and take-profit orders.
Its primary objective is to answer five questions:
What is the latest structural direction?
Which directional Pivot MA is currently active?
Do structure and the active MA agree?
Do VWAP and RSI support the same direction?
Is there a suitable continuation or retest location for entry?
2. The Core Reading Model
The indicator separates market information into three layers.
Structural layer
This layer detects:
Bullish Shift
Bearish Shift
Bullish continuation
Bearish continuation
Unbroken bullish and bearish candidates
A Shift represents a change in the direction of confirmed structure breaks.
Directional MA layer
This layer determines whether the active moving-average condition is:
Bullish
Bearish
Ghost/inactive
Still waiting for a valid pivot
Only one directional MA can be active at a time.
Confirmation layer
The following secondary filters measure the quality of the directional condition:
Anchored VWAP
RSI relative to 50
Fair Value Gaps
Directional MA retests
Health score
A structural signal does not automatically imply that all confirmation filters agree.
3. Pivot Moving Average System
Default settings
MA type: EMA
MA length: 50
Pivot strength: 5
Pivot qualification: All Confirmed Pivots
Source: Pivot Side
The MA type can be changed to:
EMA
SMA
WMA
RMA
HMA
Pivot Side source
When MA Source = Pivot Side:
The bullish MA is calculated from low.
The bearish MA is calculated from high.
This creates two distinct directional averages:
Green MA for bullish conditions
Red MA for bearish conditions
If Close or HL2 is selected, both averages use the selected common source.
How a Pivot MA is created
A bullish Pivot MA becomes available after a qualifying confirmed low pivot.
A bearish Pivot MA becomes available after a qualifying confirmed high pivot.
The pivot does not become known immediately. With Pivot Strength set to 5, the system requires five bars on the right side of the pivot before confirming it.
Therefore, pivot activation is intentionally delayed.
Pivot Qualification
All Confirmed Pivots
This is the default mode.
Every confirmed low pivot can refresh the bullish MA state.
Every confirmed high pivot can refresh the bearish MA state.
This allows higher lows in an uptrend to reactivate the bullish side and lower highs in a downtrend to refresh the bearish side.
HH / LL Only
This is a more selective mode.
A bearish MA trigger requires a pivot high above the previous pivot high.
A bullish MA trigger requires a pivot low below the previous pivot low.
This mode generates fewer MA refresh events and may leave an MA in ghost mode for longer.
4. Active and Ghost MA Logic
Active bullish MA
The bullish MA is eligible to become active when:
The bullish MA exists.
It has not remained locked by an unresolved break.
Price is at or above the bullish MA.
The bullish MA is rising.
Active bearish MA
The bearish MA is eligible when:
The bearish MA exists.
It has not remained locked by an unresolved break.
Price is at or below the bearish MA.
The bearish MA is falling.
One active MA at a time
The indicator does not allow both MAs to be active simultaneously.
If only the bullish side is eligible:
Bullish MA becomes active.
Bearish MA becomes ghost.
If only the bearish side is eligible:
Bearish MA becomes active.
Bullish MA becomes ghost.
If neither side is eligible:
Both lines can appear as ghost lines.
If both sides are technically eligible during compression:
A new bearish pivot or downward bar movement gives priority to the bearish MA.
Otherwise, the bullish MA receives priority.
Active line thickness
The active directional MA is always displayed one step thicker than a ghost MA.
This allows the currently accepted directional condition to be identified visually without relying only on color.
Ghost lines
A ghost line is a faded directional MA.
Ghost status means that the MA still exists and is still calculated, but it is not currently accepted as the active directional condition.
A ghost line is not frozen. Its value continues to move because the underlying MA calculation continues.
MA break behavior
The bullish MA is broken when price crosses below it according to the selected break confirmation.
The bearish MA is broken when price crosses above it.
The break method can be:
Close: requires the closing price to cross the MA.
Wick: reacts to the bar’s low or high crossing the MA.
After a genuine break, the line becomes ghosted. A new qualifying same-side pivot can reset its broken state.
5. Market Structure Engine
Default structure length
Structure Length: 12
The engine uses an odd-length fractal model. An even input is internally advanced to the next odd number.
Therefore:
Input 12 becomes an internal 13-bar fractal.
Pivot strength becomes 6 bars on each side.
This is different from using 12 left bars and 12 right bars. It is a full fractal-window interpretation.
Confirmed structure pivots
The engine continuously tracks:
Latest confirmed fractal high
Latest confirmed fractal low
These become potential break candidates.
A structure pivot appears only after its required right-side bars have completed.
6. Candidate Lines
Bullish Break Candidate
A confirmed fractal high creates a bullish break candidate.
It is displayed as:
Green dotted line
Bullish Break Candidate text above the line
This level represents the price that must be exceeded for an upward structure break.
Bearish Break Candidate
A confirmed fractal low creates a bearish break candidate.
It is displayed as:
Red dotted line
Bearish Break Candidate text below the line
This level represents the price that must be broken for a downward structure break.
Candidate projection
The default projection is five bars to the right.
The candidate does not extend infinitely. On every new bar:
Its right endpoint moves forward.
It remains five bars ahead of the current bar.
It stops when broken or replaced by a newer same-side pivot.
Candidate replacement
When a newer confirmed pivot of the same side appears:
The previous unbroken candidate is deleted.
A new candidate begins from the newer pivot.
This ensures that the chart emphasizes the latest actionable structure level.
7. Bullish and Bearish Shift Logic
The internal logic follows a CHoCH-style direction-change model, but the chart does not display the word “CHoCH.”
It uses:
Bullish Shift
Bearish Shift
Bullish Shift
A Bullish Shift occurs when:
The last confirmed structure break was downward.
Price subsequently breaks the latest unbroken fractal high.
The break can be confirmed by:
Close above the level, or
Wick above the level
depending on the selected Break Confirmation.
When confirmed:
The candidate line ends at the breakout bar.
The line becomes a stronger green dotted shift segment.
Bullish Shift appears above the middle of the segment.
The dashboard’s Latest Shift changes to Bullish Shift.
The bullish retest detector becomes armed.
Bearish Shift
A Bearish Shift occurs when:
The last confirmed structure break was upward.
Price subsequently breaks the latest unbroken fractal low.
When confirmed:
The candidate line ends at the breakdown bar.
It becomes a stronger red dotted shift segment.
Bearish Shift appears below the middle of the line.
The dashboard changes to Bearish Shift.
The bearish retest detector becomes armed.
First structure break
The first break establishes the initial direction.
Because no previous opposite break exists, it is not classified as a Shift.
It is treated as a continuation break and receives a directional triangle.
8. Trend-Continuation Triangles
The indicator does not draw BOS lines.
Instead, a same-direction continuation break is marked directly on the breaking candle.
Bullish continuation
A bullish continuation is shown as:
Green upward triangle
Located below the breakout candle
It means that an upward break occurred without reversing the previous break direction.
Bearish continuation
A bearish continuation is shown as:
Red downward triangle
Located above the breakdown candle
It means that a downward break occurred without reversing the previous break direction.
How to interpret continuation marks
Continuation triangles are not fresh reversal signals.
They are better interpreted as confirmation that the existing structural direction is continuing.
A continuation marker is generally more useful when:
The matching directional MA is active.
Price is on the correct side of VWAP.
RSI supports the same direction.
The breakout is not entering directly into an opposing FVG or major swing level.
Avoid treating every continuation triangle as an automatic market entry. Entering immediately after an extended breakout can create poor risk-to-reward.
9. Directional MA Retest — “R” Marker
Important definition
In the current version, the R marker detects a retest of the same-direction Pivot MA, not the horizontal dotted shift line.
After a Bullish Shift:
The indicator monitors the green bullish Pivot MA.
After a Bearish Shift:
It monitors the red bearish Pivot MA.
Bullish retest
After a Bullish Shift, the retest detector waits for a later candle whose range intersects the green bullish MA:
Candle low is at or below the MA.
Candle high is at or above the MA.
When the first valid touch occurs:
A green R appears below the candle.
The bullish retest alert can trigger.
The retest detector stops waiting until a new Shift occurs.
The green line can be active or ghost. The retest detector only requires the corresponding bullish MA to exist.
Bearish retest
After a Bearish Shift, the first later candle that intersects the red bearish MA produces:
A red R
Located above the candle
A bearish retest alert opportunity
Why an R may not appear
An R will not appear when:
No valid Bullish or Bearish Shift has occurred.
The contact happens on the Shift candle itself.
The candle does not actually intersect the MA value.
The first retest after that Shift has already been marked.
A new opposite Shift replaced the previous retest direction.
The corresponding directional MA does not yet exist.
Show Directional MA Retests is disabled.
The visual toggle does not disable the underlying alert calculation.
10. Anchored VWAP Equilibrium
Default status
The VWAP line is enabled by default.
Available anchors
Session
Week
Month
Session
The VWAP resets with the daily/session boundary.
Week
The VWAP resets at the beginning of each week.
Month
The VWAP resets at the beginning of each month.
Horizontal VWAP presentation
The indicator does not plot the entire conventional curved VWAP history.
Instead, it takes the latest anchored VWAP value and displays it as a horizontal equilibrium reference.
Default presentation:
100 bars to the left
10 bars to the right
VWAP label on the right
Dashed neutral-colored line
The right-side length and label offset are adjustable.
Bullish interpretation
Price above VWAP suggests that current price is trading above the volume-weighted equilibrium.
This supports a bullish setup.
Bearish interpretation
Price below VWAP suggests that price is trading below the volume-weighted equilibrium.
This supports a bearish setup.
VWAP as a trade-management filter
For an existing long:
Remaining above VWAP supports the health of the position.
Losing VWAP removes one bullish health point.
Reclaiming VWAP can restore that point.
For an existing short:
Remaining below VWAP supports the bearish condition.
Moving above VWAP weakens the short health score.
VWAP alone is not an entry or exit signal. It is an equilibrium filter.
11. RSI 50 Price Equilibrium
Default settings
RSI Length: 14
RSI line: enabled
Midpoint: 50
HUD interpretation
RSI at or above 50 is bullish.
RSI below 50 is bearish.
Horizontal RSI 50 price line
A literal RSI value of 50 cannot be plotted meaningfully on the same price scale as BTC, forex, or commodities.
Therefore, the indicator stores the closing price where RSI most recently crossed 50.
That price becomes the RSI 50 horizontal equilibrium level.
It represents the latest price associated with a momentum-regime transition.
The line:
Is green when the current RSI is above 50.
Is red when the current RSI is below 50.
Extends a configurable number of bars left and right.
Has an offset label on the right.
Practical use
For a long position:
RSI above 50 supports positive momentum.
RSI falling below 50 reduces long health.
For a short position:
RSI below 50 supports negative momentum.
RSI reclaiming 50 reduces short health.
RSI 50 should be used as confirmation, not as a standalone trigger.
12. Fair Value Gap Engine
The FVG engine is enabled by default.
It supports:
Standard FVG mode
Breaker mode
Bullish and bearish zones
ATR threshold filtering
Multiple mitigation methods
Overlap filtering
Midlines
Optional right extension
Optional raid tracking
Bullish FVG
A bullish FVG is created when the current low is above the high from two bars earlier, producing a three-candle imbalance.
The engine also applies the selected ATR threshold to filter insignificant gaps.
A bullish FVG is normally interpreted as:
An imbalance below price
A possible pullback support area
A potential location for bullish continuation or mitigation
Bearish FVG
A bearish FVG is created when the current high is below the low from two bars earlier.
It is generally interpreted as:
An imbalance above price
A possible resistance area
A potential bearish pullback or mitigation location
Show Last
Show Last determines how many recent bullish and bearish FVGs are displayed.
With a value of 5, the engine can show:
Five recent bullish zones
Five recent bearish zones
subject to mitigation and overlap removal.
Threshold
The threshold applies an ATR-based significance filter.
A value of 0 accepts all qualifying gaps.
Higher values require a stronger displacement relative to ATR.
Increasing the threshold generally produces fewer but more significant FVGs.
Mitigation modes
Close
Uses the candle body boundary as the mitigation trigger.
For a bullish FVG, the body must penetrate below the relevant lower boundary.
For a bearish FVG, the body must penetrate above the relevant upper boundary.
Wick
Uses the candle’s full high/low range.
This is the most sensitive mitigation method.
Avg
Uses the midpoint of the gap.
This treats a move through the FVG’s average price as mitigation.
FVG mode
In standard FVG mode:
The zone remains visible while active.
It is removed when the selected mitigation condition is satisfied.
Breakers mode
In Breakers mode:
The original FVG is tracked.
When mitigated, it becomes a breaker.
Its directional display changes to the opposite-side color.
It remains until the breaker’s opposite invalidation condition occurs.
Hide Overlap
When enabled, overlapping FVGs are filtered.
The newest FVG is compared against:
Older FVGs in the same direction
FVGs in the opposite direction
Overlapping stored zones can be removed to reduce visual clutter.
Midline
When enabled, the midpoint of each FVG is displayed.
The midpoint can be useful as:
A partial mitigation level
A mean-reversion reference
A refined entry or invalidation location
Extend FVG
When disabled, FVG drawings end at the current bar.
When enabled, active FVG zones extend to the right.
Display Raids
Raid tracking looks for liquidity interactions around an active FVG.
For a bullish FVG, it can track a move below the upper FVG boundary followed by a close back above it.
For a bearish FVG, it can track a move above the lower boundary followed by a close back below it.
Raid locations are displayed with a line and an x marker.
13. Information HUD
The information table summarizes the indicator’s current state.
Latest Shift
Possible values:
Bullish Shift
Bearish Shift
Waiting
This row stores the most recent genuine opposite-direction structure break.
It does not reset to neutral after a few bars. It remains bullish or bearish until an opposite Shift occurs.
Bullish Pivot MA
Possible values:
Waiting
Active
Ghost
Waiting
No qualifying bullish pivot has created the bullish MA state yet.
Active
The bullish MA currently satisfies the directional activation logic.
Ghost
The bullish MA exists but is not currently accepted as active.
Bearish Pivot MA
Uses the same status definitions for the red bearish MA.
Shift + MA
Possible values:
Bullish Match
Bearish Match
No Match
Bullish Match
Requires:
Latest Shift is bullish.
Bullish Pivot MA is active.
Bearish Match
Requires:
Latest Shift is bearish.
Bearish Pivot MA is active.
No Match
Structure and the active directional MA do not currently agree.
This is a warning that the setup lacks core confluence.
VWAP
Possible values:
Price Above
Price Below
Unavailable
This reports the current price’s relationship with the selected anchored VWAP.
RSI
Displays:
Current RSI value
Above 50 or Below 50
Example:
56.4 / Above 50
Long Health
The long score counts currently satisfied bullish conditions.
Short Health
The short score counts currently satisfied bearish conditions.
Composite Bias
Possible values:
Bullish
Bearish
Balanced
The result is determined by comparing Long Health with Short Health.
Long Health greater than Short Health → Bullish
Short Health greater than Long Health → Bearish
Equal values → Balanced
Composite Bias is a comparison of rule counts, not a forecast.
14. Health Score Calculation
With all default score filters enabled, each side has four factors.
Long Health factors
One point is awarded for each condition:
Latest Shift is Bullish.
Bullish Pivot MA is active.
Price is above VWAP.
RSI is at or above 50.
Short Health factors
One point is awarded for each condition:
Latest Shift is Bearish.
Bearish Pivot MA is active.
Price is below VWAP.
RSI is below 50.
Score examples
100% — 4/4
All directional conditions agree.
This is the strongest confluence state produced by the dashboard.
It does not mean the trade has a 100% probability of success.
75% — 3/4
The setup is directionally favorable, but one filter disagrees.
Examples:
Bullish Shift and bullish MA are aligned, but RSI is below 50.
Bearish structure is aligned, but price is still above VWAP.
50% — 2/4
The condition is mixed.
This often occurs during:
Transition
Consolidation
Pullback
Delayed confirmation
Conflict between structure and momentum
25% — 1/4
Only one filter supports the direction.
This is generally a weak environment for initiating a new position.
0% — 0/4
None of the directional filters support that side.
Disabling score filters
If VWAP is removed from the score, the denominator decreases.
If RSI is also removed, only two core factors remain:
Shift direction
Active directional MA
The displayed percentage automatically adjusts to the number of enabled factors.
Important limitation
Health is a confluence percentage, not a statistically measured win probability.
A 100% Long Health reading means four out of four programmed bullish conditions are true. It does not mean the market has a 100% chance of rising.
15. Suggested Long Entry Framework
Core long condition
The preferred long environment is:
Latest Shift = Bullish Shift
Bullish Pivot MA = Active
Shift + MA = Bullish Match
This is the minimum structural and directional agreement.
Additional confirmation
A higher-quality long condition may also include:
Price above VWAP
RSI above 50
Long Health at 75% or 100%
Bullish FVG below or around the entry
No large bearish FVG immediately above
A green R retest marker
Aggressive long entry
An aggressive trader may enter near the Bullish Shift breakout.
Risks:
The breakout may be extended.
Stop distance may be large.
Price may return to the broken structure or MA before continuing.
Conservative long entry
A more conservative sequence is:
Bullish Shift appears.
Bullish MA becomes active or remains directionally valid.
Price stays above or reclaims VWAP.
RSI remains above or reclaims 50.
Price pulls back into the green MA.
A green R appears.
The retest candle shows rejection or closes constructively.
This avoids chasing the initial breakout.
Continuation entry
A green triangle can support a continuation entry when:
The dashboard already has bullish alignment.
Price is not excessively extended above the MA.
The continuation break has room before the next bearish FVG or swing resistance.
A triangle by itself is not enough.
16. Suggested Short Entry Framework
Core short condition
The preferred short environment is:
Latest Shift = Bearish Shift
Bearish Pivot MA = Active
Shift + MA = Bearish Match
Additional confirmation
A higher-quality short may include:
Price below VWAP
RSI below 50
Short Health at 75% or 100%
Bearish FVG above or near the entry
No major bullish FVG immediately below
A red R retest marker
Conservative short entry
A conservative bearish sequence is:
Bearish Shift appears.
Bearish Pivot MA becomes active.
Price remains below or rejects VWAP.
RSI remains below 50.
Price rallies back into the red MA.
A red R appears.
The retest candle rejects the MA or closes bearishly.
17. How to Stay in a Position
Staying in a long
A long remains structurally healthier while:
Latest Shift remains bullish.
Bullish Pivot MA remains active.
Price remains above VWAP.
RSI remains above 50.
Long Health remains at 75% or 100%.
Bullish FVGs below price continue to act as support.
No Bearish Shift is created.
Early long weakness
Potential deterioration begins when:
RSI falls below 50.
Price falls below VWAP.
Bullish MA becomes ghost.
Long Health falls from 100% to 75% or 50%.
One lost factor is not necessarily an exit. It is a warning that confluence is decreasing.
Strong long invalidation
More serious invalidation can include:
Bearish Shift
Bearish Match
Bullish MA break
Price remaining below VWAP
RSI remaining below 50
Bullish FVG support being fully mitigated
Staying in a short
A short remains healthier while:
Latest Shift remains bearish.
Bearish MA remains active.
Price remains below VWAP.
RSI remains below 50.
Short Health remains high.
Bearish FVGs above price act as resistance.
No Bullish Shift appears.
Strong short invalidation
Potential invalidation includes:
Bullish Shift
Bullish Match
Bearish MA break
Sustained price above VWAP
RSI above 50
Bearish FVG resistance being invalidated
18. Stop-Loss and Profit Management
The indicator does not place stops or targets.
Possible stop references include:
For long trades
Below the retest candle low
Below the latest confirmed swing low
Below the bullish FVG
Below the bullish MA with an ATR buffer
Below the structure level that would invalidate the setup
For short trades
Above the retest candle high
Above the latest swing high
Above the bearish FVG
Above the bearish MA with an ATR buffer
Possible profit references
Previous swing high/low
Opposing FVG
Major VWAP deviation area
Fixed risk-to-reward target
Partial exit at 1R and trailing remainder
Opposite Shift
Health score deterioration
Stops should not be moved farther away simply to avoid accepting a loss.
19. Alerts
The script provides selectable conditions for:
Bullish Shift Created
Bearish Shift Created
Bullish Directional MA Retest
Bearish Directional MA Retest
Bullish Pivot MA Broken
Bearish Pivot MA Broken
Bullish Shift + Bullish MA alignment
Bearish Shift + Bearish MA alignment
Alert toggles
The shift and retest alerts have individual enable/disable inputs.
These settings control whether the corresponding alert condition can trigger.
Important TradingView behavior
Enabling an alert condition in the indicator settings does not automatically create a TradingView alert.
You must still:
Open TradingView’s alert dialog.
Select the indicator.
Select the desired alert condition.
Choose the frequency.
Create the alert.
For confirmed signals, using Once Per Bar Close is generally the most consistent choice.
20. Repainting and Confirmation Considerations
Pivot delay
Confirmed pivots require future right-side bars.
This means:
Pivot signals are delayed.
Once confirmed, the historical pivot itself is stable.
The indicator does not know a pivot at the exact moment the pivot bar first forms.
Bar-close confirmation
Confirm Signals On Bar Close is enabled by default.
This reduces intrabar signal changes for:
MA breaks
Structure breaks
Shift creation
Retests
Intrabar movement
The current MA, VWAP, RSI, and live candidate values may still visually move while the current candle is forming.
Using bar-close confirmation does not freeze the current bar’s underlying price calculations.
FVG evolution
FVGs can disappear when:
Mitigated
Invalidated
Removed by overlap filtering
Excluded by the Show Last setting
This is normal lifecycle behavior, not necessarily historical repainting.
21. Practical Decision Hierarchy
A disciplined way to use the indicator is:
Step 1 — Identify structure
Check Latest Shift.
Bullish Shift → prioritize long ideas.
Bearish Shift → prioritize short ideas.
Waiting → insufficient shift history.
Step 2 — Confirm the directional MA
Check Shift + MA.
Bullish Match → bullish structure and MA agree.
Bearish Match → bearish structure and MA agree.
No Match → wait or reduce conviction.
Step 3 — Check equilibrium
For longs:
Prefer price above VWAP.
Prefer RSI above 50.
For shorts:
Prefer price below VWAP.
Prefer RSI below 50.
Step 4 — Check location
Use:
Directional MA retest
FVG support/resistance
Recent swing levels
VWAP
A good directional idea entered at a poor location can still have poor risk-to-reward.
Step 5 — Check health
75–100%: favorable confluence
50%: mixed
0–25%: weak for that direction
Step 6 — Define invalidation before entry
Determine:
Stop level
Position size
Maximum acceptable loss
First target
Conditions for partial or full exit
Disclaimer
This indicator is provided for informational, educational, and analytical purposes only. It does not constitute financial advice, investment advice, trading advice, a solicitation, or a recommendation to buy or sell any financial instrument.
Market-structure shifts, moving averages, VWAP, RSI, Fair Value Gaps, retest markers, continuation symbols, health scores, and alerts are mathematical interpretations of historical and real-time market data. They do not guarantee future price movement or profitable outcomes.
The Health Score is a count of aligned indicator conditions. It is not a probability of success, an expected return, or a measure of actual trade risk.
Trading cryptocurrencies, forex, commodities, futures, CFDs, and other leveraged products involves substantial risk and may result in the loss of some or all invested capital. Historical performance does not guarantee future results. Signals may be delayed because of pivot confirmation, and real-time values may change before a candle closes.
Always perform independent analysis, use appropriate position sizing, define a stop-loss before entering a trade, account for fees and slippage, and never risk capital you cannot afford to lose. The user remains solely responsible for all trading and investment decisions. مؤشر

استراتيجية

Trend Conviction Divergence [ZynAlgo]1. Overview
Trend Conviction Divergence measures how much conviction is behind the current trend, not just its direction. It blends four proxies - Price Efficiency, Participation, Follow Through and Breakout Acceptance - into a single 0-100 Conviction Score shown in its own pane, and keeps trend direction separate so a fading trend stays visible.
2. What Builds the Conviction Score
Price Efficiency - a Kaufman-style efficiency ratio: net directional move divided by total bar-to-bar movement. Near 1 is a clean push, near 0 is chop.
Participation - recent volume average versus an older baseline; volume draining during a move flags weak participation (volume is a proxy and can be unreliable on some symbols).
Follow Through - size of the latest swing leg versus the average of prior legs; shrinking legs mean weakening follow-through.
Breakout Acceptance - the share of recent range breakouts that held instead of being rejected.
3. How to Read the Conviction Score
The score plots as columns: red below the Weak level (default 40), yellow between, green above the Strong level (default 70). Two dashed lines mark the 40 and 70 levels.
Divergence read: when direction stays BULLISH or BEARISH but the score slides toward or under the weak line, conviction is leaving the trend before price turns.
Confirming read: when price is trending and the score holds in the green zone above the Strong level, conviction is backing the move rather than fading.
Use it as a confirmation and filter layer over your own setups - lean in when conviction is high and rising, be cautious when it is weak or diverging. It is analytical context, not an entry trigger.
The dashboard shows PRICE (BULLISH or BEARISH), CONVICTION (the score as a percentage) and STATUS (WEAK TREND / MODERATE / STRONG TREND).
4. Inputs / Settings
Trend Reference Length - moving-average length that sets the BULLISH or BEARISH direction.
Efficiency Lookback - window used for the Price Efficiency ratio.
Participation - recent and baseline volume lengths plus the baseline offset.
Follow Through - swing pivot length and how many legs are remembered for the average.
Breakout Acceptance - breakout lookback, bars-later acceptance check, and how many recent breakouts are averaged.
Conviction Score Weights - the weight of each of the four components in the blend.
Display - Weak and Strong thresholds that drive the coloring and status.
5. Notes
Like any oscillator, the current bar value updates until the bar closes; closed bars do not change.
This is an analytical tool, not a signal generator, and does not guarantee any trading result. Always use your own analysis and risk management.
مؤشر

DMI Spread Dashboard ,5m 30m 1hDMI Spread Dashboard is a multi-timeframe directional-momentum monitor built around the Directional Movement Index (DMI) and Average Directional Index (ADX). It calculates the complete DMI structure independently on the 5-minute, 30-minute, and 1-hour timeframes, then organizes the results into one compact chart dashboard.
The indicator is designed to answer four separate questions:
1. Which side currently has directional control?
2. How large is the difference between positive and negative directional movement?
3. Is that directional difference expanding or contracting?
4. Is the underlying directional movement strong enough to be meaningful according to ADX?
Instead of displaying only a DMI crossover or a single ADX value, the dashboard separates direction, directional separation, trend strength, and momentum development. This helps users distinguish an established directional move from a weak crossover or a move that is losing participation.
HOW THE CALCULATIONS WORK
The script uses the traditional Directional Movement framework associated with J. Welles Wilder Jr.
For every selected timeframe, the script first compares the current high and low with those of the previous bar:
• Positive directional movement measures qualifying upward movement in the high.
• Negative directional movement measures qualifying downward movement in the low.
• When both sides move, only the qualifying dominant directional movement is retained according to the standard DMI comparison.
Positive and negative directional movement are smoothed using Wilder’s moving average method. Each smoothed value is then normalized by a Wilder-smoothed True Range and multiplied by 100 to produce +DI and -DI.
The script calculates ADX from the smoothed absolute difference between +DI and -DI relative to their combined value. ADX measures the strength of directional movement, not its direction. A high ADX can therefore occur during either bullish or bearish conditions.
The indicator then calculates its central measurement:
DMI Spread = +DI - -DI
A positive spread means +DI is greater than -DI and upward directional movement is dominant. A negative spread means -DI is greater than +DI and downward directional movement is dominant. A spread near zero indicates that neither side has established meaningful separation.
WHAT MAKES THE DASHBOARD DIFFERENT
The script does more than place standard DMI values from several timeframes into a table. It converts the relationship between +DI and -DI into a signed spread and then measures the bar-to-bar change in that spread.
This creates two separate forms of information:
• Direction identifies which side is currently dominant.
• Spread development identifies whether that dominance is expanding or contracting.
For a positive spread, an increase in the spread is classified as EXPANDING because bullish directional separation is increasing. A decrease is classified as CONTRACTING because bullish separation is weakening.
For a negative spread, a further decrease below zero is classified as EXPANDING because bearish directional separation is increasing. Movement back toward zero is classified as CONTRACTING because bearish separation is weakening.
This distinction is important because a market can remain technically bullish while its bullish DMI spread contracts. It can also remain technically bearish while bearish separation begins to weaken. The dashboard makes those changes visible without requiring users to compare multiple DMI plots manually.
The 5-minute, 30-minute, and 1-hour calculations are performed independently using each timeframe’s own price data. The 5-minute row can be used for short-term execution context, the 30-minute row for intermediate intraday structure, and the 1-hour row for broader directional context.
DASHBOARD COLUMNS
TIME
Identifies the independently calculated 5-minute, 30-minute, or 1-hour dataset.
+DI
Shows the magnitude of positive directional movement after Wilder smoothing and True Range normalization.
-DI
Shows the magnitude of negative directional movement after Wilder smoothing and True Range normalization.
SPREAD
Shows +DI minus -DI. Positive values indicate bullish directional dominance, while negative values indicate bearish directional dominance. The magnitude describes the separation between the two DMI components.
DIRECTION
Displays BULLISH when the spread is above zero, BEARISH when it is below zero, and NEUTRAL when the two values are equal.
ADX
Displays the Average Directional Index for the corresponding timeframe. ADX measures directional strength and does not determine whether the direction is bullish or bearish.
STRENGTH
Classifies ADX as STRONG or WEAK using the user-defined ADX Strength Threshold. The default threshold is 25. This threshold is a filter and should be adjusted when appropriate for the instrument and trading method.
STATUS
Displays one of four conditions:
• BULL CROSS: +DI has crossed above -DI.
• BEAR CROSS: +DI has crossed below -DI.
• EXPANDING: the prevailing directional spread is moving farther away from zero.
• CONTRACTING: the prevailing directional spread is moving toward zero or is no longer expanding.
When a new DMI cross is detected, the cross message temporarily takes priority over the expanding or contracting classification.
INTERPRETING MULTI-TIMEFRAME ALIGNMENT
Broad bullish alignment is present when all three spreads are positive. The alignment has stronger directional confirmation when the spreads are also expanding and ADX is above the selected threshold.
Broad bearish alignment is present when all three spreads are negative. The alignment has stronger directional confirmation when the negative spreads are expanding and ADX is above the selected threshold.
Mixed readings indicate timeframe disagreement. For example, a bullish 5-minute reading against bearish 30-minute and 1-hour readings may represent a short-term rebound within a broader bearish structure. It does not automatically confirm a larger bullish reversal.
A contracting spread should not automatically be interpreted as a reversal. It only indicates that the existing separation between +DI and -DI is narrowing. A crossover or additional price confirmation is required before directional control has formally changed under this model.
SUGGESTED WORKFLOW
1. Begin with the 1-hour row to identify the broader directional condition.
2. Use the 30-minute row to determine whether intermediate momentum agrees with or opposes the 1-hour condition.
3. Use the 5-minute row to monitor shorter-term changes, contractions, expansions, and DMI crosses.
4. Give greater weight to a setup when direction, spread development, and ADX strength agree across multiple timeframes.
5. Confirm dashboard readings with price structure, support and resistance, liquidity, volume, or another independent execution method.
The dashboard can be moved to the top-right, top-left, bottom-right, or bottom-left corner through the Dashboard Position input.
INPUTS
DI Length controls the smoothing period used to calculate +DI and -DI. The default is 14.
ADX Smoothing controls the smoothing period used for ADX. The default is 14.
ADX Strength Threshold determines when the dashboard labels ADX as STRONG. The default is 25.
Dashboard Position controls where the table appears on the chart.
ALERTS
The script provides separate bullish and bearish DMI cross alert conditions for the 5-minute, 30-minute, and 1-hour timeframes.
For confirmation-based use, alerts should normally be configured as “Once Per Bar Close.” Alerts notify users that a DMI relationship has changed; they are not automatic trade signals.
LIMITATIONS
This indicator does not predict future price direction and does not generate entries, exits, profit targets, or stop-loss levels.
DMI and ADX are derived from historical price movement and are lagging measurements. Crosses can occur after a move has already begun, and repeated crosses may occur during sideways or low-volatility markets.
ADX measures directional strength, not direction. A STRONG reading can accompany either bullish or bearish movement.
EXPANDING and CONTRACTING describe changes in the DMI spread. They do not guarantee price continuation or reversal.
Values from an open timeframe can change while that timeframe’s bar is still developing. A 30-minute or 1-hour reading is not final until its corresponding bar closes. Using “Once Per Bar Close” helps avoid acting on an unfinished alert condition, but users should still understand which timeframe is being evaluated.
When the indicator is used on a chart timeframe above five minutes, TradingView’s standard lower-timeframe request behavior may not reproduce every intermediate 5-minute event. For the most dependable observation of 5-minute changes and alerts, use the indicator on a 5-minute or lower chart.
The script should be used as a directional-context and confirmation tool rather than as a standalone trading system.
ORIGINALITY AND PURPOSE
DMI and ADX are established technical-analysis calculations. This script does not claim ownership of those underlying formulas.
The script’s contribution is its purpose-built interpretation and presentation layer: independently calculated 5-minute, 30-minute, and 1-hour DMI structures; a signed DMI spread; spread-expansion and contraction classification; timeframe-specific ADX strength; cross-state prioritization; configurable dashboard placement; and separate alert conditions.
These components are organized to help users evaluate directional control, separation, strength, and multi-timeframe agreement from one chart interface instead of manually comparing three separate DMI indicators.
Open-source users can inspect the calculations, adjust the parameters, and study how the multi-timeframe dashboard converts standard DMI components into a structured directional framework.
مؤشر

Liquidity Trend Heatmap [BigBeluga]🔵 OVERVIEW
The Liquidity Trend Heatmap is a professional-grade volume analysis tool that maps market liquidity directly onto your price chart. By combining a trend-following baseline with a high-resolution volume-at-price heatmap, it helps traders instantly visualize where the market's "heavy" trading zones are located relative to the current trend.
🔵 FEATURES
The indicator utilizes a sophisticated volume-distribution engine to provide actionable market intelligence:
1 — Dynamic Liquidity Heatmap
Multi-Node Distribution: The indicator divides the recent price range into a 26-level grid, calculating the cumulative volume traded at each level over your defined Lookback Period .
Visual Heatmap Nodes: Liquidity is displayed as shapes (Squares, Circles, etc.) that shift color and intensity based on the volume processed at that price.
Normalized Intensity: Nodes appear more vivid based on their volume relative to the Point of Control (POC), ensuring you only focus on the most significant liquidity zones.
2 — Institutional Point of Control (POC) Tracker
Automated POC Detection: The system identifies the specific price level with the highest volume accumulation, marking it as the market’s primary liquidity magnet.
Real-Time Metrics: A dedicated POC label on the far right of your chart provides the exact price and volume traded at the POC, keeping your focus on the most critical level.
3 — Trend-Following Dashboard
Trend Baseline: Includes a customizable moving average ( Trend Length ) that acts as a structural midline. This midline automatically updates color to indicate whether the current environment is Bullish or Bearish.
Information Dashboard: A clean, configurable table at the top-right provides instant updates on the current trend status, POC price, and total POC volume without cluttering your workspace.
🔵 HOW TO USE
This tool is designed to identify "smart money" zones and potential mean-reversion levels:
Identify Liquidity Magnets: Use the POC level as a primary target or support/resistance level. High-volume nodes often act as magnets for price action.
Confirm Trend: Use the Trend Line and dashboard status to ensure your liquidity-based trades are aligned with the prevailing market trend.
Filter Weak Levels: Adjust the Heatmap Threshold % to hide low-volume levels. This cleans up your chart and leaves only the most relevant, high-conviction liquidity zones visible.
🔵 NOTES
Why this implementation is unique:
It combines complex volume-profile math with a lightweight, user-friendly visual interface, making it suitable for both scalpers and swing traders.
The "future-extending" heatmap nodes visualize expected liquidity distribution into the immediate future, helping you anticipate price behavior before it happens.
The system is highly customizable, allowing you to toggle the trend line, adjust shape types, and change heatmap thresholds to suit your specific trading style.
مؤشر

Wyckoff Architectural Range - erdensedatThe "Wyckoff Architectural Probability Range" is an advanced, non-overlapping consolidation detector and liquidity sweep identification system. Designed to keep charts clean, it dynamically adapts to market volatility and focuses solely on the current active trading range.
Key Features:
- Dynamic ATR-Based Range Width: The indicator automatically adjusts its maximum allowed range width based on the asset's current volatility, ensuring it works seamlessly across both major assets (BTC, ETH) and highly volatile altcoins.
- Non-Overlapping Architecture: Historical ranges are completely removed upon a confirmed breakout, leaving only the active, actionable consolidation zone on your chart.
- Premium & Discount Zones: The range is mathematically divided into Premium (Top 25%), Equilibrium (Middle 50%), and Discount (Bottom 25%) zones. Internal EQ levels (0.4 and 0.6) are also projected.
- Advanced Retest Signals:
> Buy Signal: Prints when price crosses below the Discount EQ and subsequently retests and closes above it.
> Sell Signal: Prints when price crosses above the Premium EQ and subsequently retests and closes below it.
- Smart Liquidity Detection (Spring & UTAD): Automatically identifies and labels wick-based liquidity sweeps outside the range.
- Mean Reversion Probability: A dynamic stats panel calculates the mean reversion probability based on the current deviation from the main Equilibrium level.
- Built-in Alert System: Provides any() alert conditions for Buy/Sell signals, Spring/UTAD sweeps, and Range Breakouts.
- Optional VWAP: Toggle a standard VWAP line on or off directly from the settings for additional confluence.
How to Use:
Use the statistical panel and structural boxes to identify institutional accumulation (Discount Zone) and distribution (Premium Zone). Wait for confirmed retest signals (Triangles) or liquidity sweeps (Spring/UTAD) for high-probability mean-reversion entries.
Disclaimer:
The information and scripts provided in this indicator are for educational and informational purposes only and do not constitute financial advice. Trading cryptocurrencies, forex, and other financial markets involves a high degree of risk and may not be suitable for all investors. Past performance is not indicative of future results. Always conduct your own research and consult with a certified financial advisor before making any trading decisions.
مؤشر

Auto-ATR Volatility Spike & Trend Tracker [BigBeluga]Auto-ATR Volatility Spike & Trend Tracker is an institutional-grade algorithmic trend-following terminal engineered for TradingView. It is specifically built to isolate high-momentum breakout anomalies (spikes) from ordinary noise and anchor a dynamic, risk-managed trailing stop-loss directly to the underlying structural expansion.
By merging volumetric price momentum with an adaptive Average True Range (ATR) detection framework, this indicator completely redefines how breakout traders enter and manage trends. Instead of reacting blindly to standard moving average crosses, the system utilizes an execution state machine that locks onto systemic market expansion, tracks trend health via dynamic midpoint lines, and protects capital with a trailing protection line.
🔵 CHANNELS & ARCHITECTURAL CORE ENGINE FEATURES
1. Dual-Mode Spike Detection System
Auto ATR Volatility Engine: Automatically adapts to varying market conditions. By cross-referencing incoming candle structures against an ATR Length multiplier baseline, the indicator filters out flat consolidation periods and flags abnormal, high-liquidity volume expansions that signify true institutional participant footprints.
Fixed Percentage Breakout Mode: For traders operating in highly structured assets with predictable daily limits, this module locks onto absolute price change thresholds ( Fixed Spike Threshold % ), isolating momentum moves that pierce predefined parameters.
Wick-to-Body Range Toggle: Allows you to switch calculations to run from either the raw candle body (Open to Close) or the full extreme range ( Calculate From Wicks (High/Low) ). This isolates clean structural closes while adjusting to high-volatility liquidity sweeps.
2. Predictive Mid-Level Benchmarks & Spacing Visuals
Dynamic Mid Level Dash Lines: When a valid trend spike is verified, the engine immediately draws a horizontal midpoint line extending from the center of the candle ( Display Mid Level Dash Line ). This centerline serves as an immediate structural macro floor or ceiling; as long as price retains this boundary, the primary breakout impulse remains historically intact.
Measurement Arrow Guides & Measurement Labels: Automatically draws measurement arrow guides along with real-time text percentage indicators directly over the breakout candle ( Display Size % Labels & Arrow Lines ). This gives you instant clarity on the volatility profile without needing to use manual drawing tools.
3. Algorithmic State Machine & Trailing Protection
Volatility-Adjusted Trailing Stops: Once a breakout trend is established, the indicator deploys a step-calculated trailing line based on your Trailing ATR Multiplier . This line is engineered to trail tightly beneath bullish expansions or above bearish flushes, keeping you safely in the macro trend while mitigating downside variance.
Trend Interlock Protection: The underlying state machine features built-in trigger restrictions that lock execution while a trend is dominant. This prevents counter-trend false entries or premature reversals, keeping your focus strictly on the dominant structural path.
Theme Overwrite Candlesticks: Completely recolors the active layout chart workspace bars using vivid, customized hex-theme presets ( Bullish/Bearish Theme Colors ) the exact moment an abnormal spike is validated.
4. Persistent Macro Statistics Dashboard Matrix
Top-Right Analytics HUD Table: Instantly maps out a high-performance database grid showing critical data points from the most recent historical market expansions.
Real-Time Metrics Monitoring: Explicitly stores and displays the precise directional Spike Type , Size (%) , and exact entry execution Price for both bullish and bearish cycles, providing a reliable quantitative snapshot of the asset's structural strength.
🔵 SYSTEMATIC EXECUTION STRATEGIES & RISK INTERPRETATION
Midpoint Re-test Accumulation Plays: When a powerful up-spike forces a market breakout, do not chase the initial overextended move. Instead, wait for a constructive pullback toward the extended dynamic dashed midline. If price builds a base and prints a clean rejection candle at this level, it signals a premium, low-risk continuation entry aligned with institutional order flow.
Trailing ATR Invalidation Exits: The trailing stop-loss line acts as your absolute trend line invalidation boundary. In a powerful bullish expansion, the indicator will continuously trail and lock in accrued profit beneath the recent low points. A clean daily close crossing beneath this line confirms an official trend termination, signaling an immediate exit to protect your capital.
Breakout Sizing Divergences: Cross-reference the live metrics dashboard data to spot exhausting trends. If an asset is pressing higher but newly generated bullish spikes show smaller percentage sizes compared to the historical records on your HUD table, it exposes fading momentum—frequently warning of an impending reversal or structural distribution phase.
🔵 INTERFACE CONFIGURATION AND PARAMETERS
Detection Mode Controls: Choose between Auto ATR or Fixed % settings and specify lookback periods to customize the indicator to match any asset class, volatility cycle, or execution chart timeframe.
Visibility Filters Overrides: Independently toggle midlines, trailing stops, background cloud color fills, or measurement labels to maintain a clean, distraction-free charting interface.
Theme Personalization Modifiers: Fully adjust color properties for upward spikes, downward spikes, buy/sell arrows, and trailing lines to blend seamlessly into your dark or light workspace layout themes.
Transform your charting workspace from speculative guessing into an automated, volatility-tracked breakout environment with the Auto-ATR Volatility Spike & Trend Tracker terminal. مؤشر

VWAP Deviation Trend [BackQuant]VWAP Deviation Trend
Overview
VWAP Deviation Trend is a volume-weighted trend-following overlay that transforms VWAP and its surrounding price distribution into a directional trailing structure.
Rather than using VWAP only as a fair-value line, the indicator calculates:
A configurable anchored or rolling VWAP.
The volume-weighted standard deviation of price around that VWAP.
Adaptive upper and lower deviation bands.
One-sided trailing boundaries used to confirm bullish and bearish regimes.
The indicator is designed to identify when price has moved far enough away from accepted volume-weighted value to establish a meaningful directional shift.
Unlike a simple VWAP crossover, price can move through VWAP without immediately changing the active trend. A new regime requires price to break the opposite trailing deviation boundary, optionally with confirmation from the direction of VWAP itself.
The updated visual engine also measures trend strength and uses it to control:
Gradient intensity.
Trail glow width.
Post-flip bloom effects.
The visual separation between price and the active trail.
Core concept
VWAP represents the average price paid over a selected period, weighted by trading volume.
The basic formula is:
VWAP = Sum of Price × Volume / Sum of Volume
Prices associated with greater volume contribute more heavily to the final value. This makes VWAP a useful approximation of:
Volume-weighted fair value.
The center of traded activity.
The average position of market participants.
An institutional execution benchmark.
However, VWAP alone does not explain how widely price has been distributed around that value.
VWAP Deviation Trend treats VWAP as the center of a volume-weighted price distribution and measures the dispersion around it. That dispersion is then used to create trailing trend boundaries.
VWAP calculation modes
The indicator supports five VWAP windows:
4 Hours
Daily
Weekly
Rolling Lookback Bars
Rolling Lookback Days
4 Hours
Resets VWAP at fixed four-hour intervals.
This can be useful for:
Cryptocurrency markets.
Intraday futures.
Continuously traded markets.
Shorter fair-value regimes.
Daily
Resets at the beginning of each calendar day.
This is the traditional intraday VWAP structure and is useful for:
Session bias.
Intraday mean reversion.
Day-trading trend confirmation.
Weekly
Accumulates volume and price across the current week.
This creates a slower structural anchor suited to:
Swing trading.
Weekly positioning.
Broader accepted-value analysis.
Rolling Lookback Bars
Calculates VWAP over a fixed number of candles.
The window moves forward continuously and does not reset at a calendar boundary.
This is useful for:
Systematic trend models.
Consistent multi-timeframe analysis.
Markets where daily sessions are less important.
Rolling Lookback Days
Includes bars that fall within a selected number of calendar days.
This keeps the analytical window tied to elapsed time instead of a fixed candle count.
Anchored versus rolling VWAP
Anchored modes begin at a fixed boundary and accumulate until the next reset.
Rolling modes continually remove old observations as new observations arrive.
Anchored VWAP is useful when a particular session or week has structural meaning. Rolling VWAP is useful when the trader wants a stable and continuously adapting lookback.
Volume-weighted deviation
The indicator calculates more than the VWAP mean.
It also measures volume-weighted price variance using:
Weighted Mean Square = Sum of Price² × Volume / Sum of Volume
Weighted Variance = Weighted Mean Square - VWAP²
Weighted Deviation = Square Root of Weighted Variance
This measures how widely prices associated with meaningful trading volume are distributed around VWAP.
A small deviation suggests:
Trading is concentrated near fair value.
The market is relatively balanced.
Price acceptance is narrow.
A large deviation suggests:
Trading is spread across a wider range.
Price discovery is more active.
The market is less tightly centered around VWAP.
Because the calculation is volume weighted, high-volume prices influence the bands more than low-volume excursions.
Fallback when volume is unavailable
If usable volume is not available, the indicator falls back to an unweighted arithmetic mean and variance.
This allows it to function on synthetic or limited-volume symbols, although the result should then be interpreted as a rolling or anchored mean rather than a true VWAP.
Deviation bands
The raw width is calculated as:
Deviation Width = Weighted Deviation × Deviation Multiplier
The upper and lower raw bands are:
Upper Band = VWAP + Band Width
Lower Band = VWAP - Band Width
Higher deviation multipliers create wider bands and fewer trend changes.
Lower multipliers create tighter bands and faster, more frequent flips.
ATR minimum width
During low-dispersion periods, volume-weighted deviation can become extremely narrow.
This can cause small and insignificant movements to trigger repeated reversals.
The optional ATR floor calculates:
ATR Floor = ATR × ATR Minimum Multiplier
The final width becomes:
Band Width = Maximum of Deviation Width and ATR Floor
This preserves volume-weighted deviation as the primary band engine while preventing the channel from collapsing below a practical volatility threshold.
Trailing-band construction
The raw deviation bands move freely with VWAP and dispersion.
The indicator converts them into one-sided trailing levels.
Lower trail
While the selected trigger remains above the lower trail:
The trail can rise.
It cannot move downward.
This creates a ratcheting support structure.
Upper trail
While the trigger remains below the upper trail:
The trail can fall.
It cannot move upward.
This creates a ratcheting resistance structure.
The active trend trail is:
The lower trail during bullish regimes.
The upper trail during bearish regimes.
Why trailing logic matters
A raw VWAP band can move toward price and create unstable signals.
The one-sided trail preserves trend structure and creates hysteresis.
Hysteresis means the threshold required to enter a bullish regime is different from the threshold required to enter a bearish regime.
This allows price to rotate around VWAP without constantly changing the active trend.
Trend initialization
When the first valid VWAP is available:
The trend initializes bullish if the trigger is at or above VWAP.
The trend initializes bearish if the trigger is below VWAP.
After initialization, a full break of the opposite trail is required to change regimes.
Bullish trend flip
A bullish flip requires:
The selected trigger to move above the upper trailing band.
The current trend not already to be bullish.
VWAP slope confirmation to pass if enabled.
Once confirmed:
The trend becomes bullish.
The active trail moves beneath the market.
A bullish signal marker is displayed.
Bearish trend flip
A bearish flip requires:
The selected trigger to move below the lower trailing band.
The current trend not already to be bearish.
VWAP slope confirmation to pass if enabled.
Once confirmed:
The trend becomes bearish.
The active trail moves above the market.
A bearish signal marker is displayed.
Flip trigger
The trend can be triggered using:
Close
The selected VWAP price source
Close is the more conventional option.
Using the price source, such as HLC3, can produce a slightly smoother trigger because it reflects more of the bar than the close alone.
VWAP slope confirmation
Optional slope confirmation requires VWAP itself to move in the direction of the proposed new trend.
For a bullish flip:
Current VWAP must be above VWAP from the selected lookback.
For a bearish flip:
Current VWAP must be below its prior value.
This can help reject:
Temporary band breaks.
Low-volume price spikes.
Liquidity sweeps against flat fair value.
The tradeoff is additional confirmation delay.
Breaking the trail on flips
The active trail changes from one side of the market to the other during a regime transition.
The Break Trail On Flips option inserts a visual gap on the flip bar so the previous and new trails are not connected by a misleading line segment.
This affects presentation only.
Visual trend-strength engine
The updated script includes a visual-strength model that controls the intensity of the gradient and glow.
It combines two measurements:
Distance between price and the active trail.
Slope of VWAP relative to the current band width.
Distance strength
The script measures:
Absolute Distance = |Close - Trend Trail|
This is normalized by the current band width.
A larger distance indicates stronger separation between price and the structural trail.
Slope strength
VWAP movement across the slope lookback is also normalized by the band width.
This measures whether volume-weighted fair value itself is moving meaningfully relative to the size of the current deviation structure.
Combined trend strength
The final visual strength is weighted:
70% price-to-trail distance.
30% VWAP slope strength.
This produces a value between zero and one.
It does not change trend logic or signals. It controls the visual intensity of the indicator.
Layered gradient fill
Instead of using one flat gradient, the updated indicator divides the space between the trail and price into six visual layers.
The levels are placed progressively between:
The active trend trail.
The current closing price.
The gradient is:
Most concentrated near the structural trail.
Progressively softer toward price.
The opacity adapts to trend strength.
When price is strongly separated from the trail and VWAP is moving with the regime:
The gradient becomes more vivid.
When the trend is weak:
The fill becomes softer and more transparent.
This makes the visual ribbon encode more than direction. It also reflects the current strength of the price-to-structure relationship.
Flip bloom
After a confirmed trend flip, the indicator creates a temporary bloom around the new trail.
The bloom is strongest immediately after the transition and fades over the following bars.
Its intensity follows this general sequence:
First bar after flip: strongest bloom.
Second bar: reduced bloom.
Third bar: light residual bloom.
Afterward: bloom disappears.
This visually emphasizes fresh regime changes without permanently increasing chart brightness.
The bloom is cosmetic and does not affect calculation.
Adaptive trail glow
The glow surrounding the trail also changes with trend strength.
The base width is ATR-scaled, then increases slightly as the visual trend-strength score rises.
This creates:
A broader glow during stronger regimes.
A narrower glow when trend structure is weaker.
The glow contains:
An inner, more visible layer.
A wider, softer outer layer.
Visual interpretation
The updated presentation provides several pieces of information simultaneously:
Color shows the active trend direction.
The trail shows the structural regime boundary.
Gradient intensity reflects trend strength.
Glow width reinforces structural conviction.
The bloom highlights fresh regime transitions.
How to use the indicator
Trend regime filter
Use the active color and trail position as directional context:
Favor longs during bullish regimes.
Favor shorts during bearish regimes.
Pullback structure
In a bullish regime:
VWAP represents volume-weighted fair value.
The lower trail represents deeper structural support.
In a bearish regime:
VWAP represents the mean-reversion anchor.
The upper trail represents deeper structural resistance.
Trend-strength context
A vivid gradient and broader glow suggest:
Price is well separated from the trail.
VWAP is moving in the trend direction.
The regime has stronger structural momentum.
A weak or faded gradient suggests:
Price is closer to the trail.
VWAP slope is weaker.
The trend may be consolidating or losing strength.
Fresh transitions
The bloom helps identify newly established regimes.
A fresh flip with:
Strong bloom.
Growing price separation.
VWAP slope alignment.
generally represents stronger early trend structure than a flip that immediately loses visual intensity.
Dynamic risk management
The active trail may be used as:
A trailing stop reference.
A regime invalidation boundary.
A position-management guide.
Because the trail responds to both volume-weighted dispersion and volatility, it adjusts as market conditions change.
How this differs from a standard VWAP
A standard VWAP:
Plots only volume-weighted mean price.
Usually resets once per session.
Does not maintain trend state.
VWAP Deviation Trend:
Supports anchored and rolling windows.
Calculates volume-weighted dispersion.
Creates adaptive raw bands.
Converts them into directional trailing boundaries.
Maintains persistent bullish and bearish regimes.
Adds a strength-reactive visual system.
How this differs from Supertrend
A traditional Supertrend normally uses a central price such as HL2 and ATR-based bands.
VWAP Deviation Trend uses:
Volume-weighted fair value as the center.
Volume-weighted standard deviation as the primary width.
ATR only as an optional minimum floor.
This means the trail responds not only to range volatility, but also to where trading volume has been concentrated.
How this differs from Bollinger Bands
Bollinger Bands normally use:
A moving average.
Unweighted standard deviation.
Symmetrical non-trailing bands.
This indicator uses:
A volume-weighted mean.
Volume-weighted variance.
One-sided trailing bands.
Persistent trend-state logic.
It is therefore a trend-regime model rather than a standard mean-reversion envelope.
Input guide
VWAP Mode
Selects the anchored or rolling calculation window.
Deviation Multiplier
Controls the width of the statistical bands.
Higher values produce wider, slower regimes. Lower values produce tighter and faster regimes.
ATR Minimum Width
Prevents excessive narrowing during compressed conditions.
VWAP Slope Confirmation
Requires volume-weighted fair value to move with the proposed trend.
Flip Trigger
Selects whether close or the chosen price source must cross the trail.
Visual settings
Allow the trader to display:
The trend trail.
VWAP.
Raw deviation bands.
Layered gradient.
Adaptive glow.
Signals.
Trend candles.
Strengths
Combines fair value, dispersion, and trend structure.
Uses volume-weighted mean and variance.
Supports multiple anchored and rolling VWAP windows.
Uses ATR protection against narrow-band whipsaws.
Creates persistent regimes with hysteresis.
Provides optional VWAP slope confirmation.
Includes a trend-strength-reactive visual system.
Clearly emphasizes fresh trend transitions.
Limitations
Volume quality varies between instruments.
Anchored VWAP modes may be unstable immediately after a reset.
Long windows can react slowly to sudden regime changes.
Tight settings can increase whipsaws.
Wide settings can delay reversals.
Slope confirmation can add additional lag.
Visual strength is contextual and is not a separate trading signal.
Alerts
The indicator includes alerts for:
Confirmed bullish trend flips.
Confirmed bearish trend flips.
These represent complete VWAP deviation regime changes, not ordinary crosses of VWAP.
Summary
VWAP Deviation Trend converts volume-weighted fair value and price dispersion into a directional trend trail.
It calculates VWAP over a configurable anchored or rolling window, measures volume-weighted standard deviation around that VWAP, and builds upper and lower deviation bands. An optional ATR floor prevents the structure from becoming excessively narrow during quiet conditions.
The raw bands are transformed into one-sided trails. The lower trail ratchets upward during bullish regimes, while the upper trail ratchets downward during bearish regimes. Trend changes occur only when price breaks the opposite trail, optionally with confirmation from the slope of VWAP.
The updated visual engine measures price separation and VWAP slope to dynamically control the layered gradient, trail glow, and temporary post-flip bloom. This creates a clearer representation of direction, structural strength, and fresh regime transitions without changing the underlying signal logic. مؤشر

Price Reaction ZonesPrice Reaction Zones (PRZ) is an advanced structural analytics tool designed for traders who focus on market microstructure, dynamic support/resistance levels, and liquidity sweeps. By blending traditional Change of Character (CHoCH) concepts with a custom-engineered "AXIS Motor", this indicator offers dynamic kinetic sensitivity and highly strategic Fibonacci-based target zones.
This script maps out historical structure ranges, isolates liquidity traps (sweeps), and projects tactical ghost vectors to evaluate micro-trend strength.
Key Features:
1. Smart Market Structure & Dynamic Fib Boxes
When a valid Break of Structure (BOS) or Change of Character (CHoCH) occurs, the indicator identifies the absolute extremes (Highest High and Lowest Low wicks) of the most recently broken structure.
Bullish CHoCH (Upward Break): Creates a dynamic Fibonacci box between 0.318 and 0.500 of the previous downward structure.
Bearish CHoCH (Downward Break): Creates a dynamic Fibonacci box between 0.618 and 0.790 of the previous upward structure.
These boxes act as immediate high-probability reaction zones for the very next wave. An Equilibrium (EQ - 0.5) limit line is also drawn to clearly divide the market bias.
2. External Ranges & Liquidity Sweep Detection
Instead of cluttering the chart with every single swing high or low, PRZ calculates an overarching "External Range" based on a lookback of the last 6 structural phases.
It automatically frames a beautiful Price Range Box mapping the exact tick difference and percentage span of the overarching macro structure.
Rejected Wick Logic (Sweeps): If price pierces the external High or Low boundaries but closes inside the range, a permanent "UP" or "DOWN" text is pinned to that wick. This signals a textbook liquidity sweep (a trap for breakout traders) and potential reversal.
Alerts are fully integrated for UP and DOWN sweep detections.
3. The AXIS Engine & Auto-Kinetic Sensitivity
Unlike static trendlines, the integrated AXIS Engine measures the "Velocity" of the market.
Auto-Kinetic Multiplier: By analyzing the real-time sum of bullish vs. bearish momentum (close to open differences) over a rolling window, the script dynamically adjusts the slope sensitivity of the resistance and support lines entirely independent of one another.
Tactical Ghost Vectors: Projects subtle, short-term momentum paths (Minor Lookbacks) to help you visualize the micro-trend inside the macro-structure, offering early warnings of momentum shifts before structural breaks happen.
4. Highly Customizable Interface
You have complete control over visualization. Tweak kinetic multipliers manually, adjust lookback lengths, alter Fibonacci box colors, and toggle lines to keep your chart as clean or as detailed as you prefer. A minimalist "erdensedat" watermark is embedded dynamically on the chart.
How to Use:
Use the Fibonacci boxes inside the latest active CHoCH range to enter pullbacks.
Watch the boundaries of the macro Price Range Box. Enter mean-reversion trades when "UP" or "DOWN" liquidity sweep labels appear.
Utilize the AXIS lines to trail your stops dynamically based on the current market velocity.
Disclaimer:
This indicator is designed for educational and analytical purposes only. It does not constitute financial advice. Trading in financial markets involves significant risk. The concepts of market structure, CHoCH, and liquidity sweeps are interpretive; always combine this tool with your own risk management strategy and other confluences. Past performance of any setup does not guarantee future results. مؤشر

S&R + Trends | Polytrends Method (gracefultrading)SUPPORT & RESISTANCE + TRENDS | POLYTRENDS METHOD
Maps market structure automatically: every trend is detected, classified, and turned into support/resistance levels that know their own state. Built around the polytrends method of reading structure through trends and progression. This is my own independent, open-source interpretation of the framework, coded from scratch based on publicly available material. For educational purposes only — not financial advice.
TRENDS AND CONTAINMENT
Every pivot is compared against the previous pivot in the same direction. A swing that pushes past the prior trend is a valid continuation and draws in the trend colour. A swing that fails to exceed it — a lower high on the way up and or a lower low on the way down — is a containment trend, drawn in its own colour and style.
The current in-progress leg draws dashed, so you always see the swing being built. Pivot detection reacts to wick pullbacks, close-breaks of the prior candle, structural breaks, and same-bar reversals — not fixed-length lookbacks.
LEVELS WITH STATE
Each trend leaves a level at the candle body, committed only after the next opposite pivot confirms it. Every label shows the level's current state at a glance:
G — gained
SG — support gained
L — lost
RL — resistance lost
State updates bar by bar as price closes through or reclaims a level. An optional break/test offset (in ticks or percent) means a level only counts as gained, lost, or tested once price clears it by your buffer.
PAIRED STRUCTURE
Levels come from trends and draws in colour-matched pairs from a 12-colour set, each pair originating from the same piece of structure.
Tested levels draw in a different line style from untested ones and can be hidden entirely; when hidden, you choose whether each pair still shows its tested partner so pairs stay intact. At high relevance settings, clustered tested levels within a tick distance thin down to the strongest one.
POLYBOUNDS
Experimental.
A corner readout that reduces the chart to the two prices that matter:
▲ hold above — the key gained level below price. Bulls are in control while price holds above it.
▼ hold below — the key lost level above price. Bears are in control while price holds below it.
Each line is coloured to match its pair on the chart, and the box only quotes levels that are actually drawn. A Trend Day row (1H and below) reads whether the session is shaping up bullish, bearish, or rangebound based on where price sits against the bounds.
SETTINGS
Levels above/below counts. A relevance dial controlling how deep into history levels are pulled from (50 bars to full history). Independent colours, styles, and widths for trends, containment trends, and levels. Configurable label background and twelve pair colours. A right-offset so all level rays align cleanly ahead of price.
HOW TO READ IT
The market is always in progression — always attempting either a new high or a new low. Every swing this indicator draws is one attempt in that sequence, and every level is the footprint it leaves behind.
Progression rule: in an uptrend, price should not lose the previous swing low if it intends to go higher — losing it shifts probability toward the opposite objective. Mirror logic in a downtrend. Watch the level states: a support flipping from SG to L is that shift happening in real time.
Containment is the early warning. A containment trend (lower high in an uptrend, higher low in a downtrend) means the progression is failing before any level has broken. Trend weakness is the warning; level failure is the confirmation.
Levels mark accepted value. They're built from candle bodies, not wicks — the goal is to see where the market accepted or rejected value, which is why the break/test offset exists to filter wick noise.
Untested levels react first. Fresh levels are the highest-priority reaction zones; tested levels remain valid structure and become targets when price is nearer to them. The pair colours show you which structure each level came from.
Timeframes nest. Higher-timeframe levels are destinations; lower-timeframe levels are the navigation between them. Significant trends typically start from higher-timeframe pivots — the biggest swings on your chart usually trace back to them. RTH-formed levels tend to carry the most weight.
Works on any symbol and timeframe; the Trend Day readout is built for intraday. This is a tool for reading structure, not a signal service — nothing replaces risk management. مؤشر

AI K-Means Clustering [TradingFinder] Machine Learning Zones🔵 Introduction
K-Means clustering is an unsupervised machine learning algorithm that groups similar data points around repeatedly updated cluster centers. Each observation is assigned to its nearest center, the centers are recalculated, and the process continues until the clusters converge. In financial market analysis, this structure can separate recurring patterns in price movement, trend direction, volume pressure, and volatility without depending entirely on fixed thresholds. As a result, the same candle may be interpreted differently in a quiet market, a directional trend, or a volatility shock, because its meaning is evaluated in relation to the surrounding market data.
This TradingView indicator applies K-Means machine learning through several connected analysis modules. The Market State engine studies trend bias, price slope, and relative volume pressure to classify the current market regime as an active bullish trend, active bearish trend, soft bullish trend, soft bearish trend, neutral range, or low-volume range. It also compares the current cluster with the dominant cluster across recent candles, helping the trend classification remain more stable when a single large candle, temporary spike, or short-lived price reversal appears.
The Price Zones engine clusters pivot points, historical highs, and historical lows to create dynamic K-Means support and resistance zones. Traders can display all price cluster centers, the nearest K-Means zone, or separate support and resistance lines. Raw, Smooth, and Locked Steps modes control how quickly the zones respond to new price data, while the nearest line changes color according to the detected bullish, bearish, or ranging market state. A Stochastic moving average heatmap is also plotted between the outer zones, adding a visual layer for momentum, overbought and oversold conditions, trend strength, and changing market pressure.
The indicator also combines volatility analysis, price action recognition, cluster quality scoring, and alert conditions. The volatility engine uses normalized ATR, candle range, and return volatility to identify low-volatility compression, normal volatility, high volatility, and volatility shock. The Price Action module evaluates the latest closed candle for bullish and bearish zone breakouts, rejection patterns, momentum candles, and indecision near a clustered price level. A dedicated Quality and Reliability section then measures zone strength, cluster fit, zone width, price distance, and RMSE, helping traders understand whether the current machine learning calculations are strong enough for practical analysis or should be treated only as additional market context.
🔵 How to Use
The easiest way to read this indicator is not to search for one isolated green or red message. Its main value comes from combining several layers of market information: K-Means market state classification, adaptive price zones, price action, volatility conditions, and calculation quality. Each module answers a different question, and the strongest setups usually appear when several modules point in the same direction.
Start with the Market State row in the analysis table. This module applies multidimensional K-Means clustering to trend bias, trend slope, and relative volume pressure. The current cluster shows where the latest market data has been assigned, while the dominant cluster represents the most frequent cluster across the selected state window. The Strength value shows how dominant that cluster is within the recent sample.
The Market State analysis can return the following conditions :
Active Bullish Trend : Positive trend structure supported by stronger relative volume.
Soft Bullish Trend : Positive directional structure, but with weaker participation or less convincing momentum.
Active Bearish Trend : Negative trend structure supported by stronger relative volume.
Soft Bearish Trend : Bearish directional structure that still requires confirmation.
Neutral Range : Trend bias and slope are not strong enough to define a clear direction.
Low-Volume Range : Sideways structure accompanied by relatively weak volume participation.
The distinction between the current and dominant cluster is important. A single large candle can move the current data point into another cluster, but the dominant state may remain unchanged if the broader recent structure still belongs to the previous market regime. This can help prevent every temporary spike, pullback, or abnormal candle from being interpreted as a complete trend reversal.
The next section is Price Zones. Here, K-Means clustering is applied to historical pivot levels, sampled highs, and sampled lows. Instead of drawing a level from only one swing point, the algorithm groups similar historical prices and calculates a center for each price cluster. These cluster centers become adaptive K-Means price zones that may act as support, resistance, breakout references, or reaction areas.
The table displays :
Near : The cluster currently closest to price.
Strength : The percentage of sampled price levels assigned to the nearest cluster.
Nearest : The closest stabilized K-Means zone.
Support : The nearest valid cluster center below the market.
Resistance : The nearest valid cluster center above the market.
A higher Zone Strength means a larger share of the sampled levels belongs to that cluster. However, this should not be interpreted as a guaranteed support or resistance level. It simply shows that more historical observations were grouped around the same price area.
On the chart, users can choose between three visual approaches. Show All K-Means Zone Centers plots the complete set of clustered price levels. Show Nearest Zone displays only the closest stabilized level, while Show K-Means Support/Resistance plots the nearest support and resistance separately.
The nearest line changes color with the detected market state :
Green indicates a bullish market state.
Red indicates a bearish market state.
Blue indicates a neutral or ranging market state.
The zone lines can also be displayed in Raw, Smooth, or Locked Steps mode. Raw mode follows newly calculated cluster centers directly. Smooth mode gradually moves the plotted level toward the new center, creating a more stable visual structure. Locked Steps mode keeps the previous level in place until the new cluster center has moved by a meaningful ATR-based distance.
Between the outer K-Means zones, the indicator draws a Stochastic Moving Average Heatmap. This heatmap is based on a 100-period Stochastic value smoothed with a 50-period exponential moving average. Lower smoothed Stochastic values appear toward the blue and purple side of the color range, middle values move through cyan and green, and higher values progress toward yellow, orange, and red. The heatmap should be read as a visual momentum layer rather than as a standalone buy or sell signal.
The Price Action row studies candle structure in relation to the nearest K-Means zone and recent price behavior. It uses the candle body, upper wick, lower wick, previous high, previous low, and the location of the nearest zone to identify several possible conditions:
Bullish or bearish zone breakout.
Bullish or bearish rejection from a zone.
Bullish or bearish momentum candle.
Indecision at a K-Means zone.
General indecision.
No clear price action.
The Body, Upper Wick Ratio, and Lower Wick Ratio values represent the relative size of the candle body, upper wick, and lower wick compared with the candle’s total range. These values help explain why the indicator classified a candle as momentum, rejection, or indecision. Price Action should always be read together with Market State and Volatility. For example, a bullish momentum candle inside a bearish market state does not automatically create a bullish setup.
The Volatility module runs a separate K-Means model using normalized ATR, candle range percentage, and return volatility. The clustered volatility data is then used to identify four practical market conditions:
Low Volatility Compression : Market movement has contracted and a future expansion may develop;
Normal Volatility : Current movement is close to its recent reference level;
High Volatility : Price movement is elevated and may require smaller position size or wider risk parameters;
Volatility Shock : Abnormal expansion is present, making immediate entries more sensitive to slippage, unstable movement, and rapid reversals.
Volatility acts as a risk filter for the rest of the analysis. Even when Market State and Price Action point in the same direction, a High Volatility or Volatility Shock reading should reduce the confidence placed on an immediate entry.
Finally, review the Quality row. This section provides an internal assessment of how compact, representative, and consistent the current K-Means calculations are. It does not measure future profitability or win rate. Instead, it evaluates the statistical structure of the active price clusters.
The main values include :
Price Q : A combined score based on zone strength, width, fit, and price distance;
Trust : A weighted score combining price-zone quality, market-state dominance, and volatility-cluster dominance;
Fit RMSE : The normalized root mean squared error of the price clusters;
Width : The average dispersion of the nearest cluster around its center;
Reliability : A descriptive grade derived from the internal Trust score.
A narrow cluster with reasonable strength and lower fitting error will usually receive a better score than a wide, weak, or poorly fitted cluster. Use this section to decide how much weight should be given to the current analysis. A weak Quality score does not make the chart unusable, but it suggests that the levels and classifications should be treated as secondary context.
🟣 Bullish Market Reading
A bullish setup becomes more meaningful when the market state, K-Means zones, candle behavior, volatility, and quality readings support the same interpretation.
Check the Market State first : An Active Bullish Trend indicates stronger bullish structure and relative participation. A Soft Bullish Trend still favors the upside, but entries should normally wait for additional confirmation.
Locate price relative to the nearest zone : When price is above the nearest K-Means zone, that level may become an adaptive support reference. A pullback toward the green nearest-zone line can be watched for continuation or rejection behavior.
Look for bullish price action : A Bullish Rejection From Zone suggests that price tested a clustered level and closed with a stronger lower-wick reaction. A Bullish Zone Breakout shows that the candle crossed above the zone with a sufficiently large body. A Bullish Momentum Candle confirms upward pressure, but it is more useful when the Market State is already bullish.
Use the support line as a reference, not an automatic entry : The K-Means support level can help define the area where bullish structure remains valid. A decisive move below it may weaken the long scenario, especially if the Market State also changes.
Confirm volatility conditions : Normal Volatility is generally easier to manage than High Volatility or Volatility Shock. During compression, traders may wait for a confirmed breakout rather than entering before expansion begins.
Review Quality and Reliability : Stronger Quality, Trust, and Zone Strength readings increase the internal consistency of the analysis. Weak scores suggest that the zone may be broad, poorly fitted, or based on a less concentrated cluster.
A practical bullish sequence may therefore look like this: the table shows a Soft or Active Bullish Trend, price remains above or retests a green K-Means zone, a bullish rejection or breakout appears, volatility is not classified as a shock, and Quality remains acceptable. None of these elements guarantees continuation, but their alignment creates a clearer bullish context than any single reading alone.
🟣 Bearish Market Reading
Bearish analysis follows the same process in reverse. The objective is to identify whether downward market structure, clustered resistance, candle behavior, and volatility are supporting the same scenario.
Begin with the Market State : An Active Bearish Trend represents stronger negative bias, slope, and relative volume pressure. A Soft Bearish Trend favors short-side analysis but still requires confirmation before treating the move as established.
Observe price relative to the nearest zone : When price is below the nearest K-Means zone, that level may act as an adaptive resistance reference. A return toward the red nearest-zone line can be monitored for rejection or continuation.
Wait for bearish price action : A Bearish Rejection From Zone appears when price tests a clustered area and forms a stronger upper-wick reaction. A Bearish Zone Breakout indicates that price has crossed below the zone with a sufficiently large bearish body. A Bearish Momentum Candle carries more weight when the broader Market State is already bearish.
Use the resistance line to define context : The K-Means resistance level can help identify where bearish continuation remains structurally reasonable. A sustained break above it may weaken the short scenario, particularly if Market State also shifts toward bullish or neutral conditions.
Do not ignore volatility warnings : A bearish candle during Volatility Shock may be followed by a sharp continuation, but it can also produce rapid retracement and unstable execution. In this condition, the indicator explicitly favors additional confirmation or reduced risk.
Check cluster quality before relying on the level : A weak or wide price cluster may produce a less precise resistance reference. Higher Quality and Reliability readings indicate a more compact and internally consistent zone, not a guaranteed bearish outcome.
A clearer bearish sequence may include a Soft or Active Bearish Trend, price trading below or retesting a red K-Means zone, bearish rejection or breakout behavior, manageable volatility, and an acceptable Quality score. When these components disagree, for example, a bullish momentum candle inside a bearish trend, the table should be read as a warning that momentum alone is not enough to confirm a reversal.
The built-in alert conditions can be used to monitor bullish and bearish K-Means zone breakouts and rejections. Alerts are most useful as notifications that a specific price-action condition has appeared; the final interpretation should still include Market State, Volatility, zone position, and Quality before any trading decision is made.
🔵 Settings
🟣 K-Means Engine Settings
Market State Lookback : Number of recent bars used to cluster trend bias, slope, and relative volume for market-state classification.
Price Zone Lookback : Number of recent bars used to build K-Means price zones from pivots, highs, and lows.
Volatility Lookback : Number of recent bars used to cluster ATR percentage, candle range, and return volatility.
Market State Clusters : Number of clusters used by the Market State model.
Price Zone Clusters : Number of price clusters used to calculate adaptive zone centers.
Volatility Clusters : Number of clusters used by the Volatility model.
Max K-Means Iterations : Maximum number of center-update cycles allowed during each clustering calculation.
Dominant State Window : Number of recent cluster assignments used to determine the dominant market state.
Fast Volatility State Window : Number of recent volatility assignments used to determine the dominant short-term volatility cluster.
Convergence Tolerance : Minimum center movement required to continue the K-Means iteration; lower values increase precision but may require more processing.
🟣 Price Zone Settings
Pivot Length : Number of bars used on each side of a candle to confirm pivot highs and pivot lows.
High/Low Sampling Step : Controls how frequently historical highs and lows are added to the price-zone dataset; lower values use more samples.
Minimum Near-Zone Distance (%) : Minimum percentage distance used to classify price as testing a K-Means zone.
🟣 Execution Control Settings
Historical Calculation Bars : Number of recent historical bars on which calculations and visual outputs are processed.
Refresh Every N Bars : Runs the main K-Means modules once every selected number of bars and always updates them on the latest bar.
🟣 Zone Stabilizer Settings
Zone Plot Mode : Selects how zone lines are displayed: Raw follows new centers directly, Smooth moves gradually, and Locked Steps updates only after a meaningful price shift.
Zone Smooth Length : Controls the smoothing speed in Smooth mode; higher values produce slower and more stable zone movement.
Zone Lock ATR Multiplier : Defines the minimum ATR-based movement required before a zone updates in Locked Steps mode.
Nearest Zone Switch Margin ATR : Prevents frequent switching between nearby zones by requiring the new zone to be closer by an ATR-based margin.
🟣 Display Settings
Show Analysis Table : Shows or hides the market analysis table.
Table Text Size : Sets the size used inside the table.
Table Position : Selects the table location on the chart.
Show All K-Means Zone Centers : Displays all calculated K-Means price-zone centers.
Show Nearest Zone : Displays the stabilized zone closest to the current price, colored by the detected market state.
Show K-Means Support/Resistance : Displays the nearest clustered support below price and resistance above price.
🔵 Conclusion
This indicator brings K-Means clustering, market state analysis, adaptive price zones, volatility classification, and price action context into one structured workflow. Instead of reducing the chart to a single signal, it separates the market into several readable layers: directional behavior, clustered support and resistance areas, candle reactions, volatility conditions, and the internal quality of the current calculations. This makes it easier to understand whether price is trending, ranging, testing a K-Means zone, reacting to a clustered level, or moving through an unstable volatility phase.
Its strongest use comes from confirmation rather than prediction. A bullish or bearish reading becomes more meaningful when the Market State, nearest K-Means zone, Price Action module, Volatility analysis, and Quality score support the same scenario. When these components disagree, the table highlights that uncertainty instead of hiding it. Used this way, the tool works as a machine learning market analysis framework that helps organize recent price data, compare changing market regimes, and identify areas where further confirmation is still required. مؤشر

HalfTrend Long/Short Signal Engine [BigBeluga]HalfTrend Long/Short Signal Engine is an institutional-grade trend tracking toolkit built for TradingView. It filters out minor market noise to deliver definitive, non-repainting long and short entry signals based on asset volatility and structural swing pivots.
Instead of displaying standard lag-heavy moving averages, this system uses an adaptive directional engine to lock onto clean trend lines and overlay automatic risk-management matrices directly onto your chart. It calculates real-time win rates and scans multiple assets simultaneously so you can trade with systematic statistical backup.
🔵 MAIN ENGINE & MARKET CALCULATION MECHANICS
1. Pure HalfTrend Price Filter Matrix
Swing Pivot Trackers: The engine scans local high and low data using an adjustable lookback filter ( Amplitude ) to find actual structural swing points rather than temporary price spikes.
Volatility-Adjusted Bands: It establishes dynamic outer channel boundaries using a 100-period Average True Range calculation divided by two ( ATR/2 ). The total channel width automatically scales using your custom risk buffer parameter ( Channel Deviation ).
Regime Flip Architecture: The system locks into a Bullish Regime when price crosses above structural highs, shifting the main tracking baseline to Green. When price slips below structural lows, it forces a Bearish Regime and changes the tracking baseline to Red.
2. Automated Risk Matrix & Multi-Asset Scanner
Algorithmic Trade Execution: The moment a new trend regime initializes, the engine projects a strict trade tracking matrix showcasing an entry line, a clear stop-loss boundary, and three tiered profit targets (TP1, TP2, and TP3).
Live Performance Dashboard: An integrated on-screen table calculates real-time historical metrics, tracking active wins, losses, current target risk-to-reward ratios ($1:3$), and overall system win rate percentages.
Screener Security Matrix: The background engine leverages real-time multi-asset queries to stream concurrent trend statuses for five separate configurable symbols directly into a secondary visual dashboard.
// Automated Trade Risk & Multi-Asset Tracking Snippet
if buySignal
float dist = atr2 * baseRiskMult
activeSL := close - dist
activeTP1 := close + dist
activeTP2 := close + (dist * 2)
activeTP3 := close + (dist * 3)
tradeState := 1
entryPx := close
t1 = request.security(sym1, timeframe.period, trend)
🔵 WHY IT IS USEFUL
Elimination of Market Noise: Standard moving averages constantly whip back and forth during consolidations. The HalfTrend calculation filters out minor intraday fluctuations, only shifting when a definitive structural high or low is broken.
Mathematical Execution Blueprint: It takes the emotion out of trade management. Every signal comes equipped with dynamic, visually mapped stop losses and a $1:3$ risk-reward profit map that fills with real-time gradient paths.
Macro Market Synchronicity: The multi-asset side-panel allows you to keep an eye on major market drivers (like BTC, ETH, Gold, or major FX pairs) simultaneously, ensuring your trades line up with broader institutional market direction.
🔵 HOW TO USE THE SYSTEM
Trading Long Breakouts: When the system transitions from a bearish regime into a bullish regime, a Green LONG label will print beneath the breakout candle. Execute your position at the white entry line, setting your dynamic stop-loss boundary inside the red risk gradient.
Trading Short Breakdowns: Monitor the system for a shift into a bearish regime, indicated by a Red SHORT label appearing above the asset price. Execute short orders relative to the entry line and utilize the upper red gradient zone to map your protective risk ceiling.
Managing Exits and Targets: Take partial profits sequentially as the asset price moves through the Green target lines (TP1, TP2, and TP3). If a sudden trend reversal prints an opposing signal before your final targets are satisfied, the script automatically triggers a reversal exit rule to preserve accumulated gains.
Streamline your trade execution, manage portfolio risk systematically, and screen multiple sectors at once with the HalfTrend Long/Short Signal Engine workspace. مؤشر

Education Trend | Wizard AcademyEducativ Trend | Wizard Academy
educativ trend is an educational trend-reading module built to teach traders how to identify real market structure, understand trend direction, avoid weak market conditions, and recognize clean pullback locations.
the tool is designed for beginners who want a clear framework, but it also gives advanced traders a structured way to read price action without relying on emotion or random candle reactions.
the main idea is simple:
a trend is not a feeling.
a trend is not only price above or below a moving average.
a trend is a sequence of swing points.
an uptrend is confirmed by:
higher high + higher low
a downtrend is confirmed by:
lower high + lower low
anything else is treated as range, transition, or unclear structure.
main features
confirmed market structure
the indicator detects confirmed swing highs and swing lows, then classifies them as:
HH = higher high
HL = higher low
LH = lower high
LL = lower low
EQH = equal high
EQL = equal low
each swing label includes educational context so the trader can understand what happened and why it matters.
trend state engine
the trend state is decided from structure only.
uptrend = HH + HL
downtrend = LH + LL
range = mixed or unclear structure
this helps traders avoid the common mistake of forcing trend trades inside a range.
ema context
the tool includes two moving averages:
fast ema
slow ema
the slow ema is used as long-term bias.
the fast ema is used as short-term fair value and pullback context.
the moving averages are not treated as the trend definition. they are used as context around the real structure.
bos and choch
the indicator marks important structure breaks:
BOS = break of structure
CHoCH = change of character
a bullish BOS shows continuation above the last confirmed swing high.
a bearish BOS shows continuation below the last confirmed swing low.
a bullish CHoCH appears when a bearish structure is damaged by a break above the last swing high.
a bearish CHoCH appears when a bullish structure is damaged by a break below the last swing low.
pullback module
the tool highlights textbook pullbacks into the fast ema when trend structure and bias agree.
a long pullback setup can appear when:
structure is bullish
price is above the slow ema
price pulls into the fast ema
price closes back above the fast ema
the candle closes bullish
a short pullback setup can appear when:
structure is bearish
price is below the slow ema
price rallies into the fast ema
price closes back below the fast ema
the candle closes bearish
this helps beginners avoid chasing breakouts and focus on better trade locations.
projected swing levels
the last confirmed swing high and swing low can be projected to the right side of the chart.
these levels show what price needs to break next.
close above the last swing high can create bullish BOS or bullish CHoCH.
close below the last swing low can create bearish BOS or bearish CHoCH.
dashboard
the live dashboard gives a quick read of the current market state.
it displays:
trend structure
last swing high
last swing low
price vs slow ema
fast ema vs slow ema
fast ema slope
distance from slow ema
checklist quality
live coaching message
the first title row uses an orange accent for a clean institutional look.
lesson card
the lesson card gives a simple nine-rule framework for reading trends.
it teaches:
structure first
ema second
entry last
do not chase breakouts
pullbacks are cleaner locations
ranges are dangerous for beginners
invalidation matters
glossary card
the glossary card explains the main structure terms directly on the chart.
it includes:
HH
HL
LH
LL
BOS
CHoCH
EQH / EQL
golden cross
death cross
PB
each panel can be moved to different chart positions, including corners and middle placements.
how to use the indicator
step 1: read the trend state
start with the dashboard.
if the dashboard says uptrend, the market has confirmed HH + HL.
if the dashboard says downtrend, the market has confirmed LH + LL.
if the dashboard says range, the highs and lows do not agree.
beginners should avoid forcing trend trades when the dashboard shows range.
step 2: check the slow ema bias
look at price versus the slow ema.
price above the slow ema shows bullish long-term context.
price below the slow ema shows bearish long-term context.
the ema does not define the trend by itself, but it helps confirm whether structure and bias agree.
step 3: check the fast ema pullback zone
the fast ema acts like short-term fair value.
in a bullish trend, price often pulls back into the fast ema before continuing.
in a bearish trend, price often rallies into the fast ema before continuing lower.
the cleanest entries usually come after a pullback, not after chasing a breakout candle.
step 4: watch the last swing levels
the projected swing high and swing low show the next important structure levels.
if price closes above the last swing high, bullish structure is strengthened or a bearish trend is damaged.
if price closes below the last swing low, bearish structure is strengthened or a bullish trend is damaged.
step 5: use bos and choch correctly
BOS is usually continuation.
CHoCH is usually the first warning that a trend may be changing.
a CHoCH is not automatically an entry. it is a warning to stop blindly trading the old trend and wait for new structure.
beginner long example
1. the dashboard shows uptrend
2. the last structure is HH + HL
3. price is above the slow ema
4. the fast ema is above the slow ema
5. price pulls back into the fast ema
6. price closes bullish above the fast ema
7. the indicator marks a pullback long
8. risk can be planned below the most recent higher low
this is a cleaner long setup than buying after a vertical breakout.
beginner short example
1. the dashboard shows downtrend
2. the last structure is LH + LL
3. price is below the slow ema
4. the fast ema is below the slow ema
5. price rallies into the fast ema
6. price closes bearish below the fast ema
7. the indicator marks a pullback short
8. risk can be planned above the most recent lower high
this is a cleaner short setup than selling after a large breakdown candle.
how to read the checklist
the checklist gives a simple structure-quality score.
3 / 3 = textbook condition
2 / 3 = partial condition
1 / 3 = weak condition
0 / 3 = avoid
a textbook condition means structure, ema bias, and alignment agree.
a partial condition means the market is not fully aligned yet.
a weak condition means the setup is not clean.
best beginner settings
fast ema: 20
slow ema: 200
swing left bars: 5
swing right bars: 5
equal high/low tolerance: 0.05 × atr
show structure labels: on
show bos / choch: on
show pullbacks: on
show dashboard: on
show lesson card: on
show glossary card: on
for faster markets
reduce swing left/right bars to 3 or 4.
this creates faster structure detection, but it can also create more noise.
for cleaner structure
increase swing left/right bars to 7, 8, or 10.
this gives fewer swings, but the structure is stronger and easier to read.
tips
do not use moving averages alone as a trend definition.
do not buy only because price is above the slow ema.
do not short only because price is below the slow ema.
wait for structure confirmation.
avoid trading in the middle of ranges.
a higher high alone does not confirm an uptrend.
a lower low alone does not confirm a downtrend.
the best long setups usually come after a higher low.
the best short setups usually come after a lower high.
BOS confirms strength.
CHoCH warns that the previous trend may be damaged.
equal highs and equal lows often act as liquidity zones.
do not chase extended candles far away from the fast ema.
wait for price to return to value.
use the most recent HL or LH as invalidation.
alerts
available alerts include:
uptrend confirmed
downtrend confirmed
trend lost / range
bullish BOS
bearish BOS
bullish CHoCH
bearish CHoCH
textbook pullback long
textbook pullback short
golden cross
death cross
for cleaner alerts, use once per bar close.
important note
this tool is built as an educational structure-reading module.
it is designed to help traders understand trend logic, market structure, pullbacks, continuation, transition, and invalidation.
always use risk management, position sizing, and confirmation from your own trading plan.
مؤشر

TREND RIBBONtrend filter ribbon
trend filter ribbon is a market structure and trend filtering tool designed to help traders read the active direction of price with a clean ema ribbon, external structure logic, internal entry markers, htf bias filtering, and a compact live dashboard.
the tool is built to answer one simple question:
is the market bullish, bearish, or neutral?
it does not try to predict every candle. it filters the chart so the trader can avoid low-quality counter-trend decisions and focus on cleaner directional setups.
what the indicator does
the indicator combines several elements:
ema ribbon:
a multi-layer ema ribbon shows the current trend body. when the ribbon expands, the trend is stronger. when it compresses, the market is weaker or flatter.
external structure:
major swing highs and swing lows define the main market structure. when price breaks a major level, the script detects bos or choch depending on the current structure state.
internal structure:
smaller swing breaks are used as early entry markers, but only when they agree with the active master trend.
htf veto:
a higher timeframe ema filter can block counter-trend conditions. when the lower timeframe disagrees with the selected htf direction, the master trend can be held as neutral.
live structure levels:
the most important active high and low levels are drawn on the chart so the trader can see where the next structural decision may happen.
dashboard:
a compact institutional-style panel displays external trend, htf bias, master state, ribbon spread, active levels, and early long or short validity.
how to read the ribbon
bullish ribbon:
when the ribbon is bullish, the tool is showing that the active structure and trend conditions favor long setups.
bearish ribbon:
when the ribbon is bearish, the tool is showing that the active structure and trend conditions favor short setups.
neutral ribbon:
when the ribbon is neutral, the market is not clean enough or the htf filter is blocking the active direction. beginners should usually avoid trading during neutral conditions.
ribbon spread:
the ribbon spread measures the distance between the fastest and slowest ribbon ema, normalized by atr.
flat:
the ribbon is compressed. the market may be ranging or weak.
building:
the ribbon is expanding. trend strength is improving.
strong:
the ribbon is clearly expanded. the current direction has stronger momentum.
bos and choch
bos means break of structure.
a bullish bos appears when price continues higher by breaking a valid structural high during a bullish structure.
a bearish bos appears when price continues lower by breaking a valid structural low during a bearish structure.
choch means change of character.
a bullish choch appears when price breaks structure upward after a bearish phase.
a bearish choch appears when price breaks structure downward after a bullish phase.
for beginners:
bos usually means continuation.
choch usually means possible reversal.
how to use the indicator
step 1: check the master trend
start with the dashboard.
if master is bullish, focus only on long ideas.
if master is bearish, focus only on short ideas.
if master is neutral, wait.
step 2: check the htf bias
the htf line shows whether the selected higher timeframe is bullish or bearish.
when the htf agrees with the master trend, the condition is cleaner.
when the htf disagrees, the tool can hold the master trend in neutral mode.
step 3: check the ribbon spread
flat ribbon:
avoid aggressive entries.
building ribbon:
look for confirmation.
strong ribbon:
trend conditions are more active.
step 4: wait for structure
a bos can confirm continuation.
a choch can show that the previous direction may be changing.
beginners should not enter only because a label appears. the label should be combined with context, trend direction, support and resistance, and risk management.
step 5: use internal entry markers
internal entry markers are early signals that appear only in the direction of the active filtered trend.
a long marker is only valid when the master trend is bullish.
a short marker is only valid when the master trend is bearish.
beginner example
example long setup:
1. master trend is bullish
2. htf bias is bullish
3. ribbon spread is building or strong
4. price breaks structure upward
5. a long entry marker appears
6. trader looks for a logical stop below the recent swing low
7. trader targets the next resistance, previous high, or a fixed risk/reward level
example short setup:
1. master trend is bearish
2. htf bias is bearish
3. ribbon spread is building or strong
4. price breaks structure downward
5. a short entry marker appears
6. trader looks for a logical stop above the recent swing high
7. trader targets the next support, previous low, or a fixed risk/reward level
main inputs
external swing strength:
controls the strength of the major swing structure. higher values create fewer but stronger structure signals. lower values create more responsive signals.
internal swing strength:
controls the smaller internal structure used for early entry markers. lower values are faster. higher values are cleaner but slower.
break confirmation:
choose whether structure breaks are confirmed by close or wick.
close:
more conservative.
wick:
more reactive.
bos pivot strength:
controls the pivot sensitivity used for bos continuation levels.
choch pivot strength:
controls the pivot sensitivity used for choch reversal levels.
htf timeframe:
selects the higher timeframe used for directional filtering.
htf ema length:
controls the ema used for the higher timeframe bias.
base ema length:
sets the first ema in the ribbon.
ema step:
controls the spacing between each ema in the ribbon.
ribbon lines:
turns the ribbon lines on or off.
ribbon fill:
turns the fill between ribbon layers on or off.
core glow:
adds a stronger visual emphasis to the main ribbon line.
external structure labels:
shows or hides bos and choch labels.
internal entry markers:
shows or hides early long and short markers.
live structure levels:
shows or hides the active major structure levels.
background tint:
adds a light background color based on the current master trend.
dashboard:
shows or hides the live panel.
dashboard position:
lets the trader place the panel in any chart position.
alerts
the script includes alerts for:
bullish choch
bearish choch
bullish bos
bearish bos
long entry
short entry
for best results, create alerts after the indicator is added to the chart and select the alert condition that matches your trading plan.
beginner tips
do not trade every signal.
use the indicator as a filter, not as a complete trading system.
avoid trading when the dashboard shows neutral.
avoid trading when the ribbon spread is flat.
look for agreement between master trend and htf bias.
always define stop loss, target, and invalidation before entering.
combine the tool with support and resistance, liquidity levels, volume, session context, or higher timeframe analysis.
important notes
this indicator is designed for market analysis and trend filtering.
it does not guarantee profitable trades.
signals can fail during news, low liquidity, sideways markets, or high volatility conditions.
risk management remains the responsibility of the trader.
the best use of this tool is to filter direction, read structure, and avoid trading against the dominant trend.
مؤشر

مؤشر

SmartTraders Research Labs -Geometric Trend Lines - GTLGEOMETRIC TREND LINES (GTL)
GTL is a research indicator that studies the geometry of price structures. It freezes structural anchors in the past, stretches two right-triangles between those anchors and the live candle, and reads their angles inside a dimensionless coordinate space — then learns from every completed structure to estimate, with calibrated statistics, which way the current one is leaning. It is a structural analysis and research tool, not a trading system.
█ STEP OUT OF THE CHART PLANE
Every trader has drawn a trendline and called it steep. Steep compared to what? Stretch the chart window and the angle flattens. Jump from Bitcoin to a quiet blue-chip stock and a "45-degree rally" becomes a completely different animal. The chart plane mixes two quantities that were never meant to share axes — price and time — so any angle drawn on it is a property of your zoom level, not of the market.
My standard, before any geometry begins, is to take the shape out of the chart plane entirely. GTL maps every point into an Isotropic Coordinate System (ICS) where both axes are pure numbers:
y = log(price) / σ
x = bars / lookback
Price is expressed in units of the instrument's own volatility (σ, estimated with the Yang-Zhang method over 500 bars), and time in units of the analysis window. Nothing on either axis carries dollars, lira, satoshis or minutes anymore.
In this space, a degree finally means something. The angle
θ = atan(Δy / Δx) × 180 / π
is intrinsic: a 60° ceiling angle on gold's 30-minute chart describes the same geometric event as a 60° ceiling angle on a 3-minute meme-coin chart. The instrument's personality — its price level, its tick size, its temperament — has been normalized away, and what remains is pure trajectory. Everything else in this indicator stands on that ground.
The same rally, two zoom levels, two different angles — and on the right, the dimensionless ICS home where θ finally becomes a property of the market, not of your screen.
█ THE TRIANGLE — A SHAPE THAT CARRIES DATA
Of all the shapes humanity has leaned on, the triangle is the one that never let us down. It raised the pyramids, it holds every bridge truss and roof frame you have ever walked under, and it is the only polygon that cannot be deformed without changing the length of a side. Engineers call that property rigidity. I read it as trustworthiness — a triangle does not lie about its geometry.
That is why I chose it as the measuring instrument. On every structure, GTL constructs two right-triangles inside ICS:
The ceiling triangle — from the frozen HH anchor to the live candle's high.
The floor triangle — from the frozen LL anchor to the live candle's low.
Each triangle is not a drawing; it is a container. Four measurements live inside it at every bar:
θ — the signed angle of the hypotenuse, the indicator's core reading
Δy — the signed magnitude of the move in volatility units
area — the geometric surface the structure has swept
centroid — the shape's center of mass in ICS
While price grinds below a frozen ceiling, the ceiling angle sinks degree by degree into negative territory. When price presses up from a frozen floor, the floor angle climbs. Two triangles breathe with the market — one watching from above, one from below — and their angles are the raw language everything downstream of this indicator speaks.
One triangle watches from above, one from below — and θ, Δy, area and centroid live inside each of them.
█ AN ANCHOR IN THE PAST — MEASURING FROM CALM WATER
Picture a storm at sea, and two people trying to measure the waves. One stands on the shore. One sits in a boat, right among them. The observer on the shore, feet on solid ground, reads the height of every wave with precision — however wild the water gets, the ground beneath him does not move. The observer in the boat rises and falls with the very thing he is trying to measure; every number he writes down is contaminated by his own motion.
Most swing-based tools are the observer in the boat. Their reference points — the latest swing high, the latest swing low — are redefined by the market again and again, so any angle or distance measured from them mixes two movements at once: the price's, and the reference's own.
GTL plants its observer on the shore. At the birth of every structure, the highest high and the lowest low of the lookback window are frozen — locked to a fixed bar in the past — and from that moment they do not move. Every angle is measured from calm, settled water toward the storm of the live candle. The reading stays pure: when θ changes, it is because price moved, and for no other reason.
The anchors hold until price closes beyond one of them. That close is the break — the moment the structure completes, is archived with its full geometry, and a fresh pair of anchors freezes for the next chapter.
One naming note, so the chart reads correctly: what GTL labels HH and LL are these frozen anchor levels, not the traditional trailing swing highs and lows.
Solid ground measures the storm precisely; a boat measures mostly itself — GTL is the observer on the shore, and the frozen box below is exactly that shore.
█ WHY 23 — A PRIME WINDOW
The lookback window — the number of bars GTL scans before freezing a new pair of anchors — defaults to 23. The choice is arithmetic, not aesthetic.
23 is prime: its only divisors are 1 and itself. Stated as a condition,
gcd(23, k) = 1 for every k < 23
For a rolling window, that matters mechanically. If a periodic component of length k shorter than the window is present in the data, the window boundary does not keep meeting that component at the same phase. Because 23 and k are coprime, the alignment steps through all k possible phase offsets before it repeats. A composite window gives that protection away: 24 divides cleanly by 2, 3, 4, 6, 8 and 12, so components at those lengths can meet repeated window boundaries at the same phase, allowing anchor placement to inherit regularity from the measuring frame itself.
Engineering solved the same problem with hunting-tooth gear design: tooth counts are chosen coprime so each tooth eventually meshes with every counterpart, instead of the same pairs meeting forever and wearing a repeated pattern into the metal. Periodical cicadas offer a biological analogy — 13- and 17-year emergence cycles, both prime, reduce overlap with shorter recurring cycles.
This is a design principle stated in number theory, not a performance claim. A prime window does not make GTL better by itself, and it does not prove anything about future price. It simply reduces one avoidable source of arithmetic resonance, so repetition in the readings is less likely to be created by the measuring window. The lookback remains a user input; 23 is the default I stand behind.
Every window from 20 to 25 shares a divisor with at least one shorter cycle length — 23 is the only empty row, which is exactly why it is the default.
█ HOW THIS SERIES IS BUILT — CSV OUT, ANALYSIS IN
This episode follows a working method I now treat as the standard for the whole series: nothing ships on intuition alone. The indicator exports its own internal life — every angle, every structure, every break — as plain columns in the Data Window, ready for CSV export. Before publication, those exports were analyzed with AI assistance across a deliberately diverse panel:
7 instruments × 2 timeframes = 14 datasets
gold, Bitcoin, Tesla, Brent crude, Turkish Airlines, Dogecoin, Saudi Aramco
30-minute and 3-minute bars — roughly 550,000 bars, ~30,000 completed structures
What came back from that study entered the code as design decisions, not as promises. Exactly five constants in the learning layer are hard-coded. They are not presented as universal truths or performance guarantees; they are documented design constants selected from the development study and kept fixed so the live model remains transparent and reproducible:
CAL_LAMBDA = 0.999 — fading-factor decay for the calibration counters
CAL_JUMPTH = 2.0 — empirical jumpiness threshold between steady and choppy estimates
CAL_MINW = 30 — minimum effective sample weight before a calibration cell is trusted
CAL_ROLL = 20 — length of the live recent-record window
JUMP_WIN = 5 — bars used for the short-term stability measurement
The methods behind the layer are standard enough to be named — fading-factor prequential counting for online calibration, adaptive Gaussian KDE for local probability estimation, and Kish-style effective sample size for weighted evidence — and the next section walks through each of them with its reference. The fixed values above are GTL's calibrated defaults from that study, not claims that these numbers are optimal for every market, symbol, or timeframe. Everything else the statistics need — bandwidth, confidence, significance — is computed live from the chart's own history.
Two honest disclosures. First, this analysis is development documentation, not an independent audit, and this description makes no accuracy claims from it. Second, the same door is open to you: every column used in that study is exported by the script itself, so you can pull the CSV from your own chart and put the same questions to any tool you trust.
The build loop of this series: the script exports its own life as CSV, analysis turns it into five documented design constants, and the same door stays open to every user.
█ FROM GEOMETRY TO STATISTICS — THE MATH, WITH ITS REFERENCES
An angle is a measurement; an estimate is a statement. Moving from one to the other honestly requires statistics. GTL does not present this layer as a private invention. It combines established statistical components, named here with their sources, and applies them to one specific object: the geometry of frozen price structures.
Volatility normalization. The σ in the ICS y-axis comes from the Yang-Zhang volatility estimator (Yang & Zhang, Journal of Business, 2000). It uses open, high, low and close data, including overnight, open-to-close and Rogers-Satchell-style range components. In GTL, this is what lets angles be measured in volatility-normalized space instead of raw price units.
Local probability. While a structure is alive, its current angle pair (θC, θF) is compared with archived breaks. Each historical break receives a Gaussian weight that decays with distance in angle space. This is a Gaussian KDE-style local weighting scheme. Its bandwidth follows Silverman's rule-of-thumb logic for two dimensions, h = σ̂ · n^(−1/6), recomputed from the chart's own history. Nothing is manually tuned.
Honest sample size. Weighted evidence can look larger than it really is: many tiny weights are not the same as many strong neighbors. GTL therefore uses the Kish effective sample size (Kish, Survey Sampling, 1965),
n_eff = (Σw)² / Σw²
to estimate how much effective evidence the weighted neighborhood actually contains.
Probability with humility. The weighted up/down vote is passed through a Beta(1,1) posterior, using n_eff as the effective evidence scale. The label only speaks when the posterior mean clears a one-sided 95% normal-approximation check against the 50/50 baseline. When that threshold is not met, the label does not force a call; it simply says the structure is too close to call.
Verification. The principle that probability forecasts must be scored against what actually happened goes back to Brier's 1950 paper in Monthly Weather Review, "Verification of Forecasts Expressed in Terms of Probability." In GTL, every estimate is graded when the break reveals the outcome.
Online calibration. Graded outcomes update fading-factor prequential counters, following the stream-learning evaluation framework of Gama, Sebastião and Rodrigues (Machine Learning, 2013). Fresh evidence receives more weight, while older evidence decays with λ = 0.999. The display can therefore show both the raw estimate and how estimates of the same kind have behaved on the current chart.
Stability. GTL also tracks estimate "jumpiness": the population standard deviation of the last five probability readings. The term and the general idea come from ensemble-forecast consistency research, especially Zsóter, Buizza and Richardson (Monthly Weather Review, 2009). GTL uses a chart-specific adaptation of that idea: a steady estimate and a choppy estimate are labeled differently, because a choppy estimate may still flip.
Nothing in this chain is exotic, and none of it is a performance guarantee. The original part is where the chain is pointed: at frozen structural geometry, measured inside a dimensionless coordinate space.
█ WHAT YOU SEE ON THE CHART
Frozen anchors. Two dashed horizontal lines mark the frozen HH and LL of the current structure, each with its exact level, and a dotted vertical line marks the anchor bar in the past where the freeze happened. These lines do not trail price — that is the whole point.
Geometric trend lines. Two solid lines run from the anchors to the live candle: ceiling from HH to the current high, floor from LL to the current low. They are the triangle hypotenuses. When the two lines converge, they stop at their intersection instead of crossing. The live θC and θF values sit as labels at the anchor.
Structure boxes. Every completed structure is archived as a box: one border color for structures that broke up, another for structures that broke down, and a dashed box for the structure still being built. How many past boxes you see is your choice.
Angle map. A table sorts the recent breaks by their break angles — ceiling side and floor side, each with direction and duration. An arrow row shows where the current live reading ranks among them, so you can literally see where "now" sits in the break history. The footer row carries the up/down estimate; once the calibration cell has enough samples, it shows two numbers, raw → calibrated.
Estimate label. A label floats ahead of the last candle and speaks in sentences: which direction the odds favor, what signals of this kind have actually done on this chart (or the estimated odds while calibration is still warming up), whether the signal is steady or choppy, and a living record — how many of the last 20 estimates were right. It only takes a side when the significance check passes; otherwise it says, honestly, that the structure is too close to call.
The pending phase. Between a break and the next freeze, preview anchors appear as dotted gray lines, the table shows an hourglass, and the estimate quietly switches to a second model trained on pending-phase angles to estimate the direction of the NEXT structure's break.
One disclosure that matters: on the live bar, angles and estimates can change until the candle closes. Everything the indicator learns from — and every alert it fires — reads confirmed bars only.
█ UNDER THE CHART — 29 EXPORTED COLUMNS
Everything drawn above is only a rendering. The numbers underneath are all exported to the Data Window, which means TradingView's "Export chart data" hands you a complete CSV audit trail:
Live geometry & estimate, every bar:
Ceiling θ / Floor θ — the two live angles in ICS
Probability UP / Probability DOWN — the per-bar estimate (these two are also plots, so you can build threshold alerts on them directly)
Log Jump Bar — the stability (jumpiness) of the estimate
Log Cell Bar — which calibration cell this bar fell into
Structure snapshot, printed on every break bar:
Str Duration — how many bars the structure lived
Str Frozen HH / Str Frozen LL — the anchor levels
Str Max High / Str Min Low — the extremes reached inside
Str θ Ceil @Max / Str θ Floor @Min — the angles at those extremes
Str Break Dir — +1 up, −1 down
Estimate audit trail, on birth and break events:
Log Event — 1 = birth, 2 = break, 3 = both on one bar
Log θC Birth / Log θF Birth / Log P Birth / Log Sig Birth / Log nEff Birth — the forecast made the moment the structure was born
Log θC Pend / Log θF Pend / Log P Pend / Log Sig Pend / Log nEff Pend — the pending-phase forecast carried into this break
Log Hit Birth / Log Hit Pend — each forecast graded 1 or 0 against the actual break
Log Acc Birth / Log Acc Pend — the running accuracy of each estimate type
This is the same door the development study walked through. Export the CSV from your own chart, open it in a spreadsheet, in Python, or hand it to an AI assistant — and audit every sentence the label has ever told you.
█ SETTINGS THAT STAY OUT OF YOUR WAY
The settings menu is deliberately small: the lookback window, a few visual choices — colors, transparency, border style, table position, label size and offset, how many past boxes to show — and simple on/off toggles. That is the whole surface, because everything statistical is computed live from the chart itself: the KDE bandwidth from Silverman's rule, the effective sample size from Kish's formula, significance from the posterior, the calibrated rate from the fading counters, the pending-phase model switching in and out on its own. There is nothing to tune, and that is by design. The five documented constants from the development study are the only fixed numbers in the machine.
█ ALERTS
Three alerts cover the estimate's life cycle: Signal turns up, Signal turns down, and Signal gets choppy. Each fires once, on entering its state, and reads only confirmed bars — so what fired is what you will still see on the closed candle. For custom thresholds, Probability UP and Probability DOWN are exposed as plots: build Crossing Up or Greater Than alerts on them directly in TradingView's alert dialog, at any level you like, as many as you like. Recommended frequency: Once Per Bar Close.
█ SEVENTEEN LANGUAGES
The angle map, the anchor labels and the estimate label speak 17 languages: English, Türkçe, Deutsch, Italiano, Français, Español, Bahasa Indonesia, Bahasa Melayu, Ελληνικά, Русский, 中文, 日本語, 한국어, हिन्दी, العربية, فارسی and עברית. Right-to-left scripts — Arabic, Persian, Hebrew — mirror the table layout automatically. One honest limitation: input settings and alert messages stay in English, because Pine requires compile-time constant strings there.
█ WHAT THIS IS — AND WHAT IT IS NOT
GTL is a research and structural analysis tool. It measures the geometry of frozen price structures, keeps honest statistics about its own estimates, and shows you both — the raw number and the track record, side by side. It is not a trading system, its estimates are not trade signals, and nothing in this script or this description is financial advice. The calibrated rates describe what has already happened on your chart's own history; they are not a promise about the next bar. On the live candle, readings can change until the close — confirmed statistics and learning update on closed bars only.
Read it the way it was built to be read: as an instrument standing on the shore, measuring the storm. مؤشر

مؤشر

Demand Supply Zone MatrixDemand Supply Zone Matrix by DayTradeSetup
Demand Supply Zone Matrix is an automatic Demand & Supply Zone indicator designed to help traders identify important price areas more clearly without manually drawing every zone.
The system detects potential Supply and Demand zones based on market momentum, volume activity, and the strength of price movement. It also includes zone grading, touch tracking, mitigation reference levels, alerts, and a dashboard summary to help traders filter key zones more efficiently.
Key Features
• Automatic Demand & Supply Zones
Automatically detects potential Supply and Demand zones based on strong directional price movement.
• Strength Grade / Score
Each zone is graded with an A / B / C score to help traders evaluate the quality and strength of each zone more easily.
• 50% Mitigation Line
Displays the midpoint of each zone, which can be used as a reference area for mitigation, retest, or reaction analysis.
• Touch Counter
Tracks how many times price has returned to test a zone, helping traders identify whether a zone is still fresh or has already been tested.
• Zone Retest Alert
Sends an alert when price comes back to test an active Supply or Demand zone.
• Zone Break Alert
Sends an alert when a zone is invalidated or broken by price action.
• Dashboard Summary
Includes a dashboard showing Supply/Demand zone count, best grade, total volume, and overall market bias.
How to Use
This indicator is designed to be used as a technical analysis tool for identifying areas where buying or selling pressure may appear.
Suggested workflow:
1. Check whether Supply or Demand is currently dominant.
2. Focus on higher-grade zones such as A or B.
3. Wait for price to return and test the zone.
4. Use additional confirmation such as Price Action, Market Structure, Trend Direction, or Risk Management before entering a trade.
Suitable For
This indicator is suitable for traders who use concepts such as:
Demand & Supply
Smart Money Concepts
Price Action
Retest Zones
Momentum Trading
Intraday Trading
It can be applied to multiple markets, including XAUUSD, Forex, Crypto, Indices, and different timeframes depending on the trader’s strategy.
Disclaimer
This indicator is a technical analysis tool only. It is not a direct Buy/Sell signal and does not guarantee trading results. Traders should always combine it with their own trading plan, risk management, and additional confirmation before making any trading decisions.
Risk Warning: Trading involves risk. Please study and understand the risks carefully before making any investment or trading decision. مؤشر
