Cumulative Delta Divergence Suite## Cumulative Delta Divergence Suite
The underlying cumulative-delta calculation and CDV candle construction are adapted from “Cumulative Delta Volume” by LonesomeTheBlue, licensed under MPL 2.0. This version adds independently developed divergence detection, multi-factor scoring, higher-timeframe analysis, absorption and exhaustion conditions, alerts, timeframe presets, and historical target/stop outcome analysis.
### Overview
Cumulative Delta Divergence Suite is a multi-module volume-pressure analysis indicator built around a cumulative delta oscillator.
The script compares confirmed price pivots with confirmed cumulative-delta pivots and combines divergence analysis with configurable scoring, higher-timeframe context, absorption conditions, Z-score extreme zones, timeframe presets, alerts, and simplified historical target/stop outcome tables.
The purpose of combining these components is to examine disagreement between price structure and directional volume pressure from several related perspectives. The modules are not simply displayed independently. Divergence magnitude, delta momentum, relative volume, trend alignment, higher-timeframe agreement, and pivot spacing can contribute to a shared scoring and classification process.
The displayed conditions are analytical observations. They do not predict that price will reverse, continue, or reach a particular level.
### Cumulative delta calculation
Standard chart volume does not directly separate executed buying volume from executed selling volume.
The cumulative-delta calculation used by this script derives directional volume from each candle's:
* total volume;
* body size;
* upper wick;
* lower wick;
* closing direction.
The resulting directional volume value is accumulated over time to construct the cumulative delta series.
The oscillator is displayed as candles in a separate pane. Users can display either the raw cumulative delta candles or an internally calculated Heikin-Ashi representation.
The Heikin-Ashi option smooths the oscillator structure, but this additional averaging can delay changes and alter the location of oscillator pivots.
The calculation is derived from chart OHLCV data. It does not use exchange bid/ask transaction classifications, footprint data, or order-book data.
### Divergence framework
The script compares confirmed pivots in price with confirmed pivots in the cumulative delta oscillator.
It identifies four divergence structures:
* Regular bullish divergence occurs when price forms a lower low while cumulative delta forms a higher low.
* Regular bearish divergence occurs when price forms a higher high while cumulative delta forms a lower high.
* Hidden bullish divergence occurs when price forms a higher low while cumulative delta forms a lower low.
* Hidden bearish divergence occurs when price forms a lower high while cumulative delta forms a higher high.
Regular divergence highlights disagreement between a new price extreme and the cumulative-delta structure.
Hidden divergence highlights a different form of structural disagreement that traders commonly examine within an existing trend.
Neither type establishes what price will do afterward.
### How the modules work together
The script is designed as a cumulative-delta analysis workflow rather than a collection of unrelated indicators.
Divergence provides the primary structural condition by comparing price pivots with cumulative-delta pivots.
The scoring system then evaluates additional characteristics surrounding that divergence, including divergence magnitude, recent delta-momentum change, relative volume, trend alignment, higher-timeframe agreement, and the distance between the compared pivots.
Absorption conditions examine bars where comparatively strong directional volume occurs with limited price progress under the selected volume, range, body, and confluence filters.
Z-score zones identify cumulative-delta readings that are unusually high or low relative to their recent distribution.
Higher-timeframe analysis provides broader confirmed divergence, trend, and volume context.
These components therefore perform different roles within the same analysis process rather than simply duplicating one another.
### How to use the indicator
Apply the indicator to a symbol that provides usable volume data.
The cumulative delta candles appear in a separate pane below the price chart.
A practical workflow is:
1. Review the broader price trend and market structure.
2. Observe whether cumulative delta generally confirms or disagrees with price.
3. Wait for a confirmed regular or hidden divergence condition.
4. Inspect the optional price and oscillator divergence lines to see which pivots were compared.
5. Review the divergence strength score and A+, B, or C category.
6. Check whether confirmed higher-timeframe context agrees with the current structure.
7. Review nearby absorption conditions and Z-score extreme zones.
8. Examine support, resistance, volatility, liquidity, and candle structure separately.
9. Treat all markers as analytical conditions rather than automatic trade instructions.
10. Test settings, alerts, and historical outcome assumptions on the intended symbol and timeframe.
### Regular bullish divergence
Regular bullish divergence is confirmed when:
* price forms a lower confirmed low;
* cumulative delta forms a higher confirmed low.
Price has therefore reached a new lower pivot while the cumulative-delta oscillator has not produced a corresponding lower pivot.
Traders may examine this disagreement together with market structure, support, momentum, cumulative-delta behaviour after confirmation, Z-score context, absorption conditions, and higher-timeframe structure.
The condition can fail, and price can continue lower after confirmation.
### Regular bearish divergence
Regular bearish divergence is confirmed when:
* price forms a higher confirmed high;
* cumulative delta forms a lower confirmed high.
Price has therefore reached a new higher pivot while the cumulative-delta oscillator has not produced a corresponding higher pivot.
Traders may examine this disagreement together with market structure, resistance, momentum, cumulative-delta behaviour after confirmation, Z-score context, absorption conditions, and higher-timeframe structure.
The condition can fail, and price can continue higher after confirmation.
### Hidden bullish divergence
Hidden bullish divergence is confirmed when:
* price forms a higher confirmed low;
* cumulative delta forms a lower confirmed low.
This structure is commonly examined within an existing upward trend because price retains a higher low while cumulative delta makes a deeper retracement.
It does not guarantee that the upward trend will continue.
### Hidden bearish divergence
Hidden bearish divergence is confirmed when:
* price forms a lower confirmed high;
* cumulative delta forms a higher confirmed high.
This structure is commonly examined within an existing downward trend because price retains a lower high while cumulative delta makes a stronger retracement.
It does not guarantee that the downward trend will continue.
### Raw and Heikin-Ashi CDV candles
When Heikin-Ashi CDV candles are disabled, the script uses the raw cumulative delta candle values.
When they are enabled, the script applies an internal Heikin-Ashi transformation to the cumulative delta series.
This affects only the oscillator displayed by the indicator. It does not convert the main TradingView price chart to Heikin-Ashi candles.
The smoothed representation can make broader cumulative-delta structure easier to inspect, but it may also delay short-term changes and alter oscillator pivot locations.
### Pivot settings and confirmation delay
Pivot Left controls how many earlier bars participate in identifying a pivot.
Pivot Right controls how many later bars must pass before that pivot becomes confirmed.
Higher pivot values generally produce fewer pivots, filter more short-term movement, and confirm conditions later.
Lower pivot values generally produce more pivots and react more quickly, but they are also more sensitive to short-term movement.
A pivot-based divergence is not known on the original pivot bar.
The script must wait for the configured number of Pivot Right bars before the pivot can be confirmed.
After confirmation, divergence markers and optional connecting lines are drawn at the original pivot location so users can visually inspect the price-versus-CDV structure.
For example, when Pivot Right is 5, five subsequent bars are required before the pivot is confirmed.
Consequently, a historical divergence marker appears on the earlier pivot bar even though the condition only became known several bars later.
Alerts for pivot-based divergences occur after confirmation, not on the earlier pivot bar.
### Divergence lines
The script can draw oscillator pivot-to-pivot lines in the indicator pane and corresponding price pivot-to-pivot lines on the main chart.
These lines show the exact pair of pivots used for the divergence comparison.
For example, regular bullish divergence connects two price lows where the newer price pivot is lower while the corresponding cumulative-delta pivot is higher.
The lines can be disabled when a cleaner chart is preferred.
### Divergence strength score
The optional divergence strength value measures the relative displacement between the compared price pivots and cumulative-delta pivots.
It is derived from the magnitude of the price movement and the magnitude of the oscillator movement between the compared pivots.
It is not a probability, win rate, or forecast.
The Minimum Divergence Strength setting can suppress conditions whose calculated magnitude is below the selected value.
### Composite scoring
Each confirmed divergence can receive a configurable composite score.
The score combines several measurements:
* divergence strength;
* recent change in smoothed delta momentum;
* volume relative to its recent average;
* alignment with the script's EMA-based trend state;
* agreement with confirmed higher-timeframe divergence context;
* distance between the compared pivots.
Each component performs a different function.
Divergence strength measures the magnitude of the structural disagreement.
Delta momentum examines recent directional change in the smoothed delta series.
Relative volume measures participation around the evaluated pivot.
Trend alignment provides directional price context.
Higher-timeframe agreement measures whether the selected confirmed HTF divergence context supports the same side.
Pivot spacing distinguishes closely grouped pivots from structures developing across a wider interval.
Users can adjust the contribution of these components through the scoring weights.
The active weights are normalized before the final composite value is calculated.
The score organizes conditions according to the selected model. It is not a prediction of future performance.
### Score categories
The script assigns A+, B, or C categories according to the configured score thresholds.
These categories are internal classifications.
They are not probabilities, win rates, accuracy measurements, guarantees, or independently validated performance rankings.
An A+ category means only that the condition reached the highest configured score range.
A B category means that the condition reached the middle configured range.
A C category represents conditions below the B threshold that remain eligible under the selected filter.
The Minimum Grade setting can suppress conditions below the selected category.
### Score transformation
The Score Boost Power applies a nonlinear transformation to the composite score before the A+, B, and C thresholds are evaluated.
Lower values compress scores upward and therefore allow higher categories to occur more frequently.
Higher values keep transformed scores closer to the underlying composite values and make the upper categories more selective.
This setting changes the script's internal classification behaviour. It does not increase the probability that a condition will succeed.
### Adaptive score scaling
When Adaptive Grade Scaling is enabled, the script compares the current raw composite score with the recent distribution of composite scores.
It uses a rolling mean and standard deviation to place the current value in the context of recently observed values before the category thresholds are applied.
When adaptive scaling is disabled, category thresholds are applied to the unscaled composite score.
Because adaptive scaling is relative to recent observations, the same general type of structure can receive different categories under different market conditions.
### Higher-timeframe context
The script can evaluate divergence context from a user-selected higher timeframe.
The HTF module calculates its pivot structure, trend context, and relative-volume component using confirmed data from the requested higher timeframe.
The script uses the last fully closed higher-timeframe information rather than relying on a still-forming HTF candle.
This means higher-timeframe information becomes available only after the required higher-timeframe data has been confirmed.
The HTF module identifies regular bullish, regular bearish, hidden bullish, and hidden bearish cumulative-delta divergence structures.
Its scoring process combines HTF divergence strength with HTF trend context and HTF volume participation.
Higher-timeframe conditions can be displayed separately and can also contribute to the chart-timeframe composite score.
An independent HTF Minimum Grade setting determines which higher-timeframe categories are displayed.
Because confirmed HTF data is used, higher-timeframe conditions can appear later than chart-timeframe conditions.
Higher-timeframe context should therefore be interpreted as broader confirmed information rather than an earlier signal.
### Absorption conditions
The absorption module searches for bars where comparatively large directional delta occurs while price progress remains constrained under the selected filters.
The module evaluates:
* directional delta relative to its recent average;
* volume relative to its recent average;
* candle range relative to its average;
* candle body as a proportion of the complete range;
* an optional close opposing the delta direction;
* optional proximity to a recently graded divergence.
A bullish absorption condition is associated with comparatively strong negative delta while downward price progress remains limited under the configured filters.
A bearish absorption condition is associated with comparatively strong positive delta while upward price progress remains limited under the configured filters.
The module is derived from chart OHLCV information. It does not prove that passive limit orders absorbed aggressive market orders.
The markers should therefore be interpreted as absorption-style analytical conditions rather than direct measurements of order-book behaviour.
### Absorption confluence and filtering
Absorption conditions can be filtered using recent divergence proximity, minimum divergence category, cooldown bars, volume thresholds, delta thresholds, range thresholds, body-to-range limits, and optional opposite-close confirmation.
When divergence confluence is enabled, the absorption condition must occur within the configured number of bars following a qualifying divergence.
The absorption grade displayed with a condition is derived from the nearby qualifying divergence category.
These filters change which conditions are displayed. They do not guarantee a particular subsequent price outcome.
### Z-score extreme zones
The script calculates a Z-score from the cumulative-delta oscillator's rolling mean and standard deviation.
A lower extreme zone appears when the oscillator moves below the selected negative Z-score threshold.
An upper extreme zone appears when the oscillator moves above the selected positive threshold.
These zones identify values that are unusually high or low relative to the oscillator's recent statistical distribution.
The Z-Score Length determines how much history contributes to the rolling mean and standard deviation.
The Z-Score Threshold determines how many standard deviations the oscillator must move from its rolling mean before an extreme zone is displayed.
Higher thresholds produce fewer extreme zones. Lower thresholds produce more frequent zones.
An extreme value does not establish that buying or selling pressure is exhausted and does not establish that price will reverse.
Extreme readings can persist or become more extreme.
### Using divergence, absorption, and Z-score context together
The modules provide different forms of information.
Divergence compares price pivot structure with cumulative-delta pivot structure.
Absorption examines strong directional delta occurring with constrained price progress.
Z-score analysis measures whether cumulative delta is unusually high or low relative to recent values.
Higher-timeframe analysis provides broader confirmed structural context.
Composite scoring organizes divergence conditions according to multiple characteristics of the setup.
The purpose of combining these modules is to provide several related perspectives on price-versus-volume-pressure disagreement without treating any one module as a complete trading system.
Confluence between modules provides additional analytical context but does not automatically validate a condition or guarantee reversal or continuation.
### Timeframe presets
The script contains lower-, medium-, and higher-timeframe preset bundles.
The presets adjust selected settings including:
* pivot lengths;
* score transformation power;
* adaptive score scaling;
* Heikin-Ashi CDV display;
* absorption averaging lengths;
* absorption thresholds;
* absorption confluence lookback.
The presets are intended as starting configurations.
They are not automatically optimized for the active symbol and have not been fitted to guarantee particular historical results.
Users can disable Apply Timeframe Preset to configure the corresponding settings manually.
### Cooldown settings
Independent cooldown controls can reduce repeated conditions of the same type.
Separate cooldown settings are available for regular divergences, hidden divergences, higher-timeframe divergences, absorption conditions, and Z-score extreme conditions.
A value of zero disables the relevant cooldown.
Higher cooldown values reduce repeated same-direction markers but can also suppress nearby structures that would otherwise qualify.
### Historical target/stop outcome tables
Optional tables provide a simplified historical outcome study for confirmed divergence and absorption conditions.
When a condition is confirmed, the script records the confirmation-bar closing price and calculates a fixed percentage target and fixed percentage stop level.
The target and stop percentages are user configurable.
Outcome evaluation begins on the bar after the condition is confirmed.
This prevents price movement that occurred earlier within the confirmation bar from being counted as a subsequent target or stop event.
Each confirmed condition is tracked independently.
If another qualifying condition appears before an earlier condition has resolved, the newer condition does not replace the earlier unresolved condition in the historical study.
For each tracked condition, the script records whether the target or stop is reached first.
If both the target and stop are touched during the same evaluation candle, standard OHLC chart data does not reveal which level was reached first. In this situation the script uses a conservative convention and counts the stop as occurring first.
Separate tables are available for:
* regular bullish divergence;
* regular bearish divergence;
* hidden bullish divergence;
* hidden bearish divergence;
* bullish absorption;
* bearish absorption.
The tables display the number of target-first outcomes, stop-first outcomes, and the resulting target-first percentage for the available chart history.
These tables are intended as a basic chart-based comparison tool.
They are not TradingView Strategy Tester results and are not a complete strategy backtest.
They do not model commissions, slippage, bid/ask spread, realistic order execution, position sizing, portfolio equity, liquidity, partial fills, or complete intrabar price sequencing.
Historical results depend on the symbol, timeframe, available chart history, target and stop distances, filters, indicator settings, and available volume data.
The table percentages describe only the simplified historical study produced under those settings. They do not imply future performance.
### Evaluation target and stop lines
The script can display the fixed target and stop levels associated with the most recently confirmed qualifying condition.
The Target and Stop labels remain anchored at the left side of their respective lines. While the outcome is unresolved, the lines extend to the right. Once either the target or stop is reached, the lines end at the resolution bar and remain visible until a newer qualifying condition replaces them.
These levels use the same configurable percentage distances as the historical outcome study and are provided for visual evaluation rather than as trading recommendations.
Only the most recent Target/Stop pair is displayed to limit chart clutter, while historical conditions continue to be tracked independently by the outcome tables.
### Alerts
Alerts are available for configured divergence, absorption, and exhaustion conditions.
Pivot-based regular and hidden divergence alerts occur only after the required Pivot Right bars have confirmed the pivot.
A+ divergence alerts require the underlying divergence to qualify for the A+ category.
Absorption conditions can depend on values from the current chart bar and can therefore change while that bar is still forming.
Z-score extreme conditions can likewise change as the current chart bar develops.
Users who require closed-bar confirmation should configure their TradingView alert frequency accordingly.
Higher-timeframe divergence context uses confirmed higher-timeframe information.
### What makes the implementation distinct
The script extends a cumulative-delta framework into a broader price-versus-volume-pressure analysis workflow.
Its distinguishing structure includes:
* cumulative delta candle visualization;
* optional internal Heikin-Ashi smoothing;
* regular and hidden pivot-based price/CDV divergence analysis;
* configurable divergence strength filtering;
* multi-factor divergence scoring;
* user-adjustable scoring weights;
* nonlinear score transformation;
* adaptive score scaling;
* A+, B, and C classification and filtering;
* confirmed higher-timeframe divergence analysis;
* higher-timeframe trend and volume context;
* absorption conditions that can be linked to recently graded divergences;
* Z-score extreme analysis;
* timeframe-based parameter presets;
* independent cooldown controls;
* independent tracking of historical target/stop outcomes;
* configurable target and stop evaluation levels;
* divergence, absorption, exhaustion, and grade-based alerts.
The purpose of this combination is to evaluate price-versus-cumulative-delta disagreement using several related measurements within a single workflow.
The divergence module identifies the structural event. The score measures characteristics of that structure and its surrounding context. Higher-timeframe analysis supplies broader confirmed context. Absorption examines directional volume occurring with limited price progress. Z-score analysis identifies statistically unusual oscillator readings. The historical tables provide a simplified way to inspect what happened after past qualifying conditions.
This integration is the reason the components are combined rather than published merely as separate common indicators placed together.
### Limitations
Cumulative delta in this script is derived from candle structure and chart volume rather than exchange bid/ask transaction classifications.
Volume quality and interpretation vary between exchanges, brokers, instruments, and symbols.
Pivot-based divergences are delayed by the selected Pivot Right value.
Confirmed pivot markers and divergence lines are drawn on the earlier pivot location after confirmation, so historical marker placement is earlier than the time at which the condition became known.
Heikin-Ashi smoothing changes the cumulative-delta oscillator structure and can introduce additional delay.
Higher-timeframe analysis waits for confirmed HTF information, which can delay HTF conditions.
Divergence conditions can fail and price can continue in the same direction after a divergence has been confirmed.
Hidden divergence does not guarantee trend continuation.
Absorption conditions are OHLCV-based analytical approximations and do not directly identify passive order-book absorption.
Z-score extremes can persist or become more extreme.
Composite scores and A+, B, and C categories are model outputs, not probabilities, win rates, accuracy measurements, or independently validated performance rankings.
Adaptive scaling can change classifications as the recent score distribution changes.
Lower timeframes can produce more frequent and noisier conditions.
Timeframe presets are starting configurations and are not automatically optimized for a symbol.
Historical target/stop tables are simplified outcome studies and do not represent complete strategy backtests.
Historical target-first percentages depend heavily on the selected target/stop distances, indicator settings, symbol, timeframe, available history, and market conditions.
The indicator does not model commissions, slippage, spread, liquidity, or realistic execution.
No divergence, score category, absorption condition, Z-score reading, target/stop outcome, or combination of these elements guarantees future market behaviour.
The indicator should not be used as the sole basis for a trading decision.
This script is an analytical tool and does not provide financial advice or guaranteed trading outcomes. Penunjuk

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 .
Penunjuk

StormCore Engine: OTE, Alligator & Volume ProfileThe StormCore Engine is a modular, all-in-one technical analysis tool designed to consolidate three powerful trading methodologies into a single, highly optimized script. By combining Optimal Trade Entry (OTE) zones, a modernized Williams Alligator, and a dynamic Volume Profile with node detection, this engine helps traders identify liquidity zones, trend alignments, and key volume clusters without exhausting indicator limits on the chart.
This script is built with a modular architecture, meaning every core component can be toggled on or off via a "Master Toggle" in the settings, keeping your workspace clean and reducing CPU load when specific tools are not in use.
### Core Modules
1. Optimal Trade Entry (OTE)
This module automatically plots Fibonacci retracement levels (including the 62% and 79% "sweet spot" boxes) anchored either to the visible chart area, custom date ranges, or higher timeframe swings.
- Features fractal detection to identify potential market structure shifts.
- Customizable Fibonacci extensions for dynamic profit-taking targets.
2. Super Alligator
A modernized take on the classic Bill Williams Alligator indicator. It utilizes SMMA-based Jaw, Teeth, and Lips to gauge trend direction and momentum.
- Signal Generation: Prints explicit Buy/Sell markers only when the "mouth" is fully open and the gap between the close price and the Lips exceeds a user-defined percentage.
- Trend Filters: Includes optional SMA 200 and VWAP filters to ensure signals only fire in the direction of the macro trend or intraday fair value.
3. Volume Profile & Node Detection
Calculates the trading volume at specific price levels over a user-defined lookback period.
- Displays the Point of Control (POC) and Value Area High/Low (VAH/VAL).
- Node Detection Algorithm: Highlights high-volume Peaks and low-volume Troughs within the profile, which often act as significant support and resistance barriers.
### Practical Application (How to Use)
A high-probability setup occurs when multiple modules align:
- Wait for the price to retrace into the OTE 70% box.
- Check if this zone coincides with a Volume Profile Peak (indicating strong historical liquidity).
- Await a confirming signal from the Super Alligator (e.g., a Buy triangle firing above the VWAP filter) to execute the trade.
All modules are calculated independently but rendered cleanly to avoid chart clutter. Adjust the settings for your specific asset and timeframe.
Developed by Andy Storm | AI-StormCore. Penunjuk

Macro HUDMacro HUD is an on-chart panel that shows the macro context around the instrument you are trading, so you can read price with the broader backdrop in view rather than in isolation.
Most indicators transform the price already on your chart into another form of the same price. Macro HUD does something different: it reads a set of other markets and presents their current state as context on a single panel, so you do not have to open several extra charts or an economic calendar to see the wider picture. It is a context dashboard, not a signal generator.
What it shows
The panel has four sections:
Macro engine — the US Dollar Index (DXY), the US 10-year and 2-year Treasury yields, crude oil, and the VIX. Each row shows its current value and a direction arrow measured over a lookback you set. The VIX row adds a volatility-regime band: Calm, Normal, Stressed, or Panic.
Regime — two plain-language reads derived from the rows above: a dollar read (bid or offered, from its recent direction) and a risk read (risk-on, risk-off, or mixed, from a chosen index's trend together with the VIX band).
Watchlist — up to five instruments of your choice, each labelled Bull or Bear depending on whether its price sits above or below a moving average, so you can see the directional state of a whole basket at a glance.
Event — an optional manual countdown to your next key economic releases. You enter the events yourself; the panel displays whichever is soonest and turns red inside a stand-down window you define.
How it works
Every value in the panel is requested from another symbol on a timeframe you choose (Daily by default) using request.security. The direction arrows compare the current value to the value a set number of bars earlier. The VIX band and the dollar and risk reads are simple threshold and trend rules applied to those requested values — the band uses fixed volatility thresholds, and the risk read combines an index's position relative to its moving average with the VIX band. The watchlist Bull/Bear flags compare each requested symbol's price to an EMA of its own price. The event countdown compares the current time to the timestamps you enter and shows the nearest upcoming one. Nothing in the panel is predictive; it reports the current state of external data.
Why it is original, and why these parts are combined
Macro HUD is not a single built-in republished, and it is not a mashup of overlapping signals. Each component answers a different question, and they are gathered together because a discretionary trader usually needs all of them at once before acting:
The macro engine answers "what is the broad backdrop?" — the dollar, rates, oil, and volatility.
The regime rows condense that backdrop into a plain read that can be absorbed at a glance.
The watchlist answers "what state is my basket in right now?" across several instruments without switching charts.
The event row answers "is it safe to act, or is a major release imminent?" — the one piece Pine cannot source on its own.
The purpose of the combination is to assemble, on one panel, the external context a trader would otherwise gather from several separate windows plus an economic calendar. No component duplicates another; each covers a distinct part of the question "should I be looking at this market now, and with what lean?" That specific, purpose-built combination is what the script contributes.
How to use it
Add it to any chart. Open the settings and point the macro and watchlist symbols at instruments your data plan supports, set the read timeframe (Daily gives the broad regime regardless of your chart timeframe), and choose the EMA length used for the Bull/Bear flags. If you follow economic events, type your next few releases into the event slots. The panel then updates live. Panel text colour is theme-aware by default and can be forced to black or white.
Limitations and things to be aware of
Pine cannot read the economic calendar or news, so the event slots are filled in by hand. If you do not maintain them, the event row simply shows that no event is set.
The direction arrows show short-term direction over your chosen lookback, not the absolute level. A market can show a down arrow while still being historically high, so read the arrow as recent drift, not position.
The regime reads are deliberately simple threshold and trend rules, not a proprietary model. They are a quick summary, not a forecast.
Some symbols (DXY, yields, VIX) depend on your TradingView data plan. If a row shows "n/a", open the settings and replace that symbol with one your plan provides. The script handles missing symbols without failing.
All values reflect the chosen read timeframe and update on that basis.
Scope
Macro HUD assembles context. It does not generate buy or sell signals, predict direction, or tell you what to do, and it makes no performance claims. The interpretation and every trading decision remain entirely yours.
This script is open-source. The full Pine code is available on this page for anyone to read, verify, and build upon.
Penunjuk

Strategi

MICRO SOM What this is
A Kohonen Self-Organizing Map that learns market structure from scratch, with no labels, no backpropagation, and no predefined regimes. It builds a topological map of every market condition it has observed, then shows you where the current bar sits on that map.
This is unsupervised competitive learning — a fundamentally different approach from the neural networks usually seen on TradingView. Nothing here is trying to predict direction. It is trying to organize market states, and any predictive read is a byproduct you interpret afterward.
How it works
Each bar is encoded as a five-dimensional vector: distance from VWAP, trend-versus-chop efficiency, volatility state, relative volume, and momentum. All five are ATR-normalized so the map transfers across instruments.
Thirty-six nodes arranged in a 6×6 grid compete to be nearest that vector. The closest node wins — and critically, the winner and its grid neighbors shift toward the input, weighted by a Gaussian falloff.
That neighbor update is the entire mechanism. It forces adjacent nodes to represent similar market states, which is what turns 36 independent clusters into a genuine map. Remove it and this is just k-means.
The neighborhood radius decays over training. A wide radius early establishes global topology; a narrow radius later refines local detail. A fixed radius either never organizes or freezes into a poor layout within the first hundred bars.
The map trains on every confirmed bar. Filtering samples would distort the density it exists to represent.
Reading the display
A 6×6 grid renders to the right of price:
Teal — states that historically preceded upward movement
Red — states that preceded downward movement
Gray — neutral or insufficiently visited
Brightness — visit frequency and directional consistency
White border — the node matching the current bar
Watch the highlighted cell move. That is the market traversing learned state space in real time.
BIAS shows the average forward move that historically followed from the current node, in ATR units. This is measured after clustering, not optimized for — the map organized blind, then the script asked what tended to follow from each region.
NOVELTY is the Euclidean distance from the current bar to its nearest node. When it exceeds the 90th percentile of its own recent history, the chart tints orange and a diamond prints. This means current conditions resemble nothing the map has learned.
Why novelty may be the most useful output
Threshold rules cannot tell you when they are outside their domain. This can. An ALIEN reading is a direct signal that historical analogues are unavailable — typically the moment other models are least reliable and position size should be smallest.
Settings
Learn — adaptation rate. Higher adapts faster but organizes less stably.
Radius — initial neighborhood width. Larger enforces smoother global topology.
Decay — bars over which learning rate and radius anneal toward their floor.
Grid X / Grid Size — map placement and cell height in ATR units.
Honest limitations
The map requires roughly 1,200 bars to organize meaningfully. Before that, the topology is still unfolding and bias values are noise.
BIAS is a historical average, not a forecast. A node showing +0.4 ATR means bars in that region tended upward — it says nothing about the sample size behind that average or whether the relationship persists.
Five features cannot capture everything that matters. The map organizes what it is shown, and no more.
This is an analytical and visualization tool. It produces no entry or exit signals, and it is not financial advice.
Open source. The full algorithm is readable in the code, with the competitive learning step, neighborhood update, and radius annealing documented inline. Penunjuk

Liquidity Shift PulseIs a price-structure and liquidity-based overlay indicator designed to identify selected bullish transition and expansion conditions, then manage the resulting long-side state using protected market structure.
The indicator is built around price behavior, confirmed swing structure, volatility normalization, participation, and market-regime conditions. It does not use moving-average crossovers, RSI, MACD, or ADX as signal generators.
1. Purpose
LSP is intended to help traders visually study two different types of bullish price behavior:
Liquidity Shift Entry
Looks for a downside liquidity sweep followed by a reclaim, bullish displacement, and a break of internal price structure.
Expansion Entry
Looks for a strong bullish breakout from an established price range when candle expansion, participation, and market-regime conditions support the move.
These two engines serve different purposes. The liquidity engine focuses on transitions that begin around previously confirmed swing liquidity, while the expansion engine allows the indicator to recognize strong directional breaks even when no recent liquidity sweep is present.
2. Liquidity Shift Logic
The indicator tracks confirmed swing highs and swing lows using pivot-based structure.
For a bullish liquidity setup, price must first trade below a previously confirmed swing low by a configurable ATR-normalized amount and then reclaim that level. The candle must also show sufficient lower-wick rejection.
After the sweep, the script stores the relevant internal structure level and waits for bullish confirmation within the configured setup window.
Confirmation requires several elements:
A valid liquidity sweep and reclaim.
Bullish candle displacement.
Minimum candle range relative to ATR.
Minimum candle-body proportion.
Strong closing location within the candle.
A close above the stored internal structure level.
Optional relative-volume confirmation.
Optional market-regime confirmation.
A setup that becomes too old or moves materially below its sweep low is invalidated.
3. Expansion Entry
The Expansion Entry engine is designed for a different market condition.
Instead of requiring a prior liquidity sweep, it looks for price to close above the highest high of a configurable previous range.
The breakout candle must meet configurable requirements for:
Breakout distance.
Range expansion relative to ATR.
Candle-body proportion.
Closing strength.
Relative volume, when available and enabled.
Market-regime conditions.
The Expansion Entry can be disabled independently from the liquidity-shift engine.
4. Participation Filter
LSP can compare current volume with a previous rolling volume baseline.
The resulting relative-volume measurement can be used to prevent an entry condition from being accepted when participation is below the selected threshold.
If usable volume data is unavailable for the symbol, the script does not treat missing volume as automatic confirmation failure.
5. Market Regime Filter
The optional regime filter uses a Choppiness Index calculation to distinguish more directional conditions from highly compressed or irregular environments.
The filter can accept either:
A sufficiently directional market, or
A market whose choppiness is decreasing while remaining below the configured transition threshold.
This component is used as a contextual filter rather than as an independent trading signal.
6. Protected Structure
After a BUY condition is confirmed, LSP establishes a Protected Structure level below price.
As new confirmed higher pivot lows form after entry, this protected level can move upward.
An important design characteristic is that Protected Structure is one-directional during an active long state:
It can move higher, but it does not move lower.
This creates a visual representation of the price structure that the active bullish condition is attempting to preserve.
7. SELL / Exit Logic
The SELL label in LSP represents an exit from an active long-side state, not an independent short-entry signal.
A SELL can occur when one of the following conditions is confirmed:
Price closes below Protected Structure.
A bearish liquidity reversal develops after sufficient favorable movement.
A large established move gives back more than the configured percentage of its maximum open favorable excursion and receives bearish candle confirmation.
Because SELL conditions are evaluated only while the script is in an active long state, users should not interpret SELL labels as standalone short recommendations.
8. Large-Trend Protection
For unusually extended favorable moves, the script tracks:
Entry price.
ATR at entry.
Highest price reached since entry.
Maximum favorable movement.
Current remaining favorable movement.
Percentage of the maximum move that has been given back.
Once the move exceeds the selected ATR activation threshold, the optional profit-protection logic can react to excessive giveback accompanied by bearish price behavior.
This feature is intended as structural protection logic rather than a profit target.
9. Main Settings
The script provides controls for:
Liquidity Engine
Pivot sensitivity
ATR period
Minimum sweep penetration
Minimum rejection wick
Structure Shift
Internal structure length
Setup memory
Structure-break buffer
Displacement range
Candle-body strength
Closing strength
Setup invalidation
Expansion Entry
Enable/disable expansion entries
Breakout lookback
Breakout buffer
Expansion range
Body requirement
Closing strength
Participation
Relative-volume filter
Volume baseline
Minimum relative volume
Market Regime
Choppiness filter
Choppiness period
Directional threshold
Transition threshold
Exit Protection
Initial structure buffer
Higher-low protection buffer
Bearish reversal activation
Large-trend activation
Maximum profit giveback
Visuals
Protected Structure
Confirmed liquidity levels
Liquidity sweep markers
BUY/SELL labels
Signal distance from price
10. Alerts
Alert conditions are included for:
Bullish liquidity sweep
Liquidity-shift BUY
Expansion BUY
Combined BUY
Bearish liquidity shift
SELL
Users can create TradingView alerts from these conditions according to their own workflow.
11. Confirmation and Repainting Behavior
LSP evaluates its principal signal conditions on confirmed bars.
Swing liquidity levels are based on confirmed pivot highs and pivot lows. Because pivot confirmation requires bars to form to the right of the potential swing, these levels inherently appear with confirmation delay.
This is intentional: a swing is not treated as confirmed before the required right-side bars exist.
The script does not use future-looking data or lookahead logic to generate historical signals. Once a BUY or SELL event has been confirmed on a closed bar, the script does not intentionally relocate that historical signal.
Users should distinguish this from normal real-time chart behavior: values and conditions on the currently open candle can change until that candle closes.
12. How to Use
LSP is best interpreted as a structured market-analysis framework, rather than as a standalone mechanical trading system.
Possible uses include:
Identifying liquidity-reclaim transitions.
Identifying strong structural expansion events.
Monitoring whether a bullish structure remains intact.
Visualizing progressively higher protected structure.
Creating alerts for selected liquidity and structural events.
Combining LSP with a trader's own risk management, higher-timeframe analysis, and broader market context.
Different markets and timeframes have different volatility and liquidity characteristics, so the default parameters should not be assumed to be optimal for every instrument.
13. Design Approach
The script combines several price-action concepts for a specific workflow rather than simply stacking unrelated indicators.
Its sequence is designed around:
Liquidity interaction → reclaim → displacement → structure confirmation → protected structure management
with a separate expansion path for strong structural breakouts.
The purpose of combining these components is to distinguish initial bullish qualification from subsequent structure management and exit conditions within one consistent state model.
14. Limitations
Liquidity Shift Pulse is an analytical indicator, not a strategy or automated trading system.
It does not predict future prices and does not guarantee that a liquidity sweep, breakout, BUY, SELL, or protected-structure event will lead to a profitable outcome.
Important limitations include:
Pivot-based swing detection introduces confirmation delay.
Strong trends can produce false breakouts.
Liquidity sweeps can fail after reclaiming a level.
Choppy markets can create repeated structural transitions.
Volume quality varies between instruments and data sources.
ATR normalization adapts measurements to volatility but does not make different markets behaviorally identical.
Protected Structure is a price-structure reference, not a guaranteed stop level.
Historical observations do not establish future performance.
The indicator should therefore be used together with independent analysis and appropriate risk management. Penunjuk

Matrix Risk/RewardMatrix Risk/Reward is a visual trade-planning overlay. Click three points on the chart (entry, stop, target), then drag them. The script converts those prices into dollar risk, dollar reward, tick distance, risk/reward ratio, and live open P&L for the size you set.
It does not read your broker or prop-firm order ticket, and it does not place, modify, or cancel orders. The three points are planning levels you control.
HOW TO USE
1. Add the indicator to the chart.
2. Click Entry, then Stop, then Target.
3. Set Size to your contracts, lots, or units.
4. Click the indicator on the chart so the three points light up, then drag those points, not the dashed rays.
5. Read dollar SL/TP on the labels and in the table.
Direction is detected automatically: stop below entry = long, stop above entry = short. Stop and target must sit on opposite sides of entry for a valid R:R.
WHAT IT SHOWS
- Stop loss in dollars and ticks
- Take profit in dollars and ticks
- Open P&L in dollars
- Reward-to-risk ratio
- Dollars per tick
- Bid / ask / spread when a quote mode is active
- Colored risk and reward zones
OPEN P&L QUOTE
Last +/- spread (default, all plans): bid = last minus half spread, ask = last plus half spread. Longs mark to bid. Shorts mark to ask. Set Spread (ticks) to your market (1 is typical for MES, MNQ, ES, NQ).
Last price: uses the chart close only.
1-tick bid/ask (Ultimate): uses live 1-tick bid and ask. Requires a TradingView Ultimate plan. If those quotes are missing, it falls back to Last +/- spread.
POINT VALUE
Dollar math is price move x point value x size.
Leave Point value override at 0 to auto-detect common futures (MNQ 2, MES 5, NQ 20, ES 50, YM 5, RTY 50, GC 100, MGC 10, CL 1000, MCL 100, MYM 0.5, M2K 0.5). For other symbols the script uses the chart's built-in point value. If dollars look wrong, set the override yourself.
SETTINGS
Position: Size, point value override, open P&L quote mode, spread in ticks.
Levels: Draggable entry, stop, and target.
Display: Table, zone colors, and zone transparency.
NOTES
This is a calculator overlay, not a strategy and not a broker bridge.
If you want the dollars to match a live ticket, drag this tool onto those prices.
1-tick bid/ask is optional. Leave the default quote mode on unless you have Ultimate.
Not financial advice. Size, point value, and spread must match the instrument you are trading. Penunjuk

Sattam | Gann ToolsSATTAM | GANN TOOLS - a complete Gann geometry toolkit on two clicks
Four independent Gann constructions, all built from a single anchor you place
yourself: the Cycle Star, the Gann Grid, four Gann Fans, and tiling Gann
Squares. Each turns on or off without disturbing the others.
=== HOW TO PLACE IT ===
Add the indicator and it asks for two points:
1. THE ANCHOR - one click sets both the starting price and the starting date.
2. THE FIRST LEVEL DATE - one click sets the time unit.
Everything else is derived. The gap between the two clicks becomes the box's
time unit, and the starting price becomes the head of the cycle.
=== THE CORE IDEA: THE CYCLE LIVES IN SQUARE-ROOT SPACE ===
The cycle's reach is measured in the SQUARE ROOT of price, not in price:
end = ( sqrt(startPrice) +/- 2 * sqrt(Space) * totalDegrees / 360 ) ^ 2
With Space = 100 one full turn spans exactly 20 units of sqrt(price). Because
the travel is linear in the root, the price gaps compress as price falls and
open up as it rises - the Square-of-Nine behaviour Gann worked in.
Space is the only input that sets the reach:
2*sqrt(50) = 14.1421
2*sqrt(100) = 20.0000
2*sqrt(200) = 28.2843
=== CYCLE SHAPE: A POLYGON'S ANGLE SUM ===
Cycle shape decides how far around the cycle travels and in how many steps.
Each polygon is walked in 2n steps covering its interior angle sum,
(n-2)*180, so a single step is (n-2)*90/n:
SHAPE SIDES STEP STEPS TOTAL SWEEP
Triangular 3 30 6 180
Circular / Square 4 45 8 360
Pentagon 5 54 10 540
Hexagon 6 60 12 720
Heptagon 7 64.2857 14 900
Octagon 8 67.5 16 1080
Nonagon 9 70 18 1260
Decagon 10 72 20 1440
Straight line - 90 4 360
Custom - your Angle derived derived
The root-space reach scales with the total sweep, so a Decagon travels four
whole turns and reaches four times as far as a Circular cycle. Circular and
Square are the same figure - both are the four-sided case.
Custom takes its step straight from the Angle input: set 60 and you get a
Hexagon; leave it at 0 and it falls back to 45.
=== ANGLES, SECONDARY ANGLES AND TIME LEVELS ===
Two ways to distribute the levels:
Calculate Angles by Averages ON
Levels spaced EQUALLY IN PRICE. Even ladder, constant gaps.
Calculate Angles by Averages OFF
Levels spaced EQUALLY IN SQRT(PRICE). The gaps shrink steadily as the
cycle descends and grow as it rises - the truer Gann reading.
Main and secondary levels alternate by index: even-numbered levels take the
main style and colour, odd-numbered ones the secondary. Draw Secondary Angles
hides the odd ones on their own.
TIME DIVISIONS - the box is (steps / 2) units wide.
- Solid time levels on 0, 1/4, 1/2, 3/4, 1 of the width.
- Dashed levels on 1/2 +/- {1/10, 1/6, 1/4, 3/10, 1/3} - the very same five
fractions the price levels use, mirrored about the middle of time instead
of the middle of price.
=== THE STAR ===
The signature figure: the box frame, its mid vertical and mid horizontal, and
FOURTEEN diagonals - corner to opposite corner, corner to the far side's
middle, corner to the mid vertical's opposite end, and the mid vertical's ends
back to both side middles. Twenty lines that mark every internal crossing of
the range.
INTERNAL PRICE LEVELS - five pairs mirrored about the box centre at
1/10, 1/6, 1/4, 3/10 and 1/3 of the span, drawn dotted with their prices
labelled. The quarter pair lands exactly on the 90 and 270 degree levels.
=== THE GANN GRID ===
Full grid
Main channel
A 4 x 4 lattice over the box: the time quarters against the price quarters,
which are the 0/90/180/270/360 degree levels. Every cell carries both of its
diagonals - 32 lines, and nothing else; the grid draws no frame of its own.
Draw only main channel keeps the 1x1 band alone: the diagonal cells keep both
diagonals, the cells directly above and below keep the main one. Fourteen
lines instead of thirty-two.
=== THE GANN FANS ===
1st fan
2nd fan
3rd fan
4th fan
All four
Extra Angles
Extend
A fan from any of the four corners of the box, each on or off independently.
Every fan carries the nine classic Gann angles - 1x8, 1x4, 1x3, 1x2, 1x1,
2x1, 3x1, 4x1, 8x1. Each ratio is drawn as two lines: one crossing the full
width and landing on that fraction of the price span, one crossing the full
span and landing on that fraction of the width. The 1x1 belongs to both
families, so a fan is ten lines.
- Extra Angles adds 5x8, 8x5, 7x8 and 8x7 - four more lines.
- Extend turns the fan into rays that carry on past the box.
=== THE GANN SQUARE ===
One square
Tiled squares
A square of price against time, drawn as the same twenty-line figure the Star
uses, at its own size.
- Box Size is the width in CALENDAR DAYS.
- Height = Box Size x Price Unit.
- Leave Price Unit at 0 and it resolves automatically to one hundred ticks
of the symbol - 10 on a 0.1-tick future, 1 on a 0.01-tick stock.
- Boxes Left / Right / Up / Down tile the identical square in each
direction, so you can carry the grid of squares across the chart.
The square runs the way the cycle runs: down from the anchor on a falling
cycle, up on a rising one.
=== DIRECTION ===
Trend decides which way the cycle travels from the anchor.
- Bullish - up.
- Bearish - down.
- Auto - compares your anchor price with the LAST CLOSE: an anchor above the
market runs down, an anchor below it runs up.
=== EXTENDING THE CYCLE ===
- Extra whole cycle multiplies the walk. On a Circular cycle, 1 takes it
from 360 to 720 degrees and doubles the reach.
- Extra primary angle adds one primary angle - 90 degrees, so two steps. On
a Circular cycle, 1 takes it from 360 to 450 degrees.
- Time space, when set, replaces the First-Level unit with a plain span of
calendar days.
=== STYLING ===
Every family has its own style, width and colour: main angles, secondary
angles, time levels, the star, the star's time levels, the star's price
levels, the grid, the fans and the squares. Label size follows the Size input.
=== NOTES ===
- The two anchor points are interactive inputs. If you edit and recompile
the script, TradingView clears them and asks for the two clicks again.
- The drawing is placed by date, so it keeps the same calendar position
across timeframes.
- On very long sweeps (Decagon, or a large Extra whole cycle) the root can
cross zero and square back up. That is the geometry doing what it is
defined to do, not an error. Penunjuk

Order Block & Breaker Block ZoneOrder Block & Breaker Block Zone
A strict Order Block detector, and the Breaker Block that a failed Order Block turns into.
Most Order Block tools mark the last opposite coloured candle before a strong move. That
description fits almost any pullback, which is why those tools cover a chart in boxes. This one
asks for four independent pieces of evidence on the same candle before it will draw anything, and then it keeps following the zone for the rest of its life instead of drawing it once and walking away.
The candle's own colour is never checked. Colour is a description of a candle, not evidence about what happened at that price.
WHAT HAS TO HAPPEN
Bullish Order Block
1 The block candle trades BELOW the previous candle's low the sweep
2 That same candle is Candle 1 of a valid three candle bullish imbalance, so Candle 3's low sits above the block candle's high the gap
3 Price does not trade back into the block's high to low range while it is still waiting the zone stays clean
4 A candle CLOSES above the last unbroken swing high the structure break
Bearish Order Block is the same read upside down: the block candle trades above the previous
candle's high, the imbalance runs the other way, and a candle closes below the last unbroken
swing low.
The zone drawn is the block candle's full high to low range.
The structure break also has to land inside a wait window, counted forward from Candle 3. A block that needs fifty candles to break structure is no longer the same story, so the wait is limited and the block is dropped when it expires.
BOS OR CHoCH - A TAG, NOT A GRADE
Market structure is tracked separately, from swing pivots. Each new swing is compared with the
one before it, which gives the familiar higher high, higher low, lower high, lower low reading,
and from that the structure is either bullish or bearish.
A break that runs WITH the structure is a Break of Structure. A break that runs AGAINST it is a
Change of Character, and that is what flips the structure the other way. Mechanically they are
the same event - a close beyond a swing level. Only the direction relative to the current
structure decides the name.
So a Bullish Order Block can arrive in two very different situations, and the label says which:
Bull OB (CHoCH) the market was bearish and this block flipped it a reversal block
Bull OB (BOS) the market was already bullish and carried on a continuation block
Neither ranks above the other. They are different stories, not different quality levels, and the
tag exists so you can tell them apart at a glance instead of reconstructing it from the chart.
THE LIFE CYCLE
A zone is not finished when it is drawn. It is followed until it resolves.
Fresh confirmed and untouched. Drawn in the bullish or bearish colour.
Mitigated price has traded back into the zone. It is no longer a fresh Order Block, so it
is repainted in grey. It is kept because it is what a Breaker grows from.
Breaker Block the zone has failed, with a candle CLOSING through its far side. It flips polarity and is redrawn in the opposite colour. A wick through does not count.
The entry and the failure can land on the same candle. One candle that trades into the zone and closes through the other side takes the block from fresh to Breaker in a single step, and that is treated exactly like a slower failure.
No reaction inside the zone is asked for before a Breaker is drawn, and that is a deliberate
departure from how this is usually done. Where an Order Block is only "the last opposite candle
before a move", a Breaker built on it needs a second proof, because the block itself proved
nothing. That weakness is not present here. A zone only becomes an Order Block after a sweep, and imbalance and a structure break, and a displacement that broke structure IS the evidence that orders were resting at that price. Asking for a reaction on top of it is asking for a second
receipt for the same purchase.
It is also worth being clear about what actually traps a trader. Limit orders fill the moment
price trades into the zone. They are trapped the moment a candle closes through the far side. A reaction candle in between never created that trap - it was only a witness to it, and the absence of a witness does not mean the event did not happen. A proven zone that is overrun without even being allowed to answer is not the weaker case. It is the more one sided one.
WHAT MAKES THIS DIFFERENT
1. Four conditions, not one.
Sweep, imbalance, clean zone and structure break each test something different: that liquidity
was taken, that the move away was violent enough to leave a gap, that nobody has been back, and that the move changed something. Any one of them on its own is common. All four on the same candle is not.
2. Colour is ignored on purpose.
The classic "last opposite candle" case still gets caught, because the candle that sweeps the
previous extreme is usually that candle anyway. It is caught as a consequence of the evidence
rather than as the rule, and the blocks that only ever qualified on colour are left out.
3. The zone is followed, not just marked.
Fresh, mitigated and breaker are three different states, and a zone moves between them as price does its work. What is on the chart is the zone's current condition, not the condition it was in on the day it formed.
4. The Breaker inherits the block's proof instead of asking for a new one.
Because the Order Block had to earn its place, a Breaker built on it does not need a reaction
close to be believed. What is asked for is the one thing that actually matters: a candle body
closing through the far side. That keeps the rule honest in both directions - it does not throw
away a violent one candle break, and it still refuses a wick.
5. Structure is measured, not assumed.
BOS and CHoCH come from confirmed swing pivots that have to be paid for with right hand candles. Nothing is read from a moving average or a fixed lookback window.
6. The evidence is on the chart, not just the claim.
Each block can show the imbalance that qualified it and the swing level whose break confirmed it. You are not asked to take the label's word for it - the gap and the broken level are drawn where they happened, so the block can be checked in a couple of seconds.
READING THE CHART
Green box, "Bull OB (BOS)" or "Bull OB (CHoCH)" fresh bullish Order Block, label below
Red box, "Bear OB (BOS)" or "Bear OB (CHoCH)" fresh bearish Order Block, label above
Grey box, "... mitigated" tapped, waiting to resolve
Green box, "Bullish Breaker" a failed bearish block, polarity flipped
Red box, "Bearish Breaker" a failed bullish block, polarity flipped
Each box spans the Order Block candle's full high to low range, and runs to the right edge while
the zone is still drawn so you can see where price sits against it now.
Two extras are drawn alongside each block:
Dotted yellow box the imbalance that qualified the block. It covers the three candles it formed on and sits directly ON TOP of a bullish zone or directly BELOW a bearish one, because the gap starts where the block candle ends.
Dashed line the swing level whose break confirmed the block. It runs from the swing itself across to the candle that closed through it, so you can see which high or low was taken and how far the move travelled to take it.
Between them these two say why the block exists: the gap is the imbalance test, the dashed line is the structure test. Both are the Order Block's credentials, so both disappear once the zone flips to a Breaker. By then its Order Block life is over and only the level still matters.
A Breaker's box can begin either at the candle that broke the zone or at the original Order Block
candle. The price levels are identical either way - only the left edge moves. Starting at the
breakout is the default, because a Breaker only becomes a Breaker when it flips, and drawing it
from its birth stretches old ones across the entire chart.
A chart can only stay readable if it is not covered in boxes, so only the most recent few zones
of each kind are drawn. Order Blocks - fresh and mitigated together - have their own limit, and
Breaker Blocks have theirs. Everything older is still tracked and can still turn into a Breaker
later, it is simply not on screen.
The corner table counts everything still being tracked: fresh Order Blocks, mitigated zones and
Breaker Blocks, split into bull and bear. It counts zones whose type is switched off and zones
sitting outside the display limits too, so the table describes the record while the chart shows
the recent part of it. If the table reads higher than what you can see, that is the display limit
doing its job.
Two more optional overlays are available for checking the structure engine directly. Swing labels put HH, HL, LH and LL on the pivots, and the structure break markers name every BOS and CHoCH on the chart rather than only the ones that confirmed a block. Both are off by default.
SETTINGS
Market Structure
- Swing Left and Swing Right: how many candles must confirm a pivot on each side. The default of 5 and 5 reads ordinary swing structure. Lower it to 3 and 3 for minor structure and many more breaks; raise it for major structure only. Swing Right is also the confirmation delay - a swing does not exist until that many candles have closed.
- Show Swing Labels (HH / HL / LH / LL): names each confirmed pivot.
- Show Every Structure Break (BOS / CHoCH): draws and names every break on the chart, not only the ones that confirmed a zone.
Order Block
- Scan Length: how many closed candles back the search for new blocks reaches. The running candle is always excluded. This bounds the search, not the structure engine - swings and the bullish or bearish structure state are read from the whole chart, so a block found right at the edge of the window is still measured against everything that came before it.
- Max Order Blocks Shown: how many of the most recent Order Blocks are drawn. Fresh and mitigated zones share this limit. This is the setting to reach for when the chart feels crowded.
- Max Breaker Blocks Shown: the same limit for Breaker Blocks, counted separately.
- Structure Break Wait: how many candles a block may wait for its structure break, counted from Candle 3 of the imbalance. The zone has to stay clean for the whole wait. If the wait runs out the block is dropped.
Zone Types
- A switch for each of the five things that can be on screen: bullish and bearish Order Blocks,
mitigated zones, and bullish and bearish Breaker Blocks.
- Show Order Block FVG: draws the imbalance that qualified each block.
- Show Confirming Swing: draws the swing level whose break confirmed each block.
Zone Style
- Bullish, bearish, mitigated and imbalance colours, fill transparency, and whether drawn zones
extend right. The imbalance is always filled a little lighter than the zone it belongs to, and
neither the imbalance nor the confirming swing is ever extended - both mark where something
happened, not where price is now.
- Breaker Zone Starts At: whether a Breaker's box begins at the Breakout Candle, where the zone actually flipped, or at the Order Block Candle it grew from. Breakout Candle is the default and keeps old Breakers from stretching across the whole chart. The price levels do not change.
Labels
- Show Labels, Label Size, and Label Distance from Zone as a percentage of the zone height.
Increase the distance on noisy charts so labels clear the candles.
Summary Table
- Show, position and size of the corner table.
ALERTS
Six alert conditions:
Bullish Order Block a bullish block has confirmed its structure break
Bearish Order Block a bearish block has confirmed its structure break
Bullish OB Mitigated price has traded back into a fresh bullish block
Bearish OB Mitigated price has traded back into a fresh bearish block
Bullish Breaker Block a failed bearish block has become a bullish Breaker
Bearish Breaker Block a failed bullish block has become a bearish Breaker
Each message carries the event, the symbol, the timeframe and the closing price. The same
messages are also sent through the alert function, so the "Any alert() function call" alert type
can deliver all six through a single alert.
Every alert is evaluated only after a candle has fully closed.
REPAINTING
This script does not repaint.
- The whole engine runs once per closed candle. Price moving inside an open candle cannot create, change or remove anything, and cannot make a signal appear and then disappear.
- Swings are only usable after their right hand candles have closed. That delay is deliberate: it
is what makes a swing a fact rather than a guess. A swing high therefore appears Swing Right candles after the candle it belongs to, and a structure break can only be measured against a
swing that already existed.
- Zones are built forward, one candle at a time, in the same order they would have been built
live. A zone that has been drawn is never moved. Its colour changes when its state changes, and
that is a record of what price did afterwards, not a revision of what it did before.
- Nothing is read from a higher timeframe, so there is no higher timeframe lookahead to get
wrong.
When you create an alert, TradingView may show a caution banner saying the indicator can repaint. That banner appears automatically for any script that uses the built in bar state variables, no matter how they are used, because the platform cannot check the intent behind them. This script uses one of them for the opposite purpose: it is what restricts the entire engine to bar close. Choosing "Once Per Bar Close" when creating the alert is still recommended.
NOTES AND LIMITATIONS
- The pattern is rare by design. Four conditions have to line up on the same candle, so long
stretches with nothing new on the chart are normal. If you want to see more, look at a faster
timeframe rather than loosening the settings.
- A block that is tapped before its structure break lands is dropped rather than confirmed. This
is strict on purpose: an Order Block that has already been traded back into was not untouched
when it confirmed, whatever happened afterwards.
- Swing Right is a real delay. On a very slow timeframe the confirmation of a swing can take a
meaningful amount of time, and a structure break cannot be recognised before the swing it breaks has been confirmed.
- Scan Length and the display limits do two different jobs. Scan Length decides how far back
blocks are looked for at all, so raising it can find older blocks. The display limits only
decide how many of what was found is drawn; raising them shows more of the same set, lowering them hides zones that are still being tracked. Nothing about how a block is detected or how it resolves depends on whether it happens to be drawn.
- An internal cap of 200 tracked zones keeps memory and the drawing count inside TradingView's limits. On a very long history the oldest tracked zones are dropped, so the table describes the recent record rather than the entire chart.
- Detection is purely structural. It reports where these sequences occurred and what state each
zone is in. It does not rank zones by quality, measure follow through, or produce entries,targets or stops.
HOW TO USE IT
A fresh Order Block marks a price where liquidity was taken, the move away left a gap, nobody has been back, and structure changed. Traders commonly watch these areas for:
- A reaction on the first return, since the zone is untouched until then
- Context from the tag, where a CHoCH block sits at a possible turn and a BOS block sits inside
an existing move
- Confirmation against a higher timeframe read, where a block that agrees with the larger picture carries more weight than one that fights it
A grey mitigated zone is a zone that has already been used once. It is worth less as an entry
area and worth more as a warning: it either holds from here, or it becomes a Breaker.
A Breaker Block is the opposite side of the same level. Traders commonly watch the far edge - the low of a broken bullish block, the high of a broken bearish block - on the first return after the flip.
These are reference areas, not entry signals on their own. Use them alongside your own structure read, your own entry method and proper risk management.
DISCLAIMER
This indicator is a pattern detection tool. It is not financial advice and it makes no claim
about profitability. Trading involves risk. Always apply your own analysis and risk management. Penunjuk

Trendline BreakoutsDraw a trendline by hand and you will always find one that fits. That is the problem, not the skill.
This script does not let you go looking for it. It builds every line from real swing highs, keeps only the ones a later high confirms, and deletes any line that price has already traded through. The same rule runs on every chart, every timeframe, every time you load it.
How a line earns its place
Two swing highs propose a line. A third high has to land on it, inside the tolerance you set. If any bar in between traded through the line, the line never existed. Nothing here is drawn by eye and nothing is fitted after the fact.
The break ⚡, and what came after it
The first bar that trades above the line closes it and gets a triangle. From there the script assumes an entry at the break level and your stop distance below it, then measures the best move that break went on to produce before the stop was lost . The figure is printed next to the break.
What you control
The touch tolerance, how much slack a line may absorb before it is invalidated, how far price must travel to confirm a break, when a quiet old line fades, and your stop. Tighten it for textbook lines. Loosen it and see how much structure survives.
📊 The panel
Lines found, how many are still unbroken right now, the risk you chose, and the average peak gain across the breaks on screen, always next to the number of breaks behind it. An average without its sample size tells you nothing.
⚠️ Read this part too
The peak gain is the best excursion after the break, not a realised return. It assumes you sold at the exact high, which you will not. Everything is recomputed on the bars you can see, so panning and zooming change the picture. This build measures on a linear price scale and reads bullish structure only.
I hope this helps you to finally draw lines properly so you can trade them confidently. Penunjuk

Lows and highs strength indicatorLows and highs strength indicator marks the two levels that matter most to the current market structure — the swing high sitting above price and the swing low sitting beneath it — and then answers the question most level-drawing tools leave open: which one of these two is going to break, and which one is going to hold?
Every level on your chart is not equal. Some are defended and will reject price. Others are simply liquidity waiting to be collected. This indicator labels each of its two levels as either strong (defended — treat it as a barrier) or weak (undefended — treat it as a target), and updates those labels automatically as market structure shifts.
Two lines, two labels, one setting. Works on any market and any timeframe.
THE CORE IDEA
A strong high is a high that price tried to reach and failed to take out. Because it was never breached, the buy-side liquidity resting above it is still sitting there untouched, and the level has proven it can push price away. It behaves like genuine resistance.
A weak high is the opposite. Structure is already trending upward into it, so rather than defending itself it is far more likely to be run through. It is not resistance — it is a magnet. Price is being drawn toward the liquidity above it.
The same logic applies in reverse to lows. A strong low has held and represents real support; a weak low is a downside liquidity target that the market is expected to reach for.
The crucial part is that the two labels are always opposite each other . You will never see a strong high and a strong low at the same time. Market structure can only lean one way:
Strong high above + weak low below → structure is bearish. The high is defended, the low is the target.
Weak high above + strong low below → structure is bullish. The low is defended, the high is the target.
That single pairing tells you the directional bias, where price is being pulled, and where it is likely to be rejected — all from two lines.
HOW TO USE IT WHEN TRADING
1. As a directional bias filter.
Before taking any setup, glance at which side is strong. If the high is strong and the low is weak, the path of least resistance is down. Longs into a strong high are fighting a defended level with an untouched pool of liquidity above it. This alone filters out a large share of low-quality counter-structure entries.
2. As a target.
The weak level is where the market is most likely headed, because that is where the unclaimed liquidity sits. In bearish structure, the weak low is a natural take-profit reference for shorts. In bullish structure, the weak high serves the same purpose for longs. Trading toward the weak side and away from the strong side is the indicator's most direct application.
3. As invalidation and stop placement.
The strong level is the structural line in the sand. If price closes decisively beyond it, the premise of your trade is gone — that break is exactly what flips the bias and relabels both levels. Placing stops beyond the strong level means you are stopped out only when the structure genuinely changes, rather than on ordinary noise.
4. As a reversal zone.
Approaches into a strong level are where rejections tend to occur. Combined with your own entry trigger — an engulfing candle, a lower-timeframe structure shift, a divergence — a strong level gives you a high-quality location to look for a turn, with clearly defined invalidation just beyond it.
5. As a liquidity sweep watch.
Pay attention when price wicks just past a strong level and immediately closes back inside. That is often a stop run rather than a real break: the level collected the liquidity above (or below) it and rejected. This indicator deliberately ignores wicks — only a decisive close through the level counts as a structural break.
Example read. On the Bitcoin daily chart, structure is bearish: the indicator shows a strong high at 82,791 and a weak low at 56,018. You know three things immediately: the bias is down, the weak low is the level price is reaching for, and the strong high is where the bearish premise would be proven wrong. A short taken on a rally into the strong high has its target, its invalidation, and its directional logic all defined by two lines.
Hover either label for a full plain-language explanation of why that level currently reads strong or weak, and exactly what would flip it to the other state.
HOW IT WORKS
The indicator runs a four-stage pipeline on every bar.
1. Swing detection.
A swing high is confirmed when a bar's high has Swing length bars with lower highs on both sides of it; a swing low is the mirror image. This symmetric test means a swing point is only recognised once enough bars have passed to prove it genuinely was the extreme — no forward-looking data is used.
2. Level anchoring.
When a new swing point is confirmed, it becomes the active swing high or swing low, and the corresponding line re-anchors to it.
3. Trailing extremes.
Between swing points, each line ratchets outward with price — the upper line tracks the highest high of the current swing, the lower line the lowest low. This keeps both levels pinned to the true extremes of the live swing rather than to a stale historical price.
4. Break of structure.
When a candle closes beyond the active swing high, structure flips bullish; a close beyond the swing low flips it bearish. This bias drives the strong/weak labelling. Each swing level is consumed the moment it breaks, so a single level can only flip the bias once. And because the test is a plain closing test rather than a crossing test, the rare case where a swing point is confirmed while price already trades beyond it is registered immediately instead of being missed.
Closes are used rather than wicks deliberately — a wick through a level is a liquidity sweep, not a structural break, and treating the two the same is what causes most false structure signals.
No repainting. Every calculation uses confirmed historical data with no lookahead. The lines extend in real time as the current candle makes new extremes, which is expected live behaviour, but past structure is never rewritten.
SETTINGS
Swing length (default 50) — how many bars are required on each side of a candidate swing point before it is confirmed. This is the one setting that meaningfully changes the indicator's character:
Lower (10–25) — faster, more reactive levels that track shorter swings. Suited to intraday and scalping, at the cost of more frequent bias flips.
Default (50) — balanced structural levels. A solid starting point on most markets and timeframes.
Higher (75–150) — only major structural turning points register. Suited to swing and position trading, where you want the levels to stay put.
High color and Low color — the two line and label colours, red and green by default.
THINGS TO BE AWARE OF
The levels lag, by design. A swing point cannot be confirmed until enough bars have passed to prove nothing exceeded it. That delay is what makes the level trustworthy rather than a guess, but it does mean this is a tool for structural context and bias, not for precise entry timing. Pair it with your own entry trigger.
On very short chart histories both levels may read weak. Until the first break of structure occurs there is no bias to judge them against, and the labels default to weak. Hovering a label will tell you when this is the case. It resolves as soon as the first structural break happens.
It is a context tool, not a complete system. It tells you which direction structure favours and where the liquidity sits. It does not tell you when to click the button. Use it to frame your bias, choose your targets, and place your invalidation — then let your own entry method handle the timing.
Penunjuk

Inside Bar [scriptedge]Overview
Inside Bar looks for a higher timeframe candle that trades entirely within the range of the one before it. Throughout this description the larger candle is called the mother candle , the contained one is the inside bar , and the one that follows is the trading candle .
The indicator is designed so that the whole setup can be visualised from the lower timeframe you intend to trade. The higher timeframe is read in the background and its structure is drawn onto your chart, so there is no need to switch timeframes to see where the range sits or how the trading candle is developing.
The tool draws structure and context. It does not generate buy or sell signals, and it does not manage entries, exits, stops, or position size. Those decisions are left to the trader.
The Higher Timeframe Pattern
An inside bar is a two candle pattern. The second candle's high is at or below the first candle's high, and its low is at or above the first candle's low — the whole candle sits within the range of the one before it. That is compression. Range has contracted, and unlike most patterns it carries no direction of its own. Both boundaries of the mother candle are live, and the market decides which one matters.
What Gets Drawn
Once the inside bar closes, the mother candle's high and low are drawn as solid lines. These are the levels a break has to clear, and they are what almost every published treatment of this pattern uses for entries and stops.
A shaded box spans the compression itself: from the mother candle through every inside bar, ending where the trading candle opens. The box shows the coil, the lines carry the levels forward through the trading candle.
Two target lines are projected at one times the mother candle's range, one above the high and one below the low. This is the measured move, the conventional objective for a range break. They are drawn from the trading candle's open, since that is when a target first becomes relevant. Every line stops when price trades through it, or when the trading candle ends, whichever comes first.
Nested Inside Bars
Inside bars often arrive in runs. When the trading candle turns out to be another inside bar — still entirely within the mother's range — the coil has not resolved, so nothing is reset. The mother candle's levels stay exactly where they are, the box extends, and the next candle takes over as the trading candle. A label on the box counts the inside bars whenever there is more than one, so a deep coil is visible at a glance.
Higher Timeframe Panel
The mother candle, every inside bar and the trading candle are redrawn to the right of the live chart, with the mother's levels marked across them. The trading candle updates live. On a long coil the mother candle is often well off the left of your screen. The panel is what lets you see the whole pattern without scrolling or switching timeframes.
Stats Dashboard
The table counts how past breaks on the selected higher timeframe resolved. A break is recorded the moment price trades outside the mother candle's range during the trading candle.
Breakout — after breaking, price reached the target before reaching the opposite boundary.
Failed breakout — after breaking, price reached the opposite boundary first.
Those two levels sit exactly one mother range either side of the break, so this is a symmetrical test rather than an arbitrary pairing.
A trading candle can break both boundaries, in which case both breaks are counted separately with their own outcomes. Breaks that have not yet resolved are excluded until they do, and setups still coiling are not counted at all, so the two percentages always sum to one hundred.
There is deliberately no win rate here. A failed breakout is a losing outcome to one trader and the entire premise to another, and it is not the indicator's place to decide which.
Please read this table for what it is. It is a count of what price did on the bars loaded in your chart. It is not a backtest and not a strategy report. No entry price, exit price, stop, commission, or slippage is assumed, because the indicator does not place trades. Past behaviour of a market does not indicate future behaviour.
Settings
Chart Theme — light or dark colour palette.
Stats Dashboard — show or hide the table.
Higher Timeframe — 15m, 1h, 4h, D, W or M.
HTF Candle Separators — vertical line at each higher timeframe open.
Show Target Lines — the measured move projections.
Alerts
An alert fires the first time price trades outside the mother candle's range in each direction, with a message naming the timeframe and the side, for example 1h inside bar broken up . A trading candle that breaks both boundaries produces two alerts. To use them, create an alert on the indicator and choose Any alert() function call as the condition.
Repainting
Historical bars are never restated. Specifically:
Higher timeframe candles are built by aggregating completed chart bars, so the pattern is only known once the inside bar has closed. request.security() with lookahead is not used anywhere in the script.
Levels come from candles that have already closed. Nothing is drawn at a price that could still change.
A break occurs once price trades through a level, which cannot be undone within a bar — once price has traded outside the range it has traded outside the range.
The box and the lines extend to the right as the trading candle progresses. That is a drawing being lengthened, not a value being changed.
Limitations
The mother candle defines the levels . Some traders use the inside bar's own high and low instead, for a tighter trigger and smaller risk. This tool does not draw those.
A break is any trade outside the range, wick or close . A candle that pokes through and closes back inside counts as a break. If you think of a break as requiring a close, the counts here will run higher than you expect.
On the higher timeframe itself , target lines, the inside bar count and the stats table are not shown. There the trading candle is a single bar, which cannot say whether a break or its outcome came first. The pattern, its levels and the box are still drawn.
Above the higher timeframe , nothing is drawn. Select a chart timeframe lower than the higher timeframe setting.
The panel is capped at twelve candles . A coil deeper than that still tracks correctly, but the panel shows the mother candle and the most recent inside bars rather than all of them.
Drawing objects are capped by the platform . On very long histories the oldest drawings will drop off the chart.
The stats table depends on how much history your plan loads , so the counts will differ between account types on the same instrument.
This is an indicator, not a strategy . It offers no entries, exits, stop levels, position sizing, or risk management, and makes no claim about profitability.
Disclaimer
This script is for informational and educational purposes only. It is not financial advice and not a recommendation to buy or sell anything. Trading involves substantial risk of loss. Test any tool thoroughly and make your own decisions. Penunjuk

Penunjuk

Custom Key LevelsCustom Key Levels
Simple tool for plotting your own price levels — support/resistance, liquidity zones, order blocks, whatever you're tracking. Set up to 10 levels, name them yourself, get alerted when price hits them. No auto-detection, no fancy calculations — just your levels, on your chart, the way you want them to look.
What it does
10 level slots, each with its own on/off switch, name, price, and color
Pick short tags near the current price or full lines across the whole chart
Solid/dashed/dotted, adjust width and label size
Turn labels off if you just want clean lines with no text
Crossing alerts built in — get pinged when price crosses a level, and the alert message tells you which one
Penunjuk

CRT TCTCRT TCT — Market Structure & Liquidity Toolkit
CRT TCT is a complete price action and market structure indicator designed to help traders identify key liquidity areas, structural shifts, session ranges, and potential liquidity sweeps directly on the chart.
The indicator combines multiple concepts into one clean and customizable trading toolkit, allowing traders to analyze market structure and liquidity without overcrowding their charts.
Key Features
• BOS & CHoCH Detection
Automatically identifies Break of Structure (BOS) and Change of Character (CHoCH) to help visualize bullish and bearish market structure.
• Liquidity Levels
Automatically detects and tracks relevant swing highs and swing lows as potential liquidity areas. Levels remain visible until price trades through them.
• Liquidity Sweeps
Identifies potential bullish and bearish liquidity sweeps where price takes a previous high or low and rejects the level.
• Multi-Timeframe Key Levels
Displays important previous highs and lows from:
H4
Daily
8:00 AM New York H1
9:00 AM New York H1
• Trading Sessions / Kill Zones
Visualizes the main institutional trading sessions:
Asian Session
London Session
New York Session
Session highs and lows can also be extended forward as potential liquidity targets until they are reached.
• Custom Market Structure Timeframe
BOS and CHoCH analysis can use the current chart timeframe or a fixed timeframe such as 5m, 15m, 30m, 1H, 4H, or Daily.
• Market Structure Dashboard
A compact dashboard provides a quick overview of:
Current structural bias
Selected structure timeframe
Active liquidity above price
Active liquidity below price
• Fully Customizable
Traders can independently enable or disable market structure, liquidity, sweeps, higher-timeframe levels, sessions, and other visual elements.
How It Can Be Used
CRT TCT is designed as a confluence and market-reading tool rather than a standalone buy/sell signal system.
It can help traders identify:
Where liquidity may be resting
When liquidity has been swept
Changes in market structure
Continuation through BOS
Important higher-timeframe levels
Session highs and lows
Potential areas of interest during key trading sessions
The indicator can be used across different markets and timeframes depending on the trader's methodology.
Important: This indicator is intended for educational and analytical purposes only. It does not provide financial advice or guarantee profitable trades. Always use proper risk management and combine the information provided by the indicator with your own trading plan and analysis. Penunjuk

Dynamic Range Tool [vault]Dynamic Range Tool is a complete session range framework. Instead of stacking five separate tools every morning you get one: the session range with its quarters and projections, average range targets from the daily, weekly and monthly timeframes, daily and weekly opens, center mass of the previous daily and weekly candle, and automatic order blocks. One script, one chart, alerts on every level.
THE SESSION RANGE
The engine is a time window defined in EST. The default is 19:00 to 02:45, which is the asian session plus the london open lead in. The script tracks the highest high and lowest low inside that window and builds three lines from it: range high, range low, range mid. Those lines are then extended to whatever hour you set in "Extend To Hour", 19:00 the next evening by default, so the levels sit in front of you for the entire trading day.
On top of that you get the range quarters at 25% and 75%, drawn dashed in the theme accent color. Those are the levels price tends to react to on the way back into the middle.
Two vertical markers show the range gate and the moment the window closes, so you never lose track of where the measurement ends.
RANGE PROJECTIONS
Turn on "Show Range Projection" and you get the range mirrored above and below the midpoint at 1x, 1.5x, 2x and 2.5x. Classic range expansion logic. If the asian session printed 40 points you already know where 1x and 2x sit before london even starts. Upper levels use the theme top color, lower levels the bottom color.
ADR / AWR / AMR TARGETS
This is the part that does the heavy lifting. The script computes an average candle range (14 periods by default) separately on the daily, weekly, monthly and a custom intraday timeframe (60 or 240 minutes), then projects:
- Daily projected high = day low + ADR
- Daily projected low = day high - ADR
- The same for the week and the month, with progressively thicker lines
- The same for your custom timeframe
- Top hash and bottom hash, the range midpoint plus and minus half an ADR
- A second pair at the midpoint plus and minus a full ADR
Every level is labelled on the right and fires its own alert. Once the day has already delivered its average range the projected high and low cross over each other, and the script deletes both lines and their labels automatically so you are not left staring at levels that no longer mean anything.
Underneath, semi transparent zones are shaded between the range midpoint and the ADR projection. They show how much room is left before the average day is fully used up.
OPENS AND CENTER MASS
- Daily open and weekly open, colored dynamically: bottom color when price trades above the open, top color when below. One glance tells you which side of the open you are on.
- Center mass daily and weekly, the midpoint of the previous daily and weekly candle body. Thick neutral line, one of the better mean reversion magnets on intraday charts.
ORDER BLOCKS
A separate module. The script measures momentum as the percentage change of open against the open four bars back. When that change crosses the sensitivity threshold (25 by default, meaning 0.25%) it walks back 4 to 15 bars, finds the last candle opposite to the impulse, and turns it into a block. Mitigation is your choice of wick or close. Blocks are removed automatically once mitigated, and price entering an active block triggers an alert.
A minimum spacing of 5 bars between signals keeps the chart clean in chop.
STATS PANEL
Top right corner: last session range, ADR, AWR and the custom range value. Displayed in pips or in ticks depending on the toggle.
THEMES
The build ships with a full theme engine:
- Vault Red (default) - red upside, blue downside, white structure
- Vault Classic - the original orange and blue palette
- Ice - cold blues
- Neon - magenta and green
- Gold - gold and purple
- Mono - white and greys for dark charts
- Custom - unlocks every manual color picker
Switching a theme repaints the range lines, targets, zones, labels, order blocks and panel text in one move. The range center line is white now instead of black, so it is finally visible on a dark chart.
ALERTS
Weekly, monthly, daily and custom projected high and low, top hash, bottom hash, price inside bullish block, price inside bearish block. All fire once per bar.
HOW TO USE IT
1. Intraday chart. Minute based timeframes are read directly from the chart resolution.
2. Set the session window in EST for your market. For index futures leave it at 19:00 to 02:45.
3. Start the day with three questions: which side of the range am i on, which side of the daily open am i on, how much of the average range is still unused.
4. Treat the upper and lower ADR targets as places to take risk off, not places to enter.
5. The range mid and the center mass lines are return levels, not continuation levels.
TECHNICAL NOTES
Higher timeframe data (daily, weekly, monthly, custom) is requested with lookahead enabled. That keeps the levels anchored on historical bars, but it also means this script is not suitable for bar by bar backtesting or for driving an automated strategy. It is a context drawing tool, not a simulation.
All drawing is anchored to bar time rather than bar index, so levels stay locked to the clock.
The "ADR Days" input is a leftover from the original and does not affect any calculation. The averaging length lives in "ADR period".
Nothing here is financial advice. The tool draws context, the decisions are yours.
Based on Dynamic Range Tool V1 by Black Box Trading. Penunjuk

Market Profile TPO [vault]TPO is a market profile tool that shows where the market actually spent its time, not just where price printed a candle. It builds a time price opportunity profile for every day, week or month and marks the levels that keep mattering after the period closes.
How it works
The script splits each period's range into a configurable number of rows and counts how many bars traded inside every row. That count is the TPO score. The widest row is the Point of Control, the fairest price of the period and the level price keeps rotating back to. Around it the script expands the Value Area using the standard two row algorithm until it holds a chosen percentage of total TPO count, giving you the accepted range and its two edges.
Everything is calculated in a single pass over the period's bars instead of scanning every row separately, so the developing profile updates in real time without dragging the chart down, even on 100 rows and low timeframes.
Green area below, red above, no. This is not a signal tool. Value area high and low are the edges of accepted price, and trades that open outside value and reject back inside tend to rotate to the opposite edge. The POC is a magnet. Untouched POCs from previous periods are stronger magnets.
What it draws
- Full TPO profile per period, D, W or M, with adjustable row size and profile width
- Point of Control line, ties resolved toward the middle of the range so the POC never sticks to an extreme
- Value Area high and low with optional shaded background
- Initial Balance, the range of the first balance window of the session, with optional extension across the whole period
- Single prints, the thin one row areas left by one sided moves, top and bottom tails excluded by design
- Naked POC, previous POCs price never traded back into, extended right until they get hit and then removed automatically
Reading it
Value area edges are where acceptance starts and ends. Initial Balance tells you the shape of the day early: price holding inside IB all session is a rotation day, a break of IB high or low with follow through is the classic trend day tell. Single prints mark unfinished auction, the market moved too fast to trade there and usually comes back. A naked POC sitting above or below current price is an obvious target for the next rotation.
Additional settings
- Profile period: D for day trading, W or M for swing context
- Row size: higher for precision, lower for speed on long periods
- Value Area %: 70 is standard, some traders use 68 or 80
- IB session and timezone: defaults to 0930 to 1030 New York, the RTH open hour for US index futures. Set it to your own instrument's open
- Profiles kept on chart: old profiles are deleted as a whole group, so the script never hits TradingView drawing limits and never leaves half a profile behind
- Min rows per single print: filters out one row noise, 2 or 3 keeps only meaningful gaps
- Show developing profile: toggle the live, still forming profile
- Level labels with prices for POC, VAH and VAL
- Full color, width and line style control for every element
- Built-in alerts for prior POC, VAH and VAL crosses and for IB high and low breaks
- Works on any instrument, requires a chart timeframe lower than the profile period
Penunjuk

KERNEL BANDS [vault]KERNEL BANDS
A non-parametric kernel regression centreline wrapped in adaptive residual sigma bands, with a full trade management layer on top: filtered entries, an exit engine that reports results in pips, a reversal radar, a dead-zone shield, session and momentum context, and a multi-timeframe screener. Everything is confirmed on bar close and nothing repaints.
A moving average assumes price came from a fixed-form equation (linear in lag, weighted in lag, and so on). Kernel regression makes no such assumption. It lets the local density of the data decide where the centreline sits, which gives a smoother and more honest picture of where price actually is, without the corner cutting EMAs and HMAs do around pivots. The bands around it are not arbitrary ATR multiples but a statistical measure of how far price normally strays from the kernel before reverting.
1. The kernel
Every moving average is a kernel, just a rectangular one (or, for HMA, a chained weighted one). Kernel regression generalises the idea: you pick the shape of the weight curve based on how much you want each historical bar to matter. Three kernels ship:
- Gaussian: the textbook bell curve, K(u) = exp(-u² / 2h²). Heavy tails, smooth everywhere. The most stable default.
- Epanechnikov: compact-support parabola, K(u) = max(0, 1 - u²/h²). Mathematically optimal in the mean-squared-error sense, lightest tails, slightly more responsive at the leading edge.
- Tricube: LOWESS-style, K(u) = max(0, (1 - |u/h|³)³). Very smooth shoulders, great on noisy intraday data where you want a confident centreline rather than a chasing one.
All three feed the same Nadaraya-Watson estimator, ŷ = Σ K(i) · close / Σ K(i), computed one-sided over the lookback window so it never looks into the future. The kernel choice sets the personality of the line, the bandwidth h sets its memory.
2. Adaptive bandwidth (ATR-scaled)
A static bandwidth breaks in changing regimes. When realised volatility expands a fixed h lags badly, when it contracts the same h starts amplifying noise. Here h is scaled live by normalised ATR:
h_eff = h_base × (1 + ATR / close × factor)
so the kernel widens when the market is loud and tightens when it is quiet, and the line behaves the same across gold, indices, crypto and FX without per-symbol tuning.
A Bandwidth Regime Shift alert fires when h moves by more than a user-set fraction in a single bar. It is your early warning that the volatility surface just changed: it typically fires before either directional signal and tells you whatever play you had on a minute ago may need to be re-evaluated. The dashboard shows the % jump that triggered it.
3. Residual sigma bands
The bands are the rolling standard deviation of the residual (close - kernel MA), EMA-smoothed, then scaled by the sigma multiplier. This answers a real question: how much do we usually deviate from the kernel before reverting? When the answer is small, the bands hug the line and a breakout is statistically meaningful. When it is large, band breaks are normal and should be downweighted.
Band Floor is an addition to the original concept. The half-width can never be thinner than a chosen fraction of ATR (0.6 by default). Without it, volatility compressions produced razor-thin bands and hair-trigger state flips on every wick. With it, a quiet market still needs a real move to change state.
4. State engine
A confirmed close above the upper band latches the state to Bullish, a confirmed close below the lower band latches it to Bearish. State only flips on the opposite band, there is no neutral repainting in between. Confirmation Closes sets how many consecutive closes beyond the band are required (default 2), which is the single biggest difference between a clean chart and a noisy one.
The band colour, the fill, the dashboard Signal row and the MTF screener all read from this one state.
5. Signal engine (what changed versus a plain band cross)
A state flip is not an entry any more. A flip arms the signal, and the entry prints only once every condition lines up within the entry wait window (default 6 bars). If the state reverts before that happens, the armed signal is dropped silently and nothing is printed. The dashboard shows the armed side in gold so you always know a setup is pending.
Conditions an entry must pass:
- Kernel slope must agree: buy only while the kernel is rising, sell only while it is falling. This kills counter-trend spikes, the classic "one violent wick through the lower band in an uptrend" trap.
- Entry candle must agree: a buy needs a green close, a sell needs a red close.
- Max extension beyond band: if the flip candle closed too far past the band (default 1.5× the band half-width) the engine waits for a calmer candle instead of chasing the blow-off.
- Skip blow-off candles: no entry on a bar (or the bar before it) whose range exceeds a multiple of ATR.
- Min bars between entries: a cooldown so two entries cannot stack on top of each other.
- Dead-zone shield: no entries while the market is flagged as chop (section 7).
- Session filter (optional, off by default): restrict entries to London / New York windows if you want it.
Re-entries: after an exit, if the state is unchanged and price crosses back through the kernel MA in the direction of momentum, a fresh entry arms. Trends are ridden in segments, each one banked.
Entry labels carry the side and the exact close price so you can enter at the same level.
6. Exit engine
Every entry is closed by the indicator with an Exit label in the colour of the side it closes (cyan closes a long, magenta closes a short). The label shows the exit price and the result in pips. Pip size is auto-detected (mintick × 10, so 0.1 on gold) and can be overridden.
An exit fires on whichever comes first:
- Flip: the state confirms the opposite way.
- Reversal: a reversal candle prints at a band extension while the trade is in profit.
- Giveback: after the trade has reached a minimum peak, it has given back a set percentage of that peak (default 50%).
- Structure: close breaks the lowest low (long) or highest high (short) of the last N bars while in profit.
The dashboard shows live Position, Open P&L and peak P&L, and the exit alert reports entry, exit, result, peak, trigger and bars held. Your journal writes itself.
7. Dead-zone shield
Flat, low-volume chop is where band systems buy the top and sell the bottom of the range. The shield scores four conditions every bar: flat kernel slope, clustered state flips (weighted double, because a burst of flips is the strongest chop tell there is), tight range and weak volume. Above the trigger score the chart is tinted, entries are suppressed and the dashboard reads DEAD ZONE with the bar count. The first genuine breakout escaping the zone still arms an entry.
Two alerts, deliberately not session-filtered: Dead Zone Entered (with the score and which conditions tripped it) and Dead Zone Cleared (with how long it lasted). The second one is the one to set: it tells you when to be back at the screen.
8. Reversal radar
Reversal candles (doji, pin bar, engulfing) that print at a band extension are marked with a ⚠ Rev label: red at the upper band, cyan at the lower. The dashboard tracks the most recent one as TOP FORMING / BOTTOM FORMING with its age. Kernel momentum is read live as Rising, Rising & Fading, Falling or Falling & Fading, with directional alerts when it turns. Together they are your early tell that a move is exhausting, and the Reversal exit uses the same signal.
9. Divergence engine
A pure slope-comparison divergence runs in parallel: the kernel slope over a window against the price slope over the same window. Bullish divergence is registered when price is falling while the kernel turns up, bearish is the mirror. Both slopes have separate minimum thresholds (as a fraction of ATR × window) so flat regions never trigger noise divergences, and a cooldown spaces them out. Labels print ▲ Div / ▼ Div at the wick they fire from, and the dashboard shows the active divergence with its bar age.
10. MTF screener
A compact board that shows the kernel state on 5m / 15m / 1h / 4h. The top row is pinned to whatever symbol your chart is on and follows you when you switch, so your active trade is always on the board. Up to five more symbols can be added in settings. Each cell is an arrow in the state colour, brighter when the flip is fresh (within a user-set number of bars) so you can tell at a glance whether a setup is new or already ran. The Σ column counts aligned timeframes and prints A+▲ or A+▼ when all four agree.
The screener requests nothing on your behalf: only symbols you type in are ever requested, so alerts save on every data plan.
11. Three visual modes
The same kernel and sigma feed every mode:
- Bands: classic upper / lower envelope with toggleable fill. Best for mean-reversion and band-touch analysis.
- Single Line: kernel centreline with a gradient fill between the line and price. Best for pure trend-following.
- Trail: only the trailing band is drawn, in the active state colour, with an optional sin-modulated pulse alpha that gives a subtle breathing effect. Best for visual conviction in directional moves.
State candles and bar colouring are independent toggles, and the kernel line can be drawn on top of Bands or Trail if you want it visible everywhere. A full Colors group covers bull, bear, neutral, text, accent and dashboard background / frame.
12. Dashboard
A monospaced table, positionable to any of nine anchors, with a subtle vertical gradient. Rows: Signal, Kernel MA, Upper Band, Lower Band, Band Width σ, Bandwidth h (with adaptive tag), Kernel, Divergence, Regime, Session, Position (including armed setups), Open P&L with peak, Market (Trending / Dead Zone), Momentum and Reversal.
13. Alerts
Seventeen named alert conditions, every one evaluated on bar close: BUY, SELL, EXIT LONG, EXIT SHORT, Bullish Breakout, Bearish Breakdown, Bullish Divergence, Bearish Divergence, Bandwidth Regime Shift, Reversal at Top, Reversal at Bottom, Dead Zone Entered, Dead Zone Cleared, Momentum Shift Bullish, Momentum Shift Bearish, Momentum Shift (any), Kernel State Flip.
On top of that the script sends dynamic messages through alert(): entries carry entry price, TP / SL geometry, live momentum and session, exits carry entry, exit, result in pips, peak, trigger and bars held, dead-zone events carry the score and the reason. Attach a webhook to "Any alert() function call" and a bot reading the payload has the same confluence a human reads on the dashboard.
Each named condition has to be selected individually in the alert dialog. "Any alert() function call" delivers the dynamic messages, not the named conditions. That is a TradingView rule, not a setting in this indicator.
How to use it
Trend-following: Single Line or Trail mode, Tricube kernel, adaptive bandwidth on, Confirmation Closes 2, kernel slope confirmation on. Take entries in the direction of the higher-timeframe rows on the screener and let the exit engine manage the trade.
Mean-reversion: Bands mode, Gaussian or Epanechnikov, fade band touches that coincide with a ⚠ Rev label, a divergence label and a low Band Width σ reading. Use the Regime Shift alert as a heads-up that a reversion play just got riskier.
Scalping 1m-5m: keep Band Floor at 0.6 or above and Confirmation Closes at 2, otherwise the band flips on every wick. If you get too few entries, loosen Entry Candle Must Agree first, then Max Extension to 2.0.
Suggested settings
Defaults are tuned for 5m-1H on liquid futures, gold and crypto: Lookback 30, Base Bandwidth 8, Sigma Multiplier 1.0, Band Floor 0.6, Confirmation Closes 2. For 1m-3m drop Lookback to ~20 and Bandwidth to ~6. For daily and above raise Lookback to 50 and Bandwidth to 12. The kernel and bandwidth jointly control how much the line trusts the recent past, the sigma multiplier and band floor separately control how much movement you are willing to call normal.
Limitations
The kernel is recomputed each bar over the lookback window, so very long lookbacks on very low timeframes can feel heavy. State transitions, entries, exits and reversal labels are all confirmed on bar close, so a band touch that gets reabsorbed within the bar will not fire. This is deliberate and is what prevents intra-bar repainting. The MTF screener reads higher-timeframe values that in real time come from the still-open bar, so a cell can flicker until that bar closes. Divergence is non-repainting but carries the natural lag of comparing slopes over a window.
What was improved over the original concept and why
- Band floor: the original residual sigma alone produced paper-thin bands in compressions and a flip on every wick. A floor tied to ATR fixed that without touching the statistical meaning of the band in normal conditions.
- Confirmation closes: one close beyond the band is a wick, two is a decision.
- Arm-then-fire entries: entries were firing on the flip bar no matter what that bar looked like. Now the flip arms the setup and the entry waits (up to a few bars) for kernel slope, candle colour and extension to agree, and is dropped if the state reverts.
- Kernel slope agreement: the single biggest source of bad trades was a sell printed during a spike down while the kernel was still rising. Requiring slope agreement removes the whole class.
- Blow-off check on two bars: a spike often spans the flip bar and the one before it.
- Dead-zone weighting: a cluster of flips is the strongest chop signal there is, so it counts double and the shield activates on a burst of flips alone instead of needing a second condition.
- Session filter off by default: gold and indices produce clean moves outside London / NY too, and the filter was skipping them. It is still there if you want it.
- Kernel MA plotted in every mode and alertable via the standard Crossing / Greater Than rules, plus a toggle to draw it on top of Bands or Trail.
- Screener requests only what you type in, so alerts save on any data plan.
Penunjuk

HTF Candle Projection Dashboard [Quantum Edge]HTF Candle Projection Dashboard projects multiple higher-timeframe candle structures directly onto your active chart.
Instead of switching between timeframes, the indicator displays the latest six candles from five configurable higher timeframes in a clean, forward-projected dashboard:
• 1 Hour
• 4 Hour
• Daily
• Weekly
• Monthly
Each timeframe group contains five historical candles plus the current developing candle. The live candle updates as new price data becomes available, allowing traders to monitor higher-timeframe range, direction, and key OHLC levels while executing from a lower timeframe.
FEATURES
• Displays five independently configurable higher timeframes
• Shows six candles per timeframe: five completed candles and one live candle
• Projects all higher-timeframe candle groups to the right of current price action
• Uses true chart prices—no normalized or synthetic price scale
• Bullish and bearish candle coloring
• Adjustable live and historical candle transparency
• Optional timeframe headers
• Optional Open, High, Low, and Close labels for each live HTF candle
• Adjustable right offset, candle width, candle spacing, and group spacing
• Designed for clean multi-timeframe context on intraday execution charts
HOW TO USE
1. Apply the indicator to a lower-timeframe chart.
2. Choose the higher timeframes you want to track in the settings.
3. Use the projected candle groups to identify higher-timeframe direction, current range position, prior highs/lows, and developing candle behavior.
4. Combine the dashboard with your preferred market-structure, support/resistance, volume, or execution model.
EXAMPLE WORKFLOW
A trader using a 1-minute or 5-minute chart can keep the 1H, 4H, Daily, Weekly, and Monthly candles visible at once. This makes it easier to see whether a lower-timeframe move is occurring near a higher-timeframe high, low, open, or close—without leaving the execution chart.
NOTES
• The rightmost candle in each group is the currently developing higher-timeframe candle, so its high, low, close, color, and OHLC labels can change until that timeframe closes.
• For the clearest results, use the script on a chart timeframe lower than the smallest selected dashboard timeframe.
• This is a visual analysis tool, not a trading strategy and not financial advice.
Created by Quantum Edge. Penunjuk

ICT Equal Highs & Lows (EQH/EQL) Liquidity PoolsICT Equal Highs & Lows (EQH/EQL) Liquidity Pools
What it does
This indicator marks the horizontal shelves that form when two or more confirmed swing highs, or swing lows, come to rest at almost the same price. Those shelves are where resting orders accumulate, and the script answers one question about each of them: is this shelf still untouched, has price wicked through it, or has price closed beyond it? Lines are drawn only where the swing anchors themselves are visible on the chart, so you can always see why a line sits where it sits.
How it works
Every swing point starts an invisible hypothesis: a shelf at that price, with a tolerance band around it. The hypothesis has to survive. If price leaves the band before a second qualifying swing arrives, the hypothesis is dead and a later similar price cannot bring it back. Only a hypothesis that survives long enough to collect the required number of swings becomes a visible pool.
Swing points are confirmed pivots, found from wicks or from candle bodies. A takeout is always measured on the wick, whichever mode you pick: price trading through the shelf is what takes it, however the swings themselves were found.
The tolerance is frozen with the volatility of the swing that started the shelf. A later change in volatility can never pair two old swings after the fact.
When a shelf is confirmed, every bar since its first anchor is replayed against it, oldest first. The first bar that went past its boundary decides both what happened and when, so a shelf that was already taken never appears as untouched.
Once a pool becomes visible, its level and its boundary are fixed. Further swings at the same price raise the counter on the label and nothing else.
The visible line sits on the extreme of the price group that confirmed it - the highest of the equal highs, the lowest of the equal lows, or the outermost body edge if you switched the swing source to Bodies - so it lies on a price that was actually traded and touches the structure it names. The boundary that decides a takeout sits past the outermost wick of that group, plus a buffer - a poke inside the band the shelf was defined with is noise rather than a takeout. That wick is first capped at the edge of the tolerance band, so a single oversized wick on the first swing cannot lift the boundary off the chart. Measuring the boundary from wicks matters under Bodies: a level is a body edge there, and the same bar's wick reaches past it, so a shelf would otherwise be taken by the very bar that confirmed it.
A wick beyond the boundary marks the pool as swept. A close beyond it marks the pool as broken.
How to use it
Add the script to a chart. It works on any symbol and any timeframe and reads only the bars of the chart you are on.
With the default line style, read the solid lines as untouched shelves and the dashed ones as shelves price has already taken. Pick another style and the untouched ones follow it; a shelf that has been taken always draws dashed. Switch on Highlight nearest untapped pools if you also want the closest untouched shelf on each side drawn one step thicker.
Check the anchors. Every line should start at a swing you can point at, and the price of that swing should sit within the tolerance you configured.
If the chart shows more lines than you can read, lower the tolerance or raise the minimum number of equal highs and lows before touching the retention cap.
Inputs
Swing length - bars required on each side of a swing point. Larger values give fewer and more significant shelves. Range 1-50, default 5.
Measure swings from - Wicks uses the high and low, Bodies uses the open and close and ignores single long wicks.
History searched - how long an unconfirmed hypothesis may wait for its second swing, and how far back a newly confirmed shelf is checked. Range 50-500, default 500.
Tolerance unit - ATR multiple, ticks, or percent of price.
Tolerance - how far apart two swings may sit and still count as equal. Default 0.10, which on a volatile index future works out around ten ticks.
ATR length - length of the volatility measure, used by the ATR mode only. Range 1-200, default 14.
Minimum equal highs/lows per pool - swings needed before a shelf becomes visible. Range 2-10, default 2.
Takeout buffer - distance beyond the edge of the shelf that price must exceed before the pool counts as taken, in units of the frozen tolerance. Range 0-3, default 0.25, which is small enough that a stop run of a few ticks registers.
Display group - show or hide each side, keep or drop swept and broken pools, retention cap per side, line width, line transparency, line style, labels and label size. Broken pools are dropped by default, so switch that on if you want all three states on the chart.
Show EQH/EQL text and Show number of equal highs/lows - the label reads EQH 3x with both on, which is the default. Either can be switched off on its own.
Line style - solid, dashed or dotted for the intact shelves. A shelf that has been taken always draws dashed, because that is its state and not a preference.
Label background - off by default, so only the label text shows. Turn it on where a label sits over the candles and the bare text is hard to read.
Highlight nearest untapped pools - draws the nearest untouched shelf on each side one step thicker. Off by default: a line that is thicker for a reason the chart does not explain is harder to read, not easier.
Colors group - one colour each for buyside, sellside, swept and broken pools.
Signals and alerts
Buyside pool formed and Sellside pool formed - fire when a shelf becomes visible and is still untouched.
Buyside pool swept and Sellside pool swept - fire when a wick crosses the boundary and the bar closes back inside.
Buyside pool broken and Sellside pool broken - fire when a bar closes beyond the boundary.
All six fire on the close of the bar that produced the change. A shelf that the replay finds already taken raises no formation alert, because it was never visible as untouched.
Repainting
State changes only on a closed bar. On the live bar no shelf is added, removed or reclassified, so what you see on history is what you would have seen in real time. One thing does follow the live bar, and it rewrites nothing: the right edge of an untouched line. A second follows it only if you switch on Highlight nearest untapped pools - which line is marked as the nearest one ahead of price. Swing points are confirmed pivots and are therefore known a fixed number of bars after they happened; the script does not pretend otherwise, and it replays every bar since the shelf's first anchor, so a shelf cannot appear untouched at a price that was already traded through. Once a pool is visible its level and boundary are never rewritten.
Limitations
The very first swing of a shelf is the one bar never replayed against the shelf itself - it cannot be, or under Bodies a long wick on that bar would invalidate its own shelf before it exists. Under Bodies a small share of shelves therefore start on a bar whose wick already reached past the boundary. The cap on the boundary keeps that bounded; under Wicks it cannot happen at all.
A swing is confirmed only after the configured number of bars have passed, so a shelf always becomes visible later than it formed. That delay is inherent to pivots and cannot be removed without looking ahead.
On very quiet or thinly traded symbols the tolerance can be wide relative to the actual range, which pairs swings a trader would not group together. Lower it or switch to the tick mode.
The script reads only the bars of the chart timeframe. It does not look at higher timeframes, at intrabar data, or at volume.
It describes shelves that exist and what happened to them. It does not rank them, score them, or suggest entries, exits or targets.
Shelves are dropped once the retention cap per side is exceeded. Taken shelves go first; a shelf that still holds is only dropped when no taken one is left, and then the oldest goes. Deep history is not kept on the chart.
A shelf can be taken before its second swing exists. It is then drawn from its first anchor to the takeout and marked as taken, which puts the second swing to the right of where the line ends while the touch count still includes it.
Swing points must stand out from the bars around them. Two highs at the same price no further apart than the swing length cancel each other out, so a tight double top can go unmarked. Lower the swing length if you want those.
This script is a charting tool for educational purposes. It does not provide financial advice and does not predict future price movement. Trading carries risk; decisions and their outcome remain yours. Penunjuk

Sattam | option-scalpVolatility Projection Zones
Every 52 bars the indicator takes a reading of the market and projects where
price could travel next, based on how volatile the market actually is right now.
WORKS ON EVERY MARKET — AND HOLDS UP ON OPTIONS
There is not a single fixed value anywhere in this script: no pip counts, no
point targets, no price assumptions. Every distance it draws is derived from the
instrument's own volatility, so it behaves the same way on futures, forex,
indices, crypto, stocks — and on options contracts, which is where most
ATR-based tools quietly fall apart.
Options are a hostile case: premiums move in cents, a contract can lose half its
value in three bars, sessions are full of gaps, and plenty of bars print with no
trade at all. A pure ATR projection lags badly through moves like that and draws
targets far too tight. This script handles it by taking the LARGER of two
measures — the ATR projection, or the range of the anchor window itself. On
liquid futures the ATR is always the larger one and the floor never shows; on an
option, when a window holds a collapse, the window wins and the projection stays
honest.
HOW IT WORKS
At each cycle the script looks at the last 3 bars and finds the extreme that
price has moved furthest away from — if price is sitting near the top of that
little range, the low becomes the anchor, and vice versa. From that anchor it
projects a distance equal to 3 x ATR(14), or the range of those 3 bars when that
is wider.
Four lines are drawn per cycle:
- Two thick lines — the anchor and the full projection target
- Two thin lines — the 50% and 61.8% marks in between
Each set extends 49 bars, stopping just before the next cycle begins, and the
last 8 sets stay on the chart.
HOW TO READ IT
The direction of the projection is the cycle's bias. A set projecting upward
means the anchor sits below price as support, with the levels above as upside
reference. The two thin lines are the natural partial targets; the far thick
line is the full measured move.
Because the projection scales with volatility, the levels widen in fast
conditions and tighten in quiet ones automatically.
SETTINGS
Cycle length - bars between projections (default 52)
Anchor window - bars used to pick the anchor (default 3)
ATR length/mult - the projection distance (default 14 / 3.0)
Inner ratios - the two intermediate levels (0.5 / 0.618)
Cycle anchor - where the cycle starts counting: Session, Week, or a
manual phase
Display - colors, widths, line length, sets kept
NOTES
This is a levels framework, not a signal system. It draws on every cycle
regardless of trend or range conditions, and it has no entry filter of its own —
combine it with your own read of structure and context.
Not financial advice. Test on your own instruments and timeframes before relying
on it.
خطوط الهدف حسب حركة السوق
المؤشر كل ٥٢ شمعة يوقف ويقيس لك السوق، وبعدين يمد أربعة خطوط تقول لك
وين ممكن يوصل السعر. والمسافة مو رقم كتبته أنا، هي من حركة السوق نفسه
في ذيك اللحظة — سوق هايج يعطيك خطوط بعيدة، وسوق هادي يعطيك خطوط قريبة.
يشتغل على كل الأسواق — وأقوى شي على الاوبشن
ما فيه في المؤشر ولا رقم ثابت. لا نقاط ولا بيبس ولا أهداف محفوظة. كل
مسافة يرسمها يطلعها من حركة الأداة اللي أنت فيها. عشان كذا نفس الشغل
يمشي على الذهب والفوركس والمؤشرات والعملات الرقمية والأسهم، ويمشي على
عقود الاوبشن كمان — وهذي بالذات وين أغلب المؤشرات تخرب وأنت ما تدري.
ليش الاوبشن صعب؟ لأن سعر العقد يتحرك بالسنتات، وممكن العقد يطيح نص
قيمته في ثلاث شموع بس، والجلسات فيها فجوات كثيرة، وشموع تعدي بدون ولا
صفقة. مقياس ATR لحاله يتأخر على حركة زي كذا، فيرسم لك أهداف قريبة ما
تسوى شي.
الحل اللي فيه: يقارن بين شيئين وياخذ الأكبر — إما مسافة ATR، وإما مدى
الشموع الثلاث اللي طلعت منها نقطة البداية. في الأسواق العادية ATR يطلع
أكبر دايماً وما تحس بهالشي أصلاً؛ وفي الاوبشن لما تصير طيحة قوية، مدى
الشموع يطلع أكبر وياخذه المؤشر — فتطلع الخطوط واقعية مو مضحكة.
كيف يشتغل بالضبط
كل دورة يشوف آخر ٣ شموع، ويشوف السعر حالياً قريب من فوق ولا من تحت:
- السعر قريب من فوق؟ ياخذ القاع نقطة بداية ويمد الخطوط طالعة
- السعر قريب من تحت؟ ياخذ القمة نقطة بداية ويمد الخطوط نازلة
يعني دايماً يبدأ من الطرف الأبعد عن السعر.
ومن نقطة البداية هذي يقيس المسافة (٣ أضعاف ATR أو مدى الشموع الثلاث،
أيهم أكبر) ويرسم:
- خطين سميكين: واحد عند نقطة البداية، وواحد عند الهدف الكامل
- خطين رفيعين بينهم: عند ٥٠٪ و ٦١.٨٪ من المسافة
كل مجموعة خطوط تمشي ٤٩ شمعة وتوقف قبل ما تبدأ المجموعة الجديدة، ويبقى
لك على الشارت آخر ٨ مجموعات.
كيف تقراه
- الخطوط طالعة فوق؟ الدورة ميولها صعود، ونقطة البداية تحت تصير دعم
- الخطوط نازلة تحت؟ الدورة ميولها هبوط، ونقطة البداية فوق تصير مقاومة
- الخطين الرفيعين: أهداف أولى وثانية، مكان طبيعي تجني فيه جزء
- الخط السميك البعيد: الهدف الكامل للحركة
الإعدادات
Cycle length - كل كم شمعة يرسم مجموعة جديدة (الافتراضي ٥٢)
Anchor window - كم شمعة ياخذ منها نقطة البداية (٣)
ATR length/mult - مقياس المسافة (١٤ و ٣ أضعاف)
Inner ratios - الخطين الرفيعين (٠.٥ و ٠.٦١٨)
Cycle anchor - من وين تبدأ الدورة: مع الجلسة، مع الأسبوع، أو يدوي
Display - ألوان وسماكات وطول الخطوط وعدد المجموعات
كلام لازم يتقال
المؤشر يعطيك مستويات، مو إشارات دخول وخروج. يرسم كل دورة سواء السوق
ترند أو عرضي، وما فيه فلتر يقول لك ادخل الحين. استخدمه مع قراءتك أنت
للسوق.
وهذا مو توصية شراء ولا بيع. جربه على أدواتك وفريماتك قبل لا تعتمد عليه بصفقاتك. Penunjuk

Penunjuk
