Swing Structure Forecast [BOSWaves]Swing Structure Forecast - Statistical Swing Projection System with Volatility-Adaptive Support and Resistance Detection
Overview
Swing Structure Forecast is a statistically-driven swing analysis system that maps directional price structure through confirmed pivot identification, where support and resistance zones construct automatically at each swing extreme and a probabilistic forecast beam projects the next swing leg using aggregated historical swing measurements.
Rather than applying fixed price targets, universal extension ratios, or lagging directional filters, zone boundaries, forecast direction, and projection magnitude are governed by structural pivot confirmation, ATR-proportioned zone sizing, and rolling statistical measurement of completed swing history across a configurable sample window.
This produces a continuously refreshed structural map alongside a data-grounded forward projection. Zones breathe with volatility cycles and forecasts are calibrated to the instrument's own measured behaviour rather than theoretical constants or fixed multiples.
Price is therefore assessed against structurally-anchored zones derived from confirmed swing pivots, with directional expectations built from the statistical record of prior completed legs rather than external reference points.
Conceptual Framework
Swing Structure Forecast is built on the premise that genuine support and resistance originate at confirmed swing extremes, and that the statistical character of completed swing legs contains meaningful information about the magnitude and duration of the move that will follow.
Standard projection methodologies apply predetermined ratios that treat every instrument and market condition as interchangeable. This framework instead extracts magnitude expectations from the instrument's own swing record, building an evidence base from recent completed legs and distilling it into a statistically-grounded projection originating at the current confirmed pivot.
Three core principles shape the design:
Support and resistance zones should originate at structurally confirmed swing highs and lows, not at indicator crossovers, arbitrary distances, or price patterns lacking pivot confirmation.
Zone width must respond to prevailing volatility, expanding proportionally when ATR is elevated and compressing when market conditions quieten.
Forecast targets and projection uncertainty should be derived from the distribution of the instrument's own recent swing history, with variability expressed visually rather than hidden behind a single projected level.
This repositions price structure work from passive historical reference into an active, instrument-specific projection framework that updates with each new confirmed swing.
Theoretical Foundation
The indicator unifies structural pivot detection, ATR-responsive zone construction, rolling statistical aggregation, and Fibonacci extension mapping.
Swing highs and lows are established through a rolling highest/lowest comparison across a configurable lookback window, accepting only pivots surrounded by sufficient structural confirmation on both sides. A 200-period ATR provides a slow-moving, stable volatility reference that scales zone thickness and beam width proportionately across varying instruments and timeframes. Completed swing percentages and durations populate a rolling sample array, with three aggregation modes — weighted, average, and median — giving users direct control over how heavily recent legs are weighted against older history. Standard deviation across this sample governs beam width, producing narrow projections when swing history is consistent and widening the beam when prior legs have varied significantly in magnitude.
Four internal systems work in coordination:
Pivot Detection Engine : Confirms swing highs and lows through multi-bar structural comparison, withholding confirmation until price movement validates the extreme and eliminating repainting.
Zone Construction System : Builds dual-layer ATR-proportioned boxes at each confirmed pivot, applying progressive opacity reduction with age and monitoring for structural breach events.
Forecast Engine : Processes the rolling swing sample through the selected statistical method and casts the next projected leg as a smoothed cone beam originating at the current pivot, scaled by historical variance.
Fibonacci Extension System : Deploys individually toggleable extension levels beyond the primary forecast target, each with a fully configurable ratio for defining continuation objectives.
This structure keeps the structural map and forward projection permanently coupled, refreshing in unison whenever a new swing confirms.
How It Works
Swing Structure Forecast processes price through a structured sequence of pivot-aware operations:
Pivot Confirmation : Bar highs and lows are continuously compared against a rolling window of configurable length. A swing high locks in once price retreats sufficiently from the peak; a swing low locks in once price advances sufficiently from the trough, ensuring no repainting occurs.
Zone Placement : A dual-layer box anchors at each confirmed pivot. An outer boundary encloses the broader reaction area and an inner zone concentrates the higher-probability interaction region.
Age-Based Fading : Zone opacity diminishes progressively as elapsed bars accumulate since formation, weighting recent structural levels visually above older historical context.
Breach Detection : A close beyond a zone's anchor level triggers conversion to a dotted outline and initiates an automatic removal sequence, purging invalidated structure from the chart.
Swing Recording : Each completed leg is logged as a percentage magnitude and a bar duration into the rolling sample array, capped at the user-defined sample count with oldest entries discarded first.
Statistical Aggregation : The selected method, weighted, average, or median, resolves the sample into an expected magnitude and duration for the forthcoming swing leg.
Beam Construction : A three-layer cone extends forward from the current pivot anchor using smoothstep-eased interpolation, with width proportional to sample standard deviation and opacity grading across nested layers.
Target Zone : A bounding box placed at the beam terminus presents the projected price level and expected percentage move, with box height communicating the degree of forecast uncertainty.
Fibonacci Extensions : Configurable ratio levels project beyond the primary target, establishing pre-mapped objectives for continuation moves that exceed the base projection.
These processes collectively sustain a live structural framework and a statistically-grounded projection that regenerates with every newly confirmed swing pivot.
Interpretation
Swing Structure Forecast should be read as a structural boundary map combined with a probabilistic directional projection:
Support Zones (Green) : Constructed at confirmed swing lows, marking price regions where prior downside pressure exhausted and upward reversals originated.
Resistance Zones (Red) : Established at confirmed swing highs, identifying areas where prior upside pressure stalled and downward reversals began.
Zone Opacity : Communicates structural age. Vivid zones reflect recent pivot formation; subdued zones represent older levels retained for broader historical context.
Broken Zones : Transition to faint dotted outlines on breach, preserved as reference markers without visually competing with structurally intact levels.
Forecast Beam : Extends forward from the most recently confirmed pivot, projecting the statistically expected next leg. Cone width encodes uncertainty drawn from sample variance.
Narrow Beam : Prior swing history shows consistent magnitude, indicating relatively high projection confidence.
Wide Beam : Prior swing history shows significant variability, indicating greater uncertainty and warranting additional confirmation before acting.
Target Zone and Label : Mark the statistically derived price destination alongside expected percentage move and absolute price level.
Fibonacci Extensions : Pre-mapped levels beyond the primary target defining structured continuation objectives for extended directional moves.
Path Markers : Dot markers positioned along the beam centerline with opacity fading toward the target, conveying projected trajectory and directional progression.
Structural context, beam width, and sample consistency are more significant than any individual projected value in isolation.
Signal Logic and Visual Cues
Swing Structure Forecast operates through two principal visual frameworks:
Structural Zones : Continuously maintained support and resistance boxes anchored at confirmed pivots. Intact zones carry unbroken structural relevance; broken zones document levels that price has already closed through and structurally dismissed.
Forecast Beam : Repositions automatically on every new swing confirmation, simultaneously refreshing the beam geometry, target zone, path markers, and Fibonacci extensions to reflect the updated pivot origin and current statistical aggregation.
Alert conditions trigger on confirmed swing high and swing low events, supporting systematic structural monitoring without requiring active chart observation.
Strategy Integration
Swing Structure Forecast applies across structure-based, mean-reversion, and trend-continuation trading methodologies:
Structure-Referenced Entries : Treat intact zones as interaction boundaries for entry decisions, assigning greater weight to recently formed levels over aged, heavily faded structure.
Instrument-Calibrated Targets : Use the statistical projection as a primary take-profit reference built from the instrument's own measured swing history rather than applied universal ratios.
Beam Width Conviction Scaling : Adjust confirmation requirements relative to current beam width. Wide beams call for additional validation before committing; narrow beams reflect historically stable swing magnitude.
Fibonacci Continuation Planning : Reference extension levels beyond the primary target when trending conditions suggest the initial projection may be exceeded.
Broken Zone Flip Monitoring : Track recently breached zones as candidate reversal levels where former support may transition to resistance and vice versa following structural invalidation.
Multi-Timeframe Structural Context : Reference higher-timeframe zones as macro boundaries while applying lower-timeframe forecast projections for entry precision and target identification.
Sample Population Patience : Defer high-conviction treatment of projection outputs until the sample window has accumulated sufficient completed swings, particularly on instruments or timeframes with limited history.
Technical Implementation Details
Core Engine : Rolling highest/lowest pivot detection with configurable lookback and no-repaint confirmation logic
Zone Construction : Dual-layer ATR-proportioned boxes with progressive opacity fading, breach detection, and automatic invalidation removal
Statistical Model : Weighted, average, or median aggregation across configurable rolling sample with standard deviation uncertainty scaling
Forecast Geometry : Smoothstep-eased three-layer polyline beam with standard deviation width scaling and graduated opacity
Target Visualisation : Projection label with percentage move and price level enclosed by uncertainty-proportioned target box
Fibonacci System : Five independently toggleable extension levels with fully configurable ratios
Alert Coverage : Swing high confirmation and swing low confirmation events
Performance Profile : Optimised for real-time execution across all timeframes with configurable zone capacity and sample limits
Optimal Application Parameters
Timeframe Guidance:
1 - 15 min : Near-term swing structure with short-horizon projection for intraday approaches
1H - 4H : Intraday to multi-session structural mapping with intermediate forecast range
Daily - Weekly : Macro swing structure identification with extended projection targets
Suggested Baseline Configuration:
Swing Length : 16
Zone Width (ATR) : 0.3
Max Level Age : 300 bars
Samples : 20
Method : Weighted
Forecast Bars : 5
Fib Extensions : 1.0, 1.272, 1.618 active
These suggested parameters serve as a starting baseline; their effectiveness varies with the instrument's volatility profile, characteristic swing cadence, and preferred zone density, so incremental adjustment across multiple session types is recommended before drawing performance conclusions.
Parameter Calibration Notes
Apply the following refinements to adjust behaviour without modifying core logic:
Zones too wide : Lower Zone Width (ATR) to narrow zone boundaries, particularly on lower timeframes where ATR values produce oversized zones relative to typical price movement.
Too many zones forming : Raise Swing Length to impose stricter structural requirements before a pivot qualifies for zone creation.
Beam excessively wide : Sample history contains high variance. Raise Samples to dilute outlier legs or switch to Median to limit their influence on the projected magnitude.
Projection slow to reflect recent behaviour : Lower Samples or switch to Weighted method to concentrate projection weight on the most recently completed swing legs.
Significant pivots going undetected : Lower Swing Length to increase sensitivity and qualify shorter structural moves as confirmed pivots.
Forecast visual range misaligned with chart : Modify Forecast Bars to adjust how far projection visuals extend rightward without altering the underlying price target calculation.
Stale levels persisting on chart : Reduce Max Level Age to accelerate removal of older unbroken zones, keeping structural reference anchored to recent pivot history.
Adjustments should be applied incrementally and assessed across varied session conditions rather than calibrated against a single market period.
Performance Characteristics
High Effectiveness:
Markets exhibiting rhythmic swing sequences with clearly defined structural turning points
Instruments where volatility follows identifiable expansion and contraction patterns that ATR captures proportionately
Trend-continuation approaches targeting measured extensions derived from the instrument's own swing record
Mean-reversion strategies using confirmed structural zones as primary entry and exit reference boundaries
Reduced Effectiveness:
Directionless, low-conviction conditions generating frequent shallow pivots that populate the sample with structurally insignificant measurements
Event-driven or gap-heavy sessions producing swing magnitudes that are unrepresentative of normal instrument behaviour
Instruments with erratic or non-stationary volatility profiles where ATR-based proportioning loses consistency
Early sessions on a given timeframe before sufficient completed swings have accumulated to produce statistically reliable projections
Integration Guidelines
Confluence : Pair with BOSWaves volume tools, order flow indicators, or broader market structure analysis to reinforce zone and forecast interpretation
Sample Discipline : Reserve high-conviction treatment for projections generated once the sample window is fully populated with completed swings
Breach Acceptance : Treat breached zones as structurally void and resist anchoring expectations to levels price has already invalidated with a closing breach
Beam Width Respect : Read a wide beam as a requirement for additional confirmation before acting, not permission to disregard the projection entirely
Directional Consistency : Sustain bias aligned with the current forecast direction until a newly confirmed swing pivot shifts the projection origin
Timeframe Confluence : Highest-quality structural setups emerge when active zones and forecast direction correspond across multiple timeframes simultaneously
Disclaimer
Swing Structure Forecast is a professional-grade swing structure and statistical forecasting tool. All projections are derived from historical swing behaviour and represent probabilistic expectations rather than assured outcomes. Performance depends on the consistency of prior swing history, prevailing market conditions, parameter selection, and disciplined application. BOSWaves recommends deploying this indicator as one component within a comprehensive analytical framework incorporating trend context, volume analysis, and rigorous risk management practices.
Indicators and strategies
TASC 2026.04 A Synthetic Oscillator█ Overview
This script implements a Synthetic Oscillator as presented by John F. Ehlers in the April 2026 TASC Traders' Tips article "Avoiding Whipsaw Trades". The indicator aims to provide a smooth, low-lag oscillator for timely trading signals by dynamically mapping a sine wave to price data.
█ CONCEPTS
"Whipsaw" trades are a common issue in algorithmic trading. They occur when the market quickly moves against a position, causing the trader/trading system to reverse their position at a loss, and then the market reverses again and continues in the original direction. Such trades occur because the trading system is attempting to react quickly to market moves instead of focusing on broader market cycles.
A typical solution for reducing whipsaw trades is to apply linear filters to smooth the data and emphasize specific cycles. However, linear filters cannot have both a smooth response and a low computational lag. Therefore, strategy designs utilizing linear filters require a tradeoff between smoothness and lag.
Ehlers proposes a nonlinear indicator as a solution to bridge the gap and achieve a smooth, timely response while reducing whipsaw trades.
The Synthetic oscillator adapts to market conditions by calculating a dynamic sine wave from the estimated instantaneous dominant cycle over a range of periods.
The process to calculate the indicator is as follows:
Smooth the price data with a 12-bar Hann Window filter to reduce high-frequency noise, which can affect dominant cycle estimates.
Band-pass filter the windowed data with a two-pole high-pass filter and a SuperSmoother filter to focus on the range of cycles between a specified lower bound and upper bound, and normalize the result using the filter's 100-bar root mean square (RMS).
Calculate the one-bar rate of change (ROC) in the oscillator from step 2, and normalize the ROC using its 100-bar RMS.
Estimate the instantaneous dominant cycle from the oscillators in steps 2 and 3 by treating the series as a complex waveform , where the first oscillator represents the waveform's band-limited "real" component ("I"), and the second represents the band-limited "imaginary" component ("Q").
Cumulatively sum the reciprocal of the dominant cycle (i.e., the dominant frequency ) to obtain the phase angle of the sine wave.
To reduce cumulative errors and lag in the phase angle calculation, compute a secondary band-bass filter from a high-pass filter and the UltimateSmoother, and reset the angle to 0 or 180 degrees when that filter crosses above or below 0.
Calculate the Synthetic Oscillator as the sine of the final phase angle.
█ USAGE
This indicator displays the Synthetic Oscillator and a horizontal zero line in a separate pane. Users can analyze the crossings between the oscillator value and 0, or the behavior of the oscillator as it reaches 1 or -1, to derive potential timely trading signals.
Ehlers notes in the article that the peaks and valleys of the Synthetic Oscillator can provide signals a little too early, depending on the settings and context. Therefore, he recommends applying another smoother to the oscillator, such as a Hann Window filter with an optimizable length, to adjust timing as necessary.
█ INPUTS
This indicator uses multiple hardcoded parameters based on the implementation in Ehlers' article. However, users can customize the source series and the upper and lower bounds of the calculations:
Source Series: The series of values to process.
Lower Bound: The smallest cycle in the passband of the filters, and the lower limit of the dominant cycle estimate.
Upper Bound: The largest cycle in the passband of the filters, and the upper limit of the dominant cycle estimate.
Volume Spread Analysis IQ [TradingIQ]Hello Traders!
🔹Volume Spread Analysis IQ
This indicator was most voted on for our indicator competition - so here it is! Hope you guys like it :D
Volume Spread Analysis IQ is a chart-reading tool built to help traders judge effort, result, and background context in a way that is visual and practical.
Instead of forcing you to interpret volume and spread in isolation, this indicator organizes what the bar is doing into a readable structure so you can quickly see when the market is showing:
low participation
high participation
narrow or wide spread
potential hidden strength
potential hidden weakness
contextual VSA signals such as No Demand, No Supply, Upthrusts, Shakeouts, and Stopping Volume
🔹Why Effort vs Result Matters in Volume Spread Analysis
The following information is relevant to VSA interpretation.
In any market, price movement is the visible outcome of an underlying battle between buyers and sellers. Volume represents the effort being applied in that battle, while the spread of the candle reflects the result of that effort.
When effort and result move together, the market is behaving efficiently. High effort producing a large price move suggests strong conviction and participation. In trending conditions this often confirms that the dominant side of the market is still in control.
However, when effort and result begin to diverge, it can reveal hidden information about what is happening beneath the surface.
For example:
High effort with very little upward progress may indicate that strong selling pressure is absorbing buyers. Even though buyers are active, their effort is not producing meaningful results. This type of imbalance can appear before weakness develops.
Likewise, high effort with very little downward progress can signal that sellers are being absorbed by hidden demand. Large amounts of selling activity fail to push price lower, suggesting accumulation may be taking place.
Low effort situations are also informative. A rally with very low effort often lacks participation and can signal weak demand, while a selloff with very little effort can suggest that selling pressure is fading.
From a structural perspective, the effort/result relationship helps traders distinguish between moves driven by genuine participation and moves that occur simply because the market is temporarily thin. This distinction can be important when evaluating breakouts, pullbacks, or potential reversals.
In short, effort tells you how hard the market is trying to move, while result tells you how successful that attempt actually was. When these two fall out of balance, it often reveals shifts in supply and demand before they become obvious on price alone.
🔹What the indicator shows🔹
🔸Background bias
Each candle is tinted to reflect the recent VSA background. This helps you judge whether the market is currently leaning strong, weak, or neutral based on the recent flow of bullish and bearish evidence.
🔸Effort vs. Result view
The lower panel converts both volume and spread into easy-to-read rankings from 1 to 10.
Effort represents how active the market is.
Result represents how much price actually moved.
🔸Per-candle labels
Optional candle labels show a simple readout for each bar:
R = Result rank
E = Effort rank
🔸Effort vs. Result summary table
A live table on the chart shows the current effort rank, result rank, and the current interpretation of their relationship.
🔸Key VSA event markers
The script marks classic VSA conditions directly on the chart when they appear in the proper context:
No Demand
No Supply
Upthrust
Shakeout
Stopping Volume
🔹How to read it
Effort asks: How much activity came into this bar?
Result asks: How much did price actually move?
Background asks: Is recent behavior supporting strength or weakness?
This combination helps separate bars that look dramatic from bars that are actually meaningful.
For example:
High effort with poor upward result can hint that buying is struggling
High effort with poor downward result can hint that selling is being absorbed
Low effort rallies can warn of weak demand
Low effort selloffs can suggest supply is drying up
🔹Signal overview
No Demand
Highlights weak upward bars with low participation.
No Supply
Highlights weak downward bars where selling pressure appears limited.
Upthrust
Marks a rejection bar that appears in weak background conditions and can warn of downside risk.
Shakeout
Marks a lower rejection bar that appears in strong background conditions and can suggest bullish intent.
Stopping Volume
Flags heavy selling activity that may be halting a move lower. Context matters. In strong background it can be bullish. In weak background it can simply pause price before weakness resumes.
🔹Why this indicator is useful
Many traders can see volume. Far fewer can quickly judge whether that volume actually meant anything.
This tool is designed to help with exactly that.
It gives you:
a cleaner way to read volume and spread together
fast recognition of effort versus result imbalance
background context instead of isolated signals
VSA-style event labeling without requiring a cluttered chart
friendly settings for newer users, plus advanced overrides for experienced users
🔹Best use cases
confirming whether breakouts have real participation
spotting weak rallies and weak selloffs
judging whether aggressive bars are efficient or wasteful
finding VSA-style reversal or continuation clues
adding context to your existing market structure, liquidity, or price action model
🔹Important note
This indicator is a chart-reading tool , not a promise of outcomes. VSA works best when signals are interpreted in context, not taken mechanically one by one.
Use the background, the effort/result relationship, and the signal location together.
Important consideration
We scoured the internet, books, you name it to find detailed information on VSA techniques. That said, information is sparse and conflicting depending on where you look. We relied mostly on gold standard literature. However, the information in that literature is far from objective.
Many descriptions are similar to…
“An upthrust is a bar that pushes up and then fails, showing rejection of higher prices, usually in a weak background.”
Coding this requires interpretation by the engineer - there aren’t exact rules to follow. This means the indicator’s presentation of an upthrust, shakeout, etc. might not always align with your definition of those events.
You can customize the settings to force the indicator to better match your interpretation.
🔹Inputs you can customize
The script includes simple user-friendly controls such as:
What counts as a small body
What counts as a long wick
How strict close location should be
How strict spread and volume classifications should be
How much background proof you want before the indicator leans strong or weak
Whether to use broader or more traditional No Demand / No Supply logic
Whether Shakeouts and Upthrusts should require clear trend alignment
Advanced users can also enable raw threshold overrides for finer control.
🔹Closing Notes
And that’s about it!
This script might receive updates in the future if the community asks for it - stay tuned!
Thank you TradingView as always!
Market Microstructure AnalyticsThe Hidden Toll on Every Trade
Every time you buy or sell a financial instrument, you pay a cost that never appears on your brokerage statement. It is not a commission. It is not a fee. It is the spread between the price at which someone is willing to sell to you and the price at which someone is willing to buy from you. That gap, measured in ticks, basis points, or fractions of a percent, is the bid-ask spread. Over a single trade it looks small. Over thousands of trades, across a year, for a fund managing billions, it compounds into one of the most significant sources of performance drag in all of finance.
For decades, institutional traders have measured this cost obsessively. Research desks at hedge funds and investment banks have dedicated entire teams to understanding when spreads are wide, why they widen, who is causing them to widen, and what that signal implies about the near-term behaviour of a market. Retail traders, however, have had almost no access to this kind of analysis. The reason is simple: measuring the bid-ask spread in real time requires access to the order book, tick-by-tick trade data, and quote data that most platforms either do not provide or lock behind expensive data terminals.
This indicator changes that. Using only the OHLCV data that every chart on TradingView already contains, it reconstructs spread estimates and liquidity conditions through seven statistically validated models drawn directly from the academic market microstructure literature. It cannot replicate what a full order book feed provides, and the documentation is explicit about where the approximations are. But it gets considerably closer than anything available to the typical chart-based trader, and on short intraday charts it delivers information that is genuinely useful for both execution decisions and regime assessment.
What Market Microstructure Actually Measures
Market microstructure is the academic field that studies how prices are formed at the level of individual transactions. Its central question is not where a price will go tomorrow but how the mechanics of trading itself affect price formation right now. Two papers published decades apart established the framework this indicator builds on.
The first was by Roll (1984), who noticed something elegant: in an efficient market, the prices of consecutive trades should not be correlated with each other, because any predictability would be arbitraged away. But if you look at actual trade-by-trade price changes, you consistently find negative autocorrelation. Prices bounce back and forth. The reason, Roll argued, is the bid-ask spread itself. Buyers trade at the ask and sellers at the bid, so consecutive trades alternate between two price levels. This bouncing creates a predictable negative covariance in price changes, and the size of that covariance is directly related to the size of the spread. From this insight he derived the formula S = 2 times the square root of the negative covariance of consecutive price changes. If you observe a series of trades and measure how negatively they correlate with each other, you can back out the spread without ever seeing a quote.
The second foundational contribution came from Kyle (1985), who approached the problem from a completely different angle. He asked: if a market contains some traders who have private information about the true value of an asset, how do their orders affect price? His answer was the lambda coefficient, a measure of how much the price moves per unit of net order flow. A high lambda means the market is thin and informed: each additional unit of buying or selling pushes the price significantly. A low lambda means the market absorbs flow without moving much. Lambda is not just a spread measure; it is a measure of how much information asymmetry exists in the market at any given moment. This is the adverse selection component of the spread, and it is arguably the most strategically useful signal the indicator produces.
The Spread Estimators
The first layer of computation produces four distinct estimates of the bid-ask spread, each using a different statistical approach.
The Roll (1984) estimator is the oldest and most widely cited. It computes the rolling covariance between a price change and the price change that came before it, then takes two times the square root of the negative of that covariance. One important detail: Roll's model is defined in terms of absolute price changes, not log-returns. Using log-returns introduces a scaling distortion tied to the price level of the asset, which biases the spread estimate upward at high prices. This implementation correctly uses delta-P throughout.
The Corwin-Schultz (2012) estimator takes a fundamentally different approach. Rather than looking at the serial structure of price changes, it uses the high-low range of a bar. The core insight is that the high price of any trading period is most likely a transaction that occurred at the ask, while the low price is most likely a transaction at the bid. If you look at a two-period window, the combined high-low range reflects the true price variance over those two periods plus the spread component. A single-period range conflates variance and spread; the two-period structure allows them to be separated algebraically. The resulting formula involves a decomposition using the constant k = 3 minus 2 times the square root of 2, which emerges from the statistical properties of the high-low range under continuous diffusion. Corwin and Schultz (2012) validated this estimator extensively against actual quoted spreads across thousands of US equities and found it performs well both in cross-section and over time.
The Abdi-Ranaldo (2017) estimator is the most recent of the three and, in empirical tests, the most stable. For each bar, it computes a quantity called c, defined as the log of the close price minus the average of the log-high and log-low. This is the signed deviation of the close price from the geometric midpoint of the bar's range, expressed in log-space. Abdi and Ranaldo proved that the expected value of the product of c at time t and c at time t plus one equals negative one quarter of the spread squared. This means that by measuring how negatively c correlates with the next period's c, you can recover the spread. The estimator inherits much of the intuition of Roll but anchors itself to the intrabar price range rather than the close-to-close change, which tends to reduce noise substantially. To handle cases where the high and low are identical, which occurs on 1-tick bars or extremely liquid instruments, the implementation excludes invalid pairs from the covariance calculation rather than substituting zeros, which would bias the estimate toward zero.
The effective spread proxy takes yet another approach. Rather than estimating the quoted spread, it attempts to estimate the effective spread, which is the actual cost paid by a specific trade. The formula is two times the trade direction multiplied by the distance between the transaction price and the quote midpoint. Trade direction is approximated using the tick rule, which assigns a positive sign to transactions at prices higher than the previous price and a negative sign to those at lower prices, carrying the previous sign forward when the price is unchanged. This classification method was formalised by Lee and Ready (1991) and remains the standard approach for assigning direction when quote data is unavailable. The bar midpoint substitutes for the true quote midpoint, which introduces a systematic upward bias because the high and low of a bar are extreme transaction prices, not quotes. The effective spread proxy is therefore most reliable as a relative indicator of whether transaction costs are rising or falling, rather than as an absolute estimate of the quoted spread.
The Liquidity Metrics
The second layer moves beyond spread estimation into broader liquidity measurement. The key distinction is this: the spread tells you what it costs to execute one trade right now. Liquidity metrics tell you something about the structure of the market, how deep it is, how much information is embedded in the current order flow, and how efficiently prices are absorbing volume.
The Amihud (2002) illiquidity ratio is the most widely used liquidity measure in the academic asset pricing literature. Its construction is conceptually simple: it divides the absolute value of a log return by the dollar volume of trading in the same period. What this measures is price impact per dollar traded. If a stock moves one percent and 10 million dollars changed hands, the ratio is small. If the same one percent move happened on only 50,000 dollars of volume, the ratio is large, indicating a thin market where small amounts of capital move prices significantly. Unlike the spread measures, which capture the cost of a single round trip, the Amihud ratio captures market depth. This implementation uses dollar volume rather than share or contract volume, which is the correct specification for comparability across instruments at different price levels. The ratio is scaled by a factor of 100 million for display purposes; its absolute level is asset-dependent and should always be interpreted relative to the instrument's own history.
Kyle lambda, estimated here via ordinary least squares regression of price changes on signed volume, is the most theoretically sophisticated metric in the indicator. Each bar's signed volume is the total volume signed by the tick rule direction: positive if the bar closed higher than the previous bar, negative if it closed lower. The regression coefficient from regressing price changes on this signed volume is the lambda estimate. A high positive lambda means prices are moving more than expected for the amount of flow being absorbed, which is the signature of informed trading. When lambda rises, someone in the market likely knows something that others do not, and market makers are widening their spreads in response. The critical implementation detail here is that the volume must not be normalised before the regression. Normalising the signed volume changes the regression coefficient from a price-impact-per-share measure to a dimensionless sensitivity measure, which is a different quantity and does not correspond to Kyle's original model.
The Parkinson (1980) range-based volatility estimator serves a supporting role: it estimates intrabar variance from the high-low range using the formula sigma-squared equals one over four times the natural log of two, multiplied by the square of the log ratio of high to low. This estimator is approximately five times more statistically efficient than the classic close-to-close variance estimator for the same number of observations (Parkinson 1980). Its role in this indicator is to help decompose the high-low range: the range reflects both volatility and the spread, and the ratio of the composite spread estimate to the Parkinson volatility tells you which component is dominant at any given time.
The Composite and the Regime System
Having computed multiple independent estimates of the spread, the natural question is how to combine them. Simple averaging is theoretically suboptimal when the estimators have different levels of noise. The precision-weighted composite assigns each estimator a weight inversely proportional to its robust variance, so that noisier estimators contribute less to the final reading.
The key word is robust. Rather than computing standard rolling variance, which is dominated by extreme observations and can make a normally well-behaved estimator look unreliable for weeks after a single outlier bar, this implementation uses a variance estimator based on the Median Absolute Deviation, or MAD. The MAD is the median of the absolute deviations from the rolling median. Multiplied by the consistency factor 1.4826, it provides an equivalent to the standard deviation that is resistant to outliers with a breakdown point of 0.5, meaning up to half the observations in a window can be extreme values without corrupting the estimate. This approach follows Rousseeuw and Croux (1993), who established the formal properties of MAD-based scale estimators.
Two further safeguards stabilise the weights. A ridge regularisation term, set to five percent of the mean robust variance across active estimators, prevents any weight from exploding toward infinity when an estimator is temporarily near-constant. And a weight cap, set by default at 70 percent of the total, prevents any single estimator from dominating the composite during regimes where it happens to be locally smooth. The live weights are displayed in the dashboard so the user can always see how the composite is currently distributed.
The regime detection system answers the question of whether the current spread level is historically unusual. This is done through a robust z-score: the composite spread is compared to its rolling median, and the deviation is normalised by the MAD. The result is a standardised score that tells you how many robust standard deviations the current spread is from its recent typical level. A score of two or above signals a statistically unusual widening event. The same procedure is applied independently to the Amihud illiquidity ratio and to the absolute value of Kyle lambda.
These three scores are then combined into the Liquidity Stress Index, computed as their equal-weighted average after each component has been winsorised at plus or minus three robust standard deviations. The winsorisation prevents a single extreme reading in one dimension from overwhelming the composite. Each component is then winsorised before averaging to prevent a single extreme dimension from dominating. The result is mapped to a zero-to-100 scale using the hyperbolic tangent function, where 50 represents neutral conditions, readings in the 65 to 80 range indicate elevated stress, and readings above 80 indicate severe stress across multiple liquidity dimensions simultaneously.
Practical Use Cases
For a retail trader, the most immediately useful output is the composite spread and its regime classification. When the composite spread widens and the regime indicator shifts to Elevated or Stress, entering a new position becomes more expensive than usual. On illiquid instruments this widening can be dramatic, consuming a significant fraction of the expected profit in transaction costs before the trade even begins. Conversely, when spreads are compressed, the market is functioning efficiently and execution is cheap. Timing entries and exits around spread conditions is a simple, evidence-based way to reduce the invisible drag that erodes returns over time.
The spread trend indicator, which compares a five-period exponential moving average of the composite spread against a twenty-period average, provides a simple directional signal. A widening trend often precedes a period of higher volatility, lower liquidity, or increased uncertainty. This does not tell you which direction the price will move, but it tells you that the environment is becoming less predictable and more costly to trade, which is operationally important information.
For professional traders and systematic strategy developers, the Kyle lambda signal has specific applications. When lambda is elevated relative to its own history, which the dashboard displays as the adverse selection z-score, it indicates that price changes are disproportionate to the measured order flow. This is consistent with the presence of informed traders, a phenomenon central to the theoretical work of Kyle (1985) and Glosten and Milgrom (1985). Elevated adverse selection is one of the clearest early warning signs of an impending directional move driven by asymmetric information, such as pre-announcement positioning, earnings whispers, or macroeconomic data leakage.
The Amihud illiquidity ratio is particularly valuable for cross-asset comparisons and for monitoring the liquidity conditions of a specific instrument over time. Portfolio managers can use it to time their entries and exits in less liquid securities: entering when illiquidity is below its historical median and exiting before a period of known low liquidity such as a holiday period or low-volume session. Research by Amihud and Mendelson (1986) established that expected returns are positively correlated with illiquidity, meaning that investors demand higher compensation for holding assets where transaction costs are high. The illiquidity z-score in this indicator allows that premium to be tracked in real time.
The spread-to-volatility ratio is a metric that practitioners familiar with the work of Corwin and Schultz (2012) will recognise immediately. It expresses the composite spread as a percentage of the Parkinson volatility estimate. When this ratio is high, the spread accounts for a large fraction of the observed price range, which typically indicates a market where market makers are cautious and price discovery is slow. When it is low, the price range is driven primarily by genuine information, not by the mechanics of the spread. This ratio is useful for distinguishing between a volatile and actively traded market, which is generally healthy, and a wide-spread market that looks volatile but is actually just illiquid.
The Liquidity Stress Index in its scaled zero-to-100 form provides an accessible summary for traders who do not want to track multiple metrics simultaneously. During normal market conditions the reading sits near 50. When all three components, the spread, the illiquidity ratio, and the adverse selection estimate, are simultaneously elevated relative to their own histories, the index rises sharply. The historical examples of this pattern occurring together include the flash crash of May 2010, the August 2015 China-driven volatility spike, the COVID-19 crash of March 2020, and various cryptocurrency deleveraging events. In each case, the simultaneous widening of spreads, collapse of market depth, and spike in price impact coefficients preceded the most severe price dislocations by enough time to be actionable.
Configuration and Settings
The Estimation Window controls the rolling window for all covariance and liquidity calculations. A shorter window, around 10 to 20 bars, makes the estimators more responsive to recent changes but increases noise. A longer window, around 50 bars, produces smoother estimates that better reflect structural conditions but lag more. The default of 20 is a reasonable starting point for most intraday timeframes.
The EMA Smoothing parameter applies an exponential moving average to each raw spread estimate before it is used in the composite and displayed on the chart. This reduces bar-to-bar noise without introducing the same lag that a longer estimation window would create. Setting it to 1 disables smoothing entirely, which is useful for research purposes but not for trading.
The Regime Window determines how far back the robust z-scores look when assessing whether current conditions are unusual. A setting of 100 means the indicator asks whether the current spread is unusual relative to the last 100 bars. For daily charts, 100 bars is approximately five months of trading. For tick charts, it represents the most recent 100 tick bars. This parameter should be set large enough to capture at least one full market cycle of the relevant timeframe.
The Maximum Composite Weight prevents any single estimator from being assigned more than the specified fraction of total weight. The default of 70 percent is conservative; in practice, during regimes where all three estimators agree and produce similar variances, the weights tend to distribute fairly evenly. The cap becomes most important when one estimator is temporarily quiet and its MAD-based variance falls to near zero, which would otherwise assign it almost all the weight.
The LSI Winsorisation Cap limits the influence of extreme readings in any single component before they contribute to the Liquidity Stress Index. At the default of three robust standard deviations, a reading of ten, which would represent a truly exceptional event, contributes the same as a reading of three. This prevents a single data anomaly or calculation artifact from permanently elevating the stress index.
Structural Limitations
No representation is made that these outputs are equivalent to actual exchange quote data. They are not. TradingView provides bars, not tick-by-tick trades, and the academic models on which this indicator is based were developed for transaction-level data. The Roll estimator assumes that each observation is a single trade; when a bar aggregates hundreds or thousands of trades, the covariance structure it observes is a convolution of many individual trade-level covariances, and the result understates the true spread. This bias grows with bar duration and trade frequency. On 1-tick or 5-tick bars the bias is minimal; on daily bars it can be substantial.
The tick rule classification, which assigns trade direction to bars and underpins both the Kyle lambda and effective spread estimates, was designed for individual trades. Applied to the close price of aggregated bars, it misclassifies a material fraction of bars. Ellis, Michaely and O'Hara (2000) documented misclassification rates of 30 to 50 percent on daily stock data. On short intraday bars the performance is better, but it never reaches the accuracy achievable with actual quote data.
The rolling MAD computation is a streaming approximation to the exact finite-window MAD. In a stationary process the difference is negligible and the heavy-tail robustness property is preserved. In rapidly changing regimes the approximation introduces a small second-order error that does not materially affect the interpretation of the outputs.
The effective spread proxy suffers from a systematic upward bias because it uses the bar midpoint rather than the true quote midpoint. This bias is largest when the intrabar range is wide relative to the actual spread, which is precisely when the estimate is most needed. On very short tick bars the range collapses toward the actual spread and the bias diminishes, but on longer bars the effective spread reading should be treated as an upper bound rather than a point estimate.
Pine Script v6 introduced the built-in variables bid and ask, which return the current best bid and ask prices from a connected broker feed when accessed on the 1-tick timeframe via request.security(syminfo.tickerid, "1T", bid) and request.security(syminfo.tickerid, "1T", ask). This is a genuine improvement over bar-based proxies for the single most recent bar. However, these variables carry three constraints that prevent them from replacing the statistical estimators in this indicator. First, they carry no historical record: the values exist only at the current bar and return na on all prior bars, which makes it impossible to compute rolling covariances, MAD-based z-scores, or any of the regime detection logic that requires a lookback window. Second, the data is only available through a live broker connection on TradingView. Users on free accounts, paper trading environments, or instruments not covered by their connected broker will receive na throughout. Third, instrument coverage is uneven: major forex pairs, selected cryptocurrency pairs on exchanges such as Binance, and equities through brokers such as Interactive Brokers are generally supported, but futures, CFDs on many instruments, and equities through data-only feeds often return no data. The statistical estimators in this indicator therefore remain the primary analytical engine. If a broker connection is active, the live bid-ask spread retrieved via these built-in variables can serve as a real-time reference point to validate whether the rolling estimates are in a plausible range for the current session, but it cannot contribute to the historical signal calculations.
None of the outputs should be used as the sole basis for any trading decision.
References
Abdi, F. & Ranaldo, A. (2017) A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices. Review of Financial Studies, 30(12).
Amihud, Y. (2002) Illiquidity and Stock Returns: Cross-Section and Time-Series Effects. Journal of Financial Markets, 5(1), 31-56.
Amihud, Y. & Mendelson, H. (1986) Asset Pricing and the Bid-Ask Spread. Journal of Financial Economics, 17(2).
Corwin, S.A. & Schultz, P. (2012) A Simple Way to Estimate Bid-Ask Spreads from Daily High and Low Prices. Journal of Finance, 67(2).
Ellis, K., Michaely, R. & O'Hara, M. (2000) The Accuracy of Trade Classification Rules: Evidence from Nasdaq. Journal of Financial and Quantitative Analysis, 35(4).
Glosten, L.R. & Milgrom, P.R. (1985) Bid, Ask and Transaction Prices in a Specialist Market with Heterogeneously Informed Traders. Journal of Financial Economics, 14(1).
Hasbrouck, J. (2009) Trading Costs and Returns for U.S. Equities: Estimating Effective Costs from Daily Data. Journal of Finance, 64(3).
Kyle, A.S. (1985) Continuous Auctions and Insider Trading. Econometrica, 53(6).
Lee, C.M.C. & Ready, M.J. (1991) Inferring Trade Direction from Intraday Data. Journal of Finance, 46(2).
Parkinson, M. (1980) The Extreme Value Method for Estimating the Variance of the Rate of Return. Journal of Business, 53(1).
Roll, R. (1984) A Simple Implicit Measure of the Effective Bid-Ask Spread in an Efficient Market. Journal of Finance, 39(4).
Rousseeuw, P.J. & Croux, C. (1993) Alternatives to the Median Absolute Deviation. Journal of the American Statistical Association, 88(424).
Fair Value Gap Profile + Rolling POC [BigBeluga]🔵 OVERVIEW
FVG Profile builds a price-level profile based on detected Fair Value Gaps (FVGs) over a fixed lookback period.
Instead of measuring traded volume alone, this tool aggregates bullish and bearish FVG occurrences into horizontal bins, allowing traders to see where price inefficiencies are most concentrated.
Each profile level represents how many bullish and bearish FVGs formed near that price zone, along with their relative strength, imbalance, and delta volume.
🔵 CONCEPTS
FVG Detection —
• Bullish FVG: when the high two bars back is below the current low.
• Bearish FVG: when the low two bars back is above the current high.
Price Binning — The full price range of the lookback period is divided into fixed bins.
FVG Aggregation — Each detected FVG is mapped to its nearest price bin and counted.
Directional Separation — Bullish and bearish FVGs are stored separately inside each bin.
🔵 FEATURES
Bull / Bear FVG Profile —
• Green segments represent bullish FVG counts.
• Orange segments represent bearish FVG counts.
• Each bin visually shows how many FVGs occurred at that level.
Strength Percentage —
• Each bin displays a % value based on total FVG count.
• The strongest bin is normalized to 100%.
Delta Volume —
• Calculates the difference between bullish and bearish FVG volume per bin.
• Positive delta = bullish dominance.
• Negative delta = bearish dominance.
Heatmap Mode —
• Colors profile levels by relative strength.
• Color direction is driven by delta volume (bullish vs bearish).
Live FVG Visualization — Optionally plots individual bullish and bearish FVG boxes on the chart.
Profile Background — A background frame highlights the full analyzed price range.
🔵 Rolling POC Logic
Unlike a static profile, the Rolling POC moves with price.
It continuously calculates the "peak imbalance level" for the last X bars, providing a moving average of where the market's most significant gaps are forming.
🔵 Moving Average Integration
The indicator features a customizable Moving Average (SMA, EMA, WMA, VWMA, etc.).
This MA helps identify if the price is currently trending toward or away from high-density FVG zones.
An "Auto" length feature is included that scales the MA based on the selected lookback period for optimal smoothing.
🔵 HOW TO USE
Identify FVG Clusters — Strong profile levels highlight prices where inefficiencies repeatedly formed.
Directional Bias — Compare bullish vs bearish segments to determine dominance at each level.
Delta Confirmation — Use delta volume to confirm whether bullish or bearish FVGs control the zone.
Reaction Zones — High-strength bins often act as areas of interest for price reactions.
Heatmap Context — Enable heatmap to quickly spot dominant imbalance zones across the range.
🔵 CONCLUSION
FVG Profile transforms Fair Value Gaps into a structured price-level profile, revealing where inefficiencies cluster and which side dominates those zones.
By combining FVG count, directional balance, delta volume, and strength normalization, it provides a powerful way to analyze imbalance behavior beyond traditional volume profiles.
PineScript integration with Notepad++ (UDL)THIS IS NOT AN INDICATOR!
This is PineScript integration with Notepad++ text editor (NPP). It supports PineScript v6 as of January 2026. Provides autocompletion, function list and syntax highlighting for *.pine files.
Why would anyone need this?
Pine Editor doesn't provide function list yet
Pine Editor doesn't allow changing fonts or syntax colors
Provided files together define a color scheme as close to current color scheme of Pine Editor as is possible in NPP. You can change the colors to suit your needs better. For example, I provide a file that changes all user-defined functions to be colored the same way Pine Editor colors imported functions. This provides clear distinction between system and user code.
Also Dark Mode users (on Windows) might not even know that Pine Editor uses Bold for types because it also uses Consolas font which has very thin Bold. Changing a font will make (standard) types stand out more.
INSTALLATION
Go to the source code of this release
For each @ filename inside the code create such a file and ensure it has encoding 'UTF-8' without BOM
Copy the following strings up until the first empty line
Paste those strings into newly created file
Remove "// " in front of each of the strings
Save the file
Follow additional instructions for that file if any
Restart Notepad++ after creating all the files.
If you don't want the fuss with copying strings, get the files from GitHub . There you can also see installation instructions, NPP screenshots and a theme to use with this UDL.
Machine Learning Pivot Points (KNN) [SS]Hey everyone,
Been working on this one for a very long time.
1. What It Is: The Geometric DNA of a Pivot
Machine Learning Pivot Points (KNN) is a predictive structural tool that moves away from traditional lag based oscillators. Instead of waiting for a moving average crossover, this system treats price action as a Geometric Slope. By utilizing a K-Nearest Neighbors (KNN) algorithm combined with regression, the script captures the mathematical "DNA" of the price leading into a pivot and compares it against a live updating database of previous market turns.
2. The Science: Linear Regression as a Signature
If you know me well, you know I am into regression. ChatGPT even called me the "Regression Whisperer" in 2025 (not sure if that is a good thing). The core of this indicator is the Historical Slope Function, which provides data for KNN to actually make its prediction).
The Training: Unlike static models, this script "trains" itself in real-time on your specific chart. Every time a 10-bar pivot (High or Low) is confirmed, the script extracts the Linear Regression Slope of the 20 bars leading into that point.
The Library: These slopes are stored in dynamic arrays. This creates a localized "memory" of what a reversal looks like for the specific asset you are trading, and hence how the indicator "learns".
The Classification: As the current price moves, its Rolling Slope is constantly calculated. The KNN algorithm then measures the "distance" (similarity) between the current slope and the stored signatures. If the current price "curves" in a way that matches past tops, the indicator flags an Approaching Pivot High.
3. Decoding the Tables
The indicator features a dual-table Cockpit designed for high-speed decision-making.
A. The Directional Helper (Top Right): Live KNN Bias
This is your real-time classification engine.
The Neon Logic: Neon Red ▼ : The current price slope has a high mathematical similarity to historical Pivot Highs.
Neon Lime ▲: The current price slope matches the signature of historical Pivot Lows.
Confidence Metric: This represents the Cluster Similarity . If the current slope is significantly closer to one group than the other, confidence spikes. A confidence level of 90%+ suggests the current price movement is almost identical to the most powerful reversals in the recent lookback.
B. The Backtest Table (Bottom Right)
This table provides a live-calculating Proof of Concept for the current ticker.
Success Rate: Measures how often the KNN's Approaching signal successfully resulted in an actual price reversal before the opposite signal appeared.
Avg Low Move ($): The average dollar/point drop achieved after a "Pivot High" was predicted.
Avg High Move (%): The average percentage ROI gained after a "Pivot Low" was predicted.
4. Visual Cues
To differentiate from standard labels, this script uses v6 Polyline Geometry to create glowing pivots. I think we can all agree we are bored of those little basic triangles. However, because Pinescript limits at 100 polylines, the script will revert to those boring triangles over a designated history so that you can still see performance in the past with clear markers.
5. Mastering the Logic: Parameters for the Pro
KNN Clusters (K): Set to 2 by default. This tells the script to average the distance to the 2 most similar past events. Increasing this makes the model "stricter" but less frequent.
Pivot Window: This controls the "length" of the signature. A 20-bar window captures the broader curve of the trend, while a shorter window focuses on micro-reversals.
Bars Left/Right: This defines the pivots themselves. It tells the script what counts as a confirmed pivot to be added to the memory bank.
6. Concluding Remarks
This indicator represents a bridge between Statistical Geometry and Machine Learning. By focusing on the Slope Signature rather than simple price levels, it allows you to see the market's intention before the pivot is fully formed. Whether you are scalping the 1-minute or swing trading the Daily, the KNN logic adapts to the volatility and DNA of the chart in front of you.
I hope this provides a new edge to your trading workflow. Safe trades!
Market Structure Volume Profiles [Kioseff Trading]Hello traders and friends!
Introducing: "Market Structure Volume Profiles".
This script combines market structure with volume profiling and CVD to show how volume develops inside each structural changes of the market.
Instead of building one continuous profile across a session, this script creates a new volume profile for each completed BoS or CHoCH, allowing you to study the internal auction of each behavioral regime independently.
🔹Features
Detects and displays BoS and CHoCH
Builds a dedicated volume profile for each new structure
Displays profiles in Stacked or Split mode
Optional Mini Profile mode for a compact structure profile view
Shows buy-side and sell-side volume distribution
Displays POC for each profile
Optional extended POC and naked POC tracking
Displays Value Area (VA) for each completed structure
Tracks and plots CVD by structural leg
Optional market structure candle coloring
Optional structure statistics label
Uses lower timeframe data to build more detailed internal volume distribution
🔹How it works
This script tracks market structure and recalculates volume profiles for each structural change.
Whenever price confirms a Break of Structure (BoS) or Change of Character (CHoCH), the volume accumulated during that completed leg is organized into a profile. This allows you to examine how volume was distributed throughout the move, where the heaviest participation occurred, and whether buying or selling dominated the leg.
Rather than asking only where price moved, this script helps answer:
where volume concentrated during the move
whether the move was supported by participation
where value developed inside the structural range
how buy and sell volume were distributed across price
Each profile is built from lower timeframe data so that the structural leg can be broken into price levels and analyzed internally.
🔹What it shows
🔸Market Structure
The script identifies major structural events and labels them as:
BoS
CHoCH
Profiles to be tied directly to meaningful structural transitions.
🔸Volume Profile by Structure
Each completed structural leg gets its own profile, showing:
buy volume at each level
sell volume at each level
total participation across the leg
the internal shape of the auction
This makes it easier to compare continuation legs against reversal legs.
You can color BoS and CHoCH generated profiles distinctly. Making it easier to trach where each profile sits inside broader market action.
🔸Point of Control (POC)
The script can display the POC of each structural profile, showing the price level with the highest traded volume during that leg.
The script can also display the Value Area for each profile, helping identify where the majority of volume was concentrated during the structural move.
🔸CVD
The script tracks Cumulative Volume Delta throughout the current structure and plots it in the pane.
CVD can be reset by:
CHoCH
BoS + CHoCH
Day
Week
This makes it possible to study delta behavior in a structural context rather than only in a session-based one.
🔸Structure Stats
Optional structure statistics can be displayed, including:
Range
High
Low
Buy volume
Sell volume
Delta
Return
This gives a summary of the completed structural move.
🔸Why use it
This script is designed for traders who want to combine:
market structure
volume profiling
delta/CVD
auction logic
Because profiles are anchored to structure instead of session time, they can help reveal differences between:
strong continuation legs
weak continuation legs
reversal legs
imbalanced breakouts
balanced rotations
🔸Mini Profiles
The indicator has two separate drawing methods for each VP.
The detailed profile is used when the structural move has enough bar data to create a detailed profile.
When not enough data exists, a mini profile is used. You can select only to use mini profiles if you prefer the style.
The internal logic to calculate each volume profile is similar. However, the detailed profile "scrunches" when not enough bar data exists to calculate it on - that's when mini profile takes over.
🔸Split Profile
You can also choose to show split volume profiles.
This is more similar to how a delta profile is shown. This is a styling preference only.
Rows Limit
Detailed profiles can use up to 500 rows.
Higher values were giving a "response too large" error, so I restricted the max to 500.
🔹Summary
That’s about it!
The goal of this script is simply to combine market structure with volume profiles and CVD so you can see how volume develops inside each structural move instead of across arbitrary time windows.
By anchoring profiles to BoS and CHoCH, you can study how participation builds during continuations, reversals, and rotations - and get a better feel for how each move was actually formed internally.
Hope you find it useful (:
Thank you guys and thank you TradingView!
Liquidity Thermal Map [BigBeluga]🔵 OVERVIEW
Liquidity Thermal Map visualizes where the highest traded volume has accumulated across price levels over a fixed lookback period.
Instead of plotting classic volume profiles with bars, the indicator builds a horizontal thermal heatmap directly on the chart, highlighting areas of strong and weak liquidity using smooth color gradients.
This makes it easy to identify high-interest price zones, volume clusters, and the dominant Point of Control (PoC) at a glance.
🔵 CONCEPTS
Price-Level Volume Aggregation — The indicator divides the entire price range of the selected lookback period into fixed horizontal bins.
Volume Binning — Each bin accumulates total traded volume whenever price closes near its midpoint.
Thermal Gradient Mapping — Volume intensity is translated into a color gradient, forming a continuous liquidity heatmap.
Point of Control (PoC) — The price level with the highest accumulated volume is highlighted using a distinct PoC color.
🔵 FEATURES
Liquidity Heatmap — Displays horizontal volume concentration directly on the chart background.
Fixed Resolution Bins — Uses 30 evenly spaced price levels to maintain a clean and readable structure.
Adaptive Lookback Period — Volume is calculated only within the user-defined historical window.
Two-Stage Color Gradient —
• Low volume → transparent / muted tones
• High volume → stronger, warmer colors
PoC Highlighting — The most traded price level is emphasized with a dedicated PoC color and volume label.
Range-Aware Scaling — Automatically adapts to the highest and lowest prices within the lookback period.
🔵 BUY / SELL LIQUIDITY SCALE
Directional Liquidity Breakdown — The vertical scale on the right side summarizes how total traded volume is distributed between bullish and bearish candles within the analyzed range.
Buy Liquidity (Green) — Represents the total traded volume during candles that closed higher than they opened.
This approximates aggressive buying pressure and shows how much volume has accumulated below the current price.
Sell Liquidity (Red) — Represents the total traded volume during candles that closed lower than they opened.
This reflects periods where selling pressure dominated and shows how much volume accumulated above the current price.
Liquidity Percentage — Each side displays the percentage share of total traded volume.
This helps quickly identify which side of the market controlled the majority of activity within the lookback range.
Volume Imbalance — The Imbalance value at the top shows the absolute difference between total buy and sell liquidity.
A larger imbalance suggests stronger directional dominance from either buyers or sellers.
Interactive Hover Details — Hovering over the liquidity bars reveals a tooltip showing the exact accumulated volume for that section (for example total liquidity below the current price).
This allows traders to quickly inspect how much volume has been concentrated on each side of the market.
Visual Pressure Gauge — The vertical red/green bar acts as a quick visual gauge of market pressure, allowing traders to instantly see whether buyers or sellers dominate liquidity within the selected range.
PoC Highlighting — The most traded price level is emphasized with a dedicated PoC color and volume label.
🔵 HOW TO USE
Identify Liquidity Clusters — Bright or dense zones indicate prices where significant trading activity occurred.
Support & Resistance Context — High-volume zones often act as reaction areas for price.
PoC Tracking — The PoC shows where the market spent the most time and volume.
Breakout Awareness — Moves away from dense liquidity areas may signal expansion into lower-volume zones.
Contextual Analysis — Use the heatmap as a background liquidity reference alongside trend or structure tools.
🔵 VISUAL LOGIC
Cooler Colors — Lower volume participation.
Warmer Colors — Higher volume concentration.
PoC Label — Displays the exact volume value of the strongest liquidity level.
🔵 CONCLUSION
Liquidity Thermal Map provides a clean, intuitive way to visualize where liquidity truly exists across price.
By transforming raw volume data into a continuous thermal layer, it helps traders quickly locate dominant trading zones, identify high-interest price levels, and better understand how volume is distributed within the market.
VIX Curve Pro - Real-Time Term Structure with StatisticsThis indicator displays the VIX term structure as a spatial curve directly on the chart, allowing you to instantly identify whether the volatility market is in contango or backwardation.
It shows the relationship between different VIX maturities (9D, 30D, 3M, 6M, 1Y) as a single curve.
It also shows some statistics and helps with market detection:
Historical percentile rankings for key VIX ratios
Real-time min/max/average/median values over lookback period
Current VIX term values with regime indicators
Understand where current conditions sit relative to historical context
Automatic identification of contango vs backwardation states
Visual indicators showing which part of the curve is inverted
Optional information guide explaining market states and trading implications
How to Use:
The curve shows the "shape" of volatility expectations across time. An upward-sloping curve (contango) means calm markets where longer-term volatility is priced higher than near-term. A downward-sloping curve (backwardation) shows market stress, where near-term volatility spikes above longer-term expectations.
Use the statistical tables to understand whether current ratios are at historical extremes (high percentile rank) or lows (low percentile rank), helping you gauge whether volatility structures are stretched or compressed.
Perfect for:
Volatility traders and options strategists
VIX futures and options traders
Understanding market fear and complacency levels
Timing volatility trades based on term structure
In the example above, I've added a chart with TVC:VIX , CBOE:VIX9D , CBOE:VIX3M and $CBOE:VIX6M. It is possible to see that although they are still in backwardation (short term vix is lower than long term), it might be close to flip. This kind of situation deserve extra attention. You can set alerts to when it flips.
This is a simple but useful indicator. Let me know if you have any questions!
Stop Loss Cascades (Breakouts) [Kioseff Trading]Hello friends and traders!
🔹Introduction
This indicator " Stop-Loss Clustering (Breakouts) " attempts to model trader stop-loss placement logic and identify price areas where a large amount of stop losses might cluster.
The idea is, if stop losses are indeed highly concentrated in a specific area, price extending through that area may produce high-velocity breakout conditions via forced order flow .
I'll cover this topic more thoroughly throughout the description. For now, just know that stop loss location & size data is not publicly available . Any model of their concentration locations is highly assumptive.
However, there's some reasonable academic research we can reference to make worthwhile estimates.
Academic references supporting the concepts discussed are listed at the end of this description. To maintain readability, I won't cite individual statements inline.
🔹The Premise
🔸Liquidity, Behavior, and Stop Cascades
Markets operate through a continuous limit order book , where two fundamental order types interact:
Limit orders , which provide liquidity by resting in the book
Market orders , which consume liquidity by exhausting those resting orders
This mechanical interaction drives price movement - incoming order flow consuming available liquidity .
This begs the question.. Does liquidity distribute evenly across the LOB?
If it did : If liquidity were evenly distributed, price impact could be modeled as a relatively smooth function of incoming order flow.
But it doesn’t : Liquidity is unevenly distributed. Academic research supports this claim and, regardless, this is an intuitive conclusion most traders arrive at.
Liquidity forms localized concentrations and gaps.
Liquidity concentrations are commonly referenced as: liquidity shelves , liquidity clusters , liquidity zones .
Liquidity gaps are commonly referenced as: liquidity vacuums , thin book zones .
As a result, identical order flow can produce very different price movements depending on the state of the order book.
Let’s consider an example..
Assume price is trading at $99.
The price levels $100, $101, $102 have resting sell limit order concentrations of 100.
This is where you come in.
You execute a market order buy for 300 size.
Your order first exhausts all sell-side resting order concentrations at the $100 level.
You still have 200 size that needs to be filled, and the ask price has moved from $100 to $101.
Your order will now sequentially exhaust available liquidity at the $101 level, the ask price will increase to $102, and your final 100 size will exhaust the $102 level.
To keep the example simple, we’ll say that your order moved price from $99 to $102, and now the ask price is $103.
But, you still want to accumulate.
The nearest sell-side levels in the LOB are $103, $104, $105.
The $103 level has a sell limit order concentration of 500.
$104 and $105 both have concentrations of 50.
You execute your same market order buy for 300 size.
This time, price doesn’t move.. At all..
Instead, you consumed 300 of the 500 size at $103 with your order, and the level remains a barrier.
Your order was absorbed by available liquidity.
This example demonstrates how price movement depends on available liquidity , not simply the size of incoming orders.
In the first scenario, liquidity was thin and the order walked through multiple price levels, causing price to move quickly.
In the second scenario, a large concentration of resting liquidity absorbed the same order, preventing price from advancing.
🔸Liquidity Does Not Distribute Evenly
Alright, we understand that liquidity doesn’t distribute evenly. And we understand that high concentrations of liquidity can act as price barriers (liquidity shelves) while sparse liquidity can permit rapid price movement - we saw this in our example above.
There’s an important question we should ask next before we move on..
If liquidity distributes unevenly, then where does it tend to cluster? And where does it tend to thin?
Of course, knowing these tendencies provides multi-purpose advantages.
If price approaches a liquidity vacuum - a local block of the order book with thin resting liquidity - rapid price movement can occur without requiring unusually strong aggressive order flow.
If price approaches a liquidity shelf - a local block of the order book with thick resting liquidity - price can stall or contract even if the same level of aggressive order flow that previously moved price continues.
With this in mind, order flow intensity alone does not determine price movement . The distribution of liquidity across surrounding price levels plays a similarly important role.
So, is there any evidence of where liquidity tends to concentrate ?
🔸Empirical Observations
Empirical research on limit order books shows that liquidity does not distribute smoothly across the LOB . Instead, depth tends to concentrate at specific price levels, producing irregular profiles with localized peaks in resting liquidity.
These concentrations arise because order placement is not random . Traders frequently anchor decisions to widely observed reference prices such as:
• prior highs
• prior lows
• round numbers
• widely referenced price extremes
Because many traders monitor the same price history, order placement decisions often reference similar price levels.
This concept is simpler than it sounds.
Let’s use market structure traders for example.
Market structure traders frequently reference prior swing highs and swing lows when making decisions about entries, exits, and risk.
A trader entering a long position may place their stop-loss below a recent swing low , reasoning that if price breaks that level, the trade idea is invalidated.
A trader entering a short position may place their stop-loss above a recent swing high for the same reason.
Timeframe price aggregation may differ; however, we’re all looking at roughly the same recent highs and lows when evaluating a chart (structure).
When many traders collectively reference the same prices, orders may accumulate near those levels. This produces localized depth concentrations, which traders refer to as liquidity shelves .
Liquidity shelves act as temporary barriers where the book contains disproportionately large resting liquidity compared to surrounding prices.
🔸Research documenting liquidity clustering includes :
Bourghelle & Cellier (2007) , who find that limit orders cluster at prominent price levels (especially round numbers), creating localized depth concentrations that can act as price barriers.
Kavajecz & Odders-White (2004) , who demonstrate that prices identified as support or resistance coincide with higher resting limit order depth
These findings suggest that many commonly observed price levels may correspond to real concentrations of liquidity rather than being purely visual artifacts on a chart.
Kavajecz & Odders-White (2004) is an important observation for support/resistance traders!
Kavajecz & Odders-White (2004) show that levels traders commonly call support and resistance often align with areas where more limit orders are resting in the order book.
This suggests a plausible mechanical pathway through which support and resistance levels can emerge!
🔸Liquidity Shelves and Price Interaction
When liquidity clusters around a price level, the resulting liquidity shelf can influence how price behaves when it approaches that area.
Price interaction with these shelves is state-dependent :
If incoming order flow is absorbed, price may stall or reverse
If resting liquidity is consumed, price may transition rapidly to the next liquidity zone
Once a shelf is depleted, follow-through can accelerate due to thinner liquidity beyond the level
Research on order book dynamics supports this mechanical view of price movement.
For example:
Jean-Philippe Bouchaud, J. Doyne Farmer, and Fabrizio Lillo (2009) demonstrate that price impact emerges from the interaction between order flow and finite liquidity
From this perspective, price does not move simply because a level is crossed.
Price moves because available liquidity at that level has been consumed.
🔸Latent Liquidity and Stop Clustering
In addition to visible liquidity from limit orders, markets also contain latent liquidity .
This is where ”Stop-Loss Clustering (Breakouts)” becomes important - we’re almost done!
Latent liquidity consists of conditional orders such as stop-losses that are not visible in the order book until triggered .
Although these orders aren’t public information, empirical studies show that stop orders tend to cluster near widely referenced price levels .
Research by Carol Osler (2001, 2002) using institutional FX order data finds that stop-loss orders frequently accumulate just beyond salient price levels such as prior highs and lows.
When these stops trigger, they convert into aggressive market orders and can generate bursts of directional order flow that may accelerate price movement.
🔸Stop-Loss Cascades
Stop losses add another layer of latent order flow that isn’t visible in the order book until it triggers.
If enough of them sit around the same price area.. Think “hidden pressure” waiting to activate. Nothing happens while price trades nearby, but once that level is traded at, those stops convert into market orders and immediately begin consuming available liquidity.
This matters because stop placement is unlikely to be random in most instances. Traders frequently anchor stops to widely observed prices such as prior highs, prior lows, or other prominent structure points, or use volatility methods such as ATR, etc.
So when price approaches one of these areas, two things can happen.
If the resting liquidity there is large enough, the incoming orders can be absorbed and price may stall or reject.
But if that liquidity gets consumed, the stops sitting just beyond the level begin triggering. Those triggered stops add additional market orders, which consume more liquidity and can push price further into the next layer of stops.
This creates a cascading effect:
price reaches a stop cluster
stops trigger and convert into market orders
liquidity gets consumed faster
price moves further, triggering more stops
When this chain reaction starts, price can transition very quickly from a slow battle near the level to rapid expansion through it.
This is one of the mechanical reasons why some reference-point breaks barely move, while others accelerate rapidly.
🔹How It Works
Now that we understand the why - let’s discuss how the indicator works.
🔸Absorbtion Extremes
The image above shows the absorption extremes model.
In this model, the indicator treats recent & relevant swing points as plausible stop clustering candidates.
You can find similar swing point identification mechanics in other indicators.
However, this model assigns subsequent volume to the swing level after its formation.
There are limitations and assumptions - let’s go over them.
The images above explain how the indicator determines the intensity of a possible stop-cluster around a swing level.
There are limitations and assumptions
1: The indicator assigns all “directional volume” to a swing level after it’s formed and while it remains the closest active swing point to the current price.
“Buy volume” is assigned to the closest active swing low.
“Sell volume” is assigned to the closest active swing high.
I say “buy volume” and “sell volume” because there’s assumptions on what constitutes the relevant classification.
The indicators follow the traditional two-region tick model for classifying buy volume and sell volume.
Higher close = “buy volume” proxy
Lower close = “sell volume” proxy
Depending on the granularity you select (the indicator is capable of using tick data), this model can be more/less accurate.
However, even with tick-level data and bid/ask quotes, trade direction must still be inferred using classification rules. Because some trades occur inside the spread or involve hidden liquidity, perfect classification is not possible without exchange aggressor flags.
For assumptions..
The model assigns ALL classified volume to the swing level.
In reality, traders use a wide range of risk management methods, and not every position will place a stop loss directly at the most recent swing point. ATR-based stops, percentage-based stops, and other volatility-based methods are also common.
Because the true distribution of stop placement is unobservable, the model assumes that positions entered are structurally invalidated at the closest swing level based on their classified direction.
As a result, the values displayed by the indicator should be interpreted as relative proxies for potential stop concentration, rather than precise estimates of actual stop-loss size.
The displayed magnitudes are intentionally exaggerated and comparative, designed to highlight where stop pressure may accumulate relative to other levels.
The images above show how to interpret the indicator when using this model.
The image above shows the triggered stop-cluster graph.
Each point corresponds to a triggered stop-cluster - assuming it exists.
The greater the size attached to that cluster, the further distant the data point is placed.
Far away from zero line = large size.
Close to zero line = low size.
Radiating/glowing points indicate a potentially large cluster trigger.
🔸 Volatility-At-Entry Model (Time Scaled)
The Volatility-At-Entry model uses ATR scaled by various timeframes to predict plausible stop loss placements.
For this model, the indicator uses the same tick classification model to assign volume directionally.
Volume is then dispersed across six common timeframes (1m, 5m, 15m, 30m, 1h, 4h) and 3 common ATR multiples for risk management (1ATR, 1.5ATR, 2ATR).
This model assumes traders are entering positions across various timeframes and are scaling risk congruent with those timeframes.
For instance,
A trader using the 1-minute chart for opportunity is more likely to use a stop loss closer to entry than a trader using the 4-hour chart for opportunity.
If this assumption is reasonable to you - great, we can move forward!
The image above visualizes the model.
Purple-shaded regions indicate a price area with less opportunity for stop loss clustering. Either transaction intensity around eligible price areas was low, or position accumulation wasn’t given sufficient time.
Pink-shaded regions indicate a price area with greater opportunity for stop loss clustering. Volume was significant around these regions or price has traded within proximity for extended periods.
This model naturally shows more future opportunity than historical outcomes. You can select to show historical outcomes in the settings, this image shows examples of such outcomes.
The image above shows the triggered stop loss graph in effect for this model. Stop clustered are distributed across more price areas with this model - from low intensity to high intensity. Therefore, a cluster is almost always “triggering” to some degree.
A classification model for what’s typical and what’s unusual is used for the graph in this case. Radiating points always indicate large stop clusters triggered. Anything within the green/pink line indicates usual size.
Typical Move
The image above explains the nearest cluster information table.
The size and location of the nearest buy-stop cluster and sell-stop cluster are recorded.
Additionally, the indicator identifies whether clusters of similar size were triggered in the past, and how price behaved following those events.
Since all models here are highly assumptive, and similar sized clusters might only have one or two relative neighbors, treat these measurements as a description of history rather than a prediction.
The model takes the logarithm of the current stop-volume (buy or sell) to normalize its scale and compare it with a historical dataset of previously observed stop-volume sizes that have also been log-scaled.
It then identifies historical observations whose sizes are most similar to the current value, either by selecting all observations within a tolerance range around that value (where the range is based on the typical spacing between historical observations), or by selecting the single closest match.
Finally, the model retrieves the historical price moves associated with those matched observations, producing a sample of “typical moves” that occurred when stop-volume magnitude was similar to the current situation.
Ratio Meter
The stop-cluster ratio meter shows the current sum of active and triggered all buy-side clusters and sell-side clusters.
This meter is useful for quick scanning across assets to see if active or recently triggered stop clusters are lopsided.
Additional Features
The single most important setting outside model selection is the lower timeframe used to retrieve volume from.
This setting is set to 1-minute data by default because it works with paid and free plans. If you want better granularity, I strongly suggest changing this setting to either 1-second or 1-tick. This will sacrifice the number of identifiable cluster locations, because better granularity data has less programmatically retrievable values.
🔹Closing Remarks
Stop-loss clustering is an appealing concept because it offers a plausible explanation for why some breakouts accelerate so quickly while others stall. When a large number of conditional orders sit near the same price, a breakout through that area can trigger a cascade of market orders that rapidly consume liquidity and push price toward the next available zone.
However, it’s important to remember that the models used in this indicator are approximations, not direct measurements. True stop-loss locations and sizes are not publicly observable, and many traders use different risk management techniques that cannot be perfectly inferred from chart data alone. The goal of this indicator is therefore not to identify exact stop locations, but to highlight price areas where stop pressure may plausibly accumulate relative to surrounding levels.
Like any model based on behavioral assumptions and historical observations, results should be interpreted probabilistically. Large clusters do not guarantee breakouts, and small clusters do not guarantee quiet price behavior. Instead, the indicator is best used as a tool for context and situational awareness.
References
General Microstructure and Price Formation
Madhavan, A. (2000). Market microstructure: A survey. Journal of Financial Markets, 3(3), 205–258.
O'Hara, M. (1995). Market Microstructure Theory. Blackwell.
Biais, B., Glosten, L., & Spatt, C. (2005). Market microstructure: A survey of microfoundations, empirical results, and policy implications. Journal of Financial Markets, 8(2), 217–264.
Limit Order Books and Liquidity as Resting Orders
Gould, M. D., Porter, M. A., Williams, S., McDonald, M., Fenn, D. J., & Howison, S. D. (2013). Limit order books. Quantitative Finance, 13(11), 1709–1742.
Rosu, I. (2009). A dynamic model of the limit order book. Review of Financial Studies, 22(11), 4601–4641.
Biais, B., Hillion, P., & Spatt, C. (1995). An empirical analysis of the limit order book and the order flow in the Paris Bourse. Journal of Finance, 50(5), 1655–1689.
Liquidity Clustering and Depth Concentration
Kavajecz, K. A., & Odders-White, E. R. (2004). Technical analysis and liquidity provision. Review of Financial Studies, 17(4), 1043–1071.
Bourghelle, D., & Cellier, A. (2007). Limit order clustering and price barriers on financial markets. Working paper / SSRN.
Order Flow and Price Impact
Bouchaud, J.-P., Farmer, J. D., & Lillo, F. (2009). How markets slowly digest changes in supply and demand. In Handbook of Financial Markets: Dynamics and Evolution.
Stop Orders and Price Cascades
Osler, C. L. (2003). Currency orders and exchange-rate dynamics: Explaining the success of technical analysis. Journal of Finance, 58(5), 1791–1819.
Osler, C. L. (2005). Stop-loss orders and price cascades in currency markets. Journal of International Money and Finance, 24(2), 219–241.
Liquidity Provision and Execution
Ho, T., & Stoll, H. (1981). Optimal dealer pricing under transactions and return uncertainty. Journal of Financial Economics, 9(1), 47–73.
Almgren, R., & Chriss, N. (2000). Optimal execution of portfolio transactions. Journal of Risk, 3(2), 5–39.
Menkveld, A. J. (2013). High frequency trading and the new market makers. Journal of Financial Markets, 16(4), 712–740.
Behavioral Anchoring and Attention
Kahneman, D., & Tversky, A. (1974). Judgment under uncertainty: Heuristics and biases. Science, 185(4157), 1124–1131.
Barber, B. M., & Odean, T. (2008). All that glitters: The effect of attention and news on the buying behavior of individual and institutional investors. Review of Financial Studies, 21(2), 785–818.
George, T. J., & Hwang, C. Y. (2004). The 52-week high and momentum investing. Journal of Finance, 59(5), 2145–2176.
Mizrach, B., & Weerts, S. (2007). Highs and lows: A behavioral and technical analysis. SSRN working paper.
Swing Profile [BigBeluga]🔵 OVERVIEW
Swing Profile is a dynamic swing-based volume profiling tool that builds a complete volume profile for each completed market swing.
Instead of using fixed sessions or time ranges, the indicator anchors its profile strictly between confirmed swing highs and swing lows, allowing traders to analyze where volume accumulated inside each directional leg.
The profile updates in real time while a swing is still forming and finalizes once the swing direction flips, giving both historical and live insight into volume behavior.
🔵 CONCEPTS
Swing-Anchored Profiling — Volume is calculated only between confirmed swing highs and lows detected by the Swing Length input.
Directional Legs — Each bullish or bearish swing leg gets its own independent volume profile.
ATR-Adaptive Bins — Profile bin size is automatically scaled using ATR, keeping resolution consistent across volatility regimes.
Real-Time Rebuild — While a swing is still active, the profile continuously recalculates and redraws.
Finalized Profiles — Once direction flips, the profile is locked and marked as a completed swing.
🔵 FEATURES
Swing Volume Profile — Displays horizontal volume distribution for each swing leg.
Point of Control (PoC) — Highlights the price level with the highest traded volume inside the swing.
Buy / Sell Volume Separation — Tracks bullish (buy) and bearish (sell) volume inside each profile.
Delta Volume Calculation — Shows net buying vs selling pressure as a percentage.
Profile Outline — A polyline traces the outer shape of the volume distribution.
HeatMap Mode — Optional heatmap visualization showing volume intensity by color gradient.
ZigZag Swing Connector — Visual connection between swing highs and lows for structure clarity.
Custom Label Sizing — Adjust label size (Tiny → Huge) for clean chart scaling.
🔵 HOW TO USE
Identify High-Interest Zones — Use the PoC to locate price levels where the market spent the most time during a swing.
Trend Strength Analysis — Strong directional swings often show volume skewed toward one side of the profile.
Pullback Zones — Profiles help identify areas where price may react during retracements.
Continuation vs Reversal — Delta volume reveals whether buying or selling dominated the swing.
Live Monitoring — While a swing is forming, watch the real-time profile to anticipate where structure may complete.
🔵 DATA LABELS
T — Total traded volume inside the swing.
B — Buy volume (bullish candles).
S — Sell volume (bearish candles).
D — Delta volume (% difference between buy and sell volume).
🔵 CONCLUSION
Swing Profile delivers a precise, structure-aware view of volume by anchoring profiles directly to market swings.
By combining real-time profiling, PoC detection, delta analysis, and adaptive resolution, it provides deep insight into where participation truly occurred — making it a powerful tool for swing traders, structure traders, and volume-focused strategies.
[MAD] Gann o MaticusGannomat — Full Automated Gann Grids & Astro Cycles
Automatic Gann quadrant boxes with geometric arc projections. Cycle boundaries from standard timeframes or real planetary astronomy.
Thanks BarefootJoey, master of Astrolib
What Does This Indicator Do?
Gannomat draws a Gann quadrant box on your chart — a rectangle where the width represents a time period and the height represents a price range. Inside each box, it projects geometric arc curves from all four corners at multiple proportional levels (1x0 through 5x0, plus diagonal variants 1x1 through 5x1). These arcs create a web of curved support and resistance lines based on the time–price geometry of the quadrant.
Each time a new period begins — either a new timeframe candle or a new astronomical event — the box resets and a fresh set of arcs is drawn.
The indicator also plots pivot point markers (R3, R2, R1, PP, S1, S2, S3) as small circles whenever their values change, and draws diagonal cross lines connecting opposite corners of the box.
When using Astrocycles mode, an info table in the top-right corner shows the active planet, cycle type, current cycle duration in days, and the dates of the last and next astronomical event.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INPUT REFERENCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
General
Line Width (Default: 1) — Thickness of all drawn lines and arc curves. Increase for better visibility on higher-resolution screens.
Box Color (Default: Gray 50%) — Color of the quadrant box outline, its vertical/horizontal edges, and the diagonal cross lines.
Gann Circles Color (Default: Blue) — Color reserved for Gann circle overlays.
Cleanup Old Drawings (Default: On) — When enabled, previous box and arc drawings are removed when a new period starts. Turn off if you want to keep all historical boxes visible.
Time Settings
Timeframe / Cycle (Default: 1 Day) — This is the most important setting. It controls how wide each Gann box is.
Available options:
15 Min, 1 Hour, 4 Hours, 6 Hours, 8 Hours, 12 Hours — Intraday periods. Use these on lower timeframe charts (1m–15m–1H).
1 Day — One trading day. The most common starting point.
1 Week, 2 Weeks, 3 Weeks, 4 Weeks — Weekly periods. Good for swing trading on daily charts.
1 Month, 3 Months, 6 Months — Monthly/quarterly periods. Use on daily or weekly charts for longer-term analysis.
Astrocycles — The box width is no longer a fixed timeframe. Instead, each new box begins when a specific planetary event occurs (configured in Astro Settings). The box width varies from cycle to cycle based on the actual interval between consecutive events.
Astro Settings
These settings only take effect when Timeframe / Cycle is set to Astrocycles .
Astro Planet (Default: Moon) — Which celestial body drives the cycle timing. Each planet has a different orbital period, producing cycles of different lengths:
Moon — ~27 days per cycle. Fast cycles, good for daily charts.
Mercury — ~88 days. Short inner-planet cycles.
Venus — ~225 days. Medium cycles.
Mars — ~687 days (~1.9 years). Good for weekly charts.
Jupiter — ~12 years. Long-term cycles for monthly charts.
Saturn — ~29 years. Very long-term structural cycles.
Uranus, Neptune, Pluto — Multi-decade to multi-century cycles. For the longest-term analysis.
Astro Cycle (Default: High Latitude) — The type of astronomical event that marks the start of each new period:
High Latitude — The planet reaches its maximum ecliptic latitude (furthest above the ecliptic plane). Works for all planets including Moon.
Low Latitude — The planet reaches its minimum ecliptic latitude (furthest below the ecliptic plane). Works for all planets including Moon.
High Longitude — The planet reaches a stationary point where its geocentric longitude stops increasing and begins to decrease (start of retrograde motion). This is the retrograde station . Not applicable to Moon.
Low Longitude — The planet reaches a stationary point where its geocentric longitude stops decreasing and begins to increase again (end of retrograde / start of direct motion). This is the direct station . Not applicable to Moon.
Heliocentric Conjunction — Earth and the selected planet are aligned on the same side of the Sun (0° heliocentric separation). Not available for Moon.
Heliocentric Opposition — Earth and the selected planet are on opposite sides of the Sun (180° heliocentric separation). Not available for Moon.
Show Info Table (Default: On) — Displays a panel in the top-right corner showing: Cycle Type, Planet, Duration (days), Last Event date, and Next Event date (UTC).
Quadrant Scaling
These settings control the height (Y-axis / price range) of each Gann box.
Scale Mode (Default: Classic Pivots) — How the top and bottom price levels of the box are calculated:
Classic Pivots — The box height is defined by two pivot levels you choose (see Upper/Lower Pivot below). In standard timeframe mode, pivots are calculated from the previous period's High, Low, Close via request.security. In Astrocycles mode, pivots are calculated from the previous astronomical cycle's High, Low, Close.
Prev Cycle Range — The box height equals the High-to-Low range of the previous completed cycle. This adapts the box to actual market movement. If no previous cycle data is available yet, falls back to Classic Pivots.
Donchian Channel — The box top is the highest high and the box bottom is the lowest low over the last N bars (set by Donchian Len).
ATR Bands — The box is centered on a base price (Close, HL2, or EMA) and extends upward/downward by ATR × Multiplier. This creates volatility-adaptive boxes.
StdDev Bands — Same concept as ATR Bands but uses standard deviation instead. Similar to Bollinger Band width. The box is centered on a simple moving average.
Percentile Channel — The box top is the upper percentile of highs and the box bottom is the lower percentile of lows over the lookback period. This provides a statistical price range.
Upper Pivot (Default: R3) — Which pivot level defines the top of the box. Only used when Scale Mode is Classic Pivots. Options: R3, R2, R1, PP, S1, S2, S3.
Lower Pivot (Default: S1) — Which pivot level defines the bottom of the box. Only used when Scale Mode is Classic Pivots. Options: R3, R2, R1, PP, S1, S2, S3.
Base Source (Default: Close) — Center line for ATR Bands and StdDev Bands modes. Close uses the closing price, HL2 uses the midpoint of high and low, EMA uses an exponential moving average.
Donchian Len (Default: 20) — Lookback period in bars for the Donchian Channel highest-high / lowest-low calculation.
ATR Len (Default: 14) — Lookback period for the Average True Range calculation.
ATR Mult (Default: 2.0) — How many ATRs above and below the base price to extend the box.
StdDev Len (Default: 20) — Lookback period for the standard deviation calculation.
StdDev Mult (Default: 2.0) — How many standard deviations above and below the SMA to extend the box.
Pct Len (Default: 50) — Lookback period for the percentile calculation.
Low % (Default: 10) — Lower percentile threshold (0–49). A value of 10 means the box bottom is at the 10th percentile of lows.
High % (Default: 90) — Upper percentile threshold (51–100). A value of 90 means the box top is at the 90th percentile of highs.
Min Height (ATR Mult) (Default: 0.5) — Minimum allowed box height, expressed as a multiple of the current ATR. If the calculated box height is smaller than this, the box is expanded symmetrically around its midpoint. Set to 0 to disable. Useful to prevent collapsed or invisible boxes during low-volatility consolidation.
Pivot Colors
R3 Color (Default: Dark Green #004900)
R2 Color (Default: Medium Green #006F00)
R1 Color (Default: Bright Green #009600)
PP Color (Default: Gray #555555)
S1 Color (Default: Red #FF0000)
S2 Color (Default: Red-Pink #FF002A)
S3 Color (Default: Deep Pink #FF014A)
Each pivot level is plotted as a small circle marker on the chart whenever its value changes. The color scheme gives a visual gradient from green (resistance) to red (support).
Arc Colors
Arc Level 1 Color (Default: Orange) — Color for the smallest arcs: 1x0, 1.5x0, and 1x1.
Arc Level 2 Color (Default: Lime) — Color for 2x0 and 2x1 arcs.
Arc Level 3 Color (Default: Green) — Color for 3x0 and 3x1 arcs.
Arc Level 4 Color (Default: Teal #40826D) — Color for 4x0 and 4x1 arcs.
Arc Level 5 Color (Default: Blue) — Color for the largest arcs: 5x0 and 5x1.
Arc Inv 4x0 Color (Default: Aqua) — Dedicated color for the inverted 4x0 arc, so it can be visually distinguished from the normal (bottom-up) version.
Each arc level represents a different proportion of the quadrant. Smaller arcs (Level 1) curve tightly near the origin corner, while larger arcs (Level 5) sweep across the full box width. The "x1" variants (1x1, 2x1, etc.) are diagonal-offset versions that sit between the round-number levels.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Getting Started (Standard Mode)
Add the indicator to your chart.
Set Timeframe / Cycle to match the period you want to analyze. For example, on a 1-hour chart analyzing daily structure, choose "1 Day".
Leave Scale Mode on Classic Pivots with Upper = R3, Lower = S1 as a starting point. This gives you a box spanning from the first support to the third resistance.
Observe how price interacts with the arc curves. The arcs act as curved support/resistance levels — price often reverses or accelerates near these lines.
Adjust Upper/Lower Pivot to widen (R3/S3) or narrow (R1/S1) the box depending on volatility.
Using Astrocycles Mode
Set Timeframe / Cycle to Astrocycles .
Choose a Planet . Start with Moon for fast cycles on daily charts, or Jupiter/Saturn for long-term cycles on weekly/monthly charts.
Choose a Cycle type. High Latitude is a good general-purpose starting point since it works for all planets.
Enable Show Info Table to see the current cycle duration and event dates.
For scaling, try Prev Cycle Range — it pairs naturally with Astrocycles because it sizes each new box based on the price action of the previous planetary cycle.
Choosing a Scale Mode
Use Classic Pivots for traditional Gann analysis with well-defined pivot-based boundaries.
Use Prev Cycle Range when you want boxes that reflect actual market range — especially good with Astrocycles.
Use ATR Bands or StdDev Bands when you want the box to automatically adapt to changing volatility conditions.
Use Donchian Channel for a simple recent-range approach.
Use Percentile Channel for a statistical approach that filters out extreme spikes.
Reading the Arcs
Bottom-up arcs (normal) rise from the lower-left corner of the box. They represent potential support curves during an uptrend.
Top-down arcs (inverted) fall from the upper-left corner. They represent potential resistance curves during a downtrend.
The right-side arcs (mirrored from the right corners) appear in the current box via polyline drawing, creating the full four-corner Gann circle pattern.
When multiple arcs from different levels converge at the same point, that creates a confluence zone — a stronger potential reaction area.
The diagonal cross lines show the direct price-time relationship (1:1 ratio) across the box.
Tips
If boxes appear too flat or collapsed, increase Min Height (ATR Mult) from 0.5 to 1.0 or higher.
The chart timeframe should be lower than the selected period. For example, use a 1H chart with a 1 Day period, or a Daily chart with a 1 Week period. This ensures enough bars exist within each box for the arcs to render smoothly.
For Heliocentric Conjunction/Opposition cycles, remember these are only available for planets other than the Moon. These cycles correspond to synodic periods (the time between successive alignments as seen from the Sun).
High/Low Longitude cycles detect retrograde and direct stations — moments when a planet appears to change direction in the sky. These are astronomically significant turning points often studied in financial astrology.
Breakout Volume Delta | Flux ChartsGENERAL OVERVIEW:
Breakout Volume Delta is an indicator that measures breakout strength using lower-timeframe volume delta. It estimates buyer vs. seller participation within the breakout candle by summing bullish and bearish sub-candle volumes, then visualizes that dominance by splitting the candle body into bullish and bearish segments.
https://www.tradingview.com/x/UuFy5eif/
What is the theory behind the indicator?:
Breakouts often look strong on price alone, but their quality depends on participation. A breakout candle that is driven by dominant buying or selling pressure is generally more meaningful than a breakout candle that forms with mixed or weak participation.
This indicator gauges participation using lower timeframe volume delta. It breaks the current candle into lower timeframe sub-candles, sums volume on bullish sub-candles as bullish volume, and sums volume on bearish sub-candles as bearish volume. Those totals are converted into dominance percentages.
The breakout candle is then visualized using a split-body overlay: the portion sized by the dominant side is shown in the breakout color, and the remaining portion is shown as the opposite side. This makes it easy to judge whether the breakout candle was supported by real directional participation or if the opposite side was active inside the same candle.
Bullish dominant breakout candle:
Bearish dominant breakout candle:
FEATURES:
🔹Swing Left and Right
Controls how many swing-timeframe candles are required on the left and right side to confirm a swing point before a level is drawn. Higher values reduce noise by requiring stronger confirmation. Higher values increase confirmation delay because more candles are needed to validate the pivot.
🔹Swing Timeframe
Selects the timeframe used to detect swing levels. Default setting uses the chart timeframe. Creates each swing timeframe candle by combining the smaller candles inside it, then tracks the highest high and lowest low made during that period. Saves the exact time when those highs and lows happened so levels can be placed accurately on lower timeframes.
Swing levels detected on a higher timeframe and shown on a lower timeframe chart:
🔹Volume Delta LTF
Selects the lower timeframe used to estimate buy vs sell participation inside each breakout candle.
Bull volume sums volume from sub-candles where close is above open.
Bear volume sums volume from sub-candles where close is below open.
Converts those totals into bullish and bearish dominance percentages.
Volume delta label showing bullish and bearish dominance:
🔹Breakout by
Controls how a swing level is considered broken.
Wick mode confirms a break when the wick crosses the level.
Close mode confirms a break only when the candle closes beyond the level.
Close breakout:
Wick breakout:
🔹Show Nearest
Limits how many of the most recent swing levels remain visible on the chart. Deletes older levels once the stored level count exceeds the chosen number.
Only the most recent swing levels shown on the chart:
🔹Breakout Volume Filter
Optional filter that only validates a breakout if the breakout candle shows enough dominance from the breakout side.
Bullish breakouts require bullish dominance to exceed the threshold.
Bearish breakouts require bearish dominance to exceed the threshold.
If the filter fails, the affected level is removed instead of being marked as broken.
Bullish breakout with Breakout Volume Filter activated:
Bearish breakout with Breakout Volume Filter activated:
🔹Unmitigated Levels
Controls how live (unmitigated) swing levels are drawn. Users can customize the Line style, thickness, and colors for live levels.
Live levels shown with unmitigated styling:
🔹Broken Levels
Controls how a level looks after it breaks and locks it to the breakout bar. Switches the level to broken style, width, and color, and stops extending and ends at the breakout candle time.
🔹Volume Delta
Controls the colors used for bullish and bearish dominance on the split-body overlay.
🔹Extend Levels
Controls how far levels extend forward when Extend Right is disabled.
🔹Extend Right
When enabled, levels extend all the way to the right instead of stopping at a fixed future point.
🔹Volume Delta Labels
Optional volume delta labels that print bullish and bearish volume with dominance percentages on breakout bars.
Shows bull and bear volumes plus percentages.
Places label above bullish breakouts and below bearish breakouts.
UNIQUENESS:
Breakout Volume Delta is unique because it visualizes breakout strength directly on the breakout candle using lower timeframe buy vs sell dominance, instead of relying on price action alone.
Breakout strength is shown inside the breakout candle by splitting the body into bullish and bearish participation segments.
Lower timeframe activity is mapped onto the higher timeframe candle so dominance is visible exactly where the breakout happened.
Swing levels provide breakout context, while the split-body overlay explains how much real participation supported the move.
Chart-clean design keeps the display readable by limiting how many levels remain on screen.
HTF Floating Candles w/ Volume Footprint [theUltimator5]This indicator is designed to pull higher-timeframe candles outside of the chart, and add the footprint volume data to give a complete snapshot of the Higher Timeframe (HTF) trading range and volume data without cluttering your view.
IMPORTANT!
This uses the new request.footprint() call, which may make this indicator only available to premium TradingView users.
The request.footprint() doesn't assume all buy volume or all sell volume based on the direction of a candle, but instead uses actual footprint information to construct the volume footprints.
Instead of forcing you to mentally reconstruct the most recent daily (or weekly/monthly) candle(s) while watching lower-timeframe price action, this script draws floating HTF candles to the right side of the chart and updates it live as the higher-timeframe bar develops. The default number of HTF candles is 1, but you can add up to 10 HTF candles.
It also builds a row-by-row volume distribution across the active HTF candle price range and separates it into buy-side vs sell-side volume, displayed on opposite sides of the candle. This gives you a quick visual read on where volume has been concentrated inside the higher-timeframe structure — not just where price traveled.
If you don't like seeing buy and sell volume on separate sides of the candles, you can stack them all on the left side like traditional volume footprint indicators.
You can also plot the horizontal lines backwards on the chart to show where the high and low points for the candle occurred.
If you want more than 1 HTF candle, you can plot multiple. The volume footprint shows the volume profile of the entire plotted HTF candle range.
You can configure the following display options:
Position and size of HTF candles
Number of HTF candles
HTF timeframe
Volume profile layout style
Number of volume profile bars
Width of volume profile bars
Colors & transparency
Horizontal high/low toggle
This indicator isn't a standalone trading indicator, but it is a visualization enhancement tool to give you a clean picture of the higher timeframe's price and volume data without the clutter.
Earnings Snapshot [Trendoscope]🎲 Overview
The Earnings Snapshot is a custom indicator designed to provide traders and investors with a quick, visual overview of a stock's earnings performance and its impact on price action. This tool automates the analysis of earnings reports by fetching historical and future earnings data, calculating growth metrics for both earnings and price changes, and presenting the information in an intuitive table format on the chart. It also adds interactive labels at key earnings dates for detailed breakdowns.
During the earning season, I was trying to understand the earnings and revenue growth of microsoft in comparison with thier price growth. This involved tidious process of taking scereenshot of multiple earning reports and then drawing correlations between them.
This script eliminates the tedium of manual data gathering and visualization. It focuses on key metrics like actual vs. estimated earnings, year-over-year (Y2Y) comparisons, and future estimates, while highlighting how these events correlate with price movements. Currently, the script handles earnings per share (EPS) data effectively, but revenue details are not included due to ongoing technical challenges with the available data interfaces in Pine Script. Future updates may incorporate revenue analysis once we find an effective way to present this data.
This indicator is ideal for fundamental analysis, earnings season preparation, or post-earnings reviews, helping users spot patterns such as earnings surprises, growth trends, or price reactions.
🎲 Key Features
Earnings Data : Retrieves actual, estimated, and standardized EPS from TradingView's built-in request.earnings function.
Growth Calculations : Computes percentage changes in earnings and price compared to the previous quarter (Last), year-over-year (Y2Y, based on 4 quarters back), and future estimates.
Visual Table Display : A customizable table in the top-right corner showing dates, growth percentages, and color-coded indicators (lime for positive growth, orange for negative).
On-Chart Infomration : Based on the settings, users can enable presentation of earnings, price and the growth data on chart.
Historical Depth : Configurable history lookback (up to 24 quarters) to analyze past earnings.
Tooltip Mode: For a cleaner chart, labels show a score summary with full details available on hover.
Future Earnings Integration: Includes upcoming EPS estimates and their projected growth from the last actual earnings.
🎲 Display Modes
🎯Tooltip Mode
If we select tooltip mode, it is better to chose the label size as either large or huge for better visibility. In tooltip mode, the data is not directly presented on the screen. Instead, we display the calculated score on the earnings release bar. The earnings and price growth info will show up upon hovering on the printed score value.
🎯Text Mode
In case of text mode, all the calculated earnings and price growth data is printed directly on the chart. This will provide easier access to the data. However, it fills the chart. It is usefull for people who do not use additional indicators on the same chart or someone who trades mainly based on the earnings reports.
🎯Tabular Data
Tabular data presents the growth of Earnings and Price based on last quarter as well as Y2Y along with growth of estimated earnings. The table can be hidden through input settings.
🎲 Diving Deep
🎯Information Gathered and Presented
At present, we have tried collating and presenting following information for every earnings.
Q2Q Earnings Growth
Q2Q Price Growth
Y2Y Earnings Growth
Y2Y Price Growth
Q2Q Future Estimated Earning Growth
🎯 Calculation of Score and Color coding
When in text mode, the information of earnings and price growth are printed on the chart completely. These displays are color coded based on a calculated score. You can also see the score directly on the chart when the display mode is tooltip mode. Let us try to understand how this score is calculated.
Score is nothing but combination of different factors of price and earnings growth. Following conditions are considered for the calculation.
If Earnings growth is positive, add 1 else reduce the score by 1
If price growth is positive, add 1 else reduce the score by 1
If Earnings growth percent is higher than price growth percent, then add 1, else reduce the score by 1
Similar calculations are repeated for Y2Y earning and price growth. Finanlly the score also looks at if the future estimated earning is expected to increase from current actual earnings or is it expected to reduce.
Since there are 7 factors, the score can vary from -7 to +7. Higher the score, the greener the text background will be and lesser the score, the text background will turn more towards red.
🎯 Limitations
Assumes quarterly earnings; irregular reporting schedules may affect Y2Y accuracy.
Historical depth is limited to 24 quarters to avoid performance issues, but can be adjusted.
Works best on daily/weekly timeframes where earnings bars are visible.
No alerts or backtesting integration; this is purely a visualization tool.
🎯 Example of Interpretations
A green label with positive growth in both earnings and price suggests a strong beat with bullish reaction.
Orange cells in Y2Y might indicate slowing growth despite a recent beat.
Negative future estimates could signal caution for upcoming reports.
If you encounter issues or have suggestions, feel free to provide feedback. This script aims to streamline your manual analysis—happy trading!
Market Structure Dashboard | Flux ChartsGENERAL OVERVIEW
Market Structure Dashboard is a multi-timeframe market structure analysis indicator. It combines EMA trend detection, swing high/low tracking, market structure labels, Order Block detection, Fair Value Gap detection, liquidity sweep detection, volume analysis, volatility analysis, trading sessions, ICT killzones, a weighted trend bias system, and HTF levels into one unified dashboard. Each component is calculated independently across up to 7 configurable timeframes and displayed together in a single organized view.
(Screenshot: Full dashboard overview - all sections visible)
(Screenshot: Dashboard on a busy chart showing OB/FVG boxes, swing labels, HTF lines)
WHAT IS THE THEORY BEHIND THIS INDICATOR?
The core idea is that a trade setup becomes more reliable when multiple timeframes agree on direction. A bullish signal on a 5-minute chart carries more weight when the 15-minute, 1-hour, and daily timeframes also show bullish conditions. Analyzing each timeframe separately is both time-consuming and prone to error. The Market Structure Dashboard automates this process by calculating key metrics across all enabled timeframes and presenting them side by side.
The indicator draws from two established trading methodologies. Smart Money Concepts (SMC) focuses on identifying institutional footprints in price action through patterns like Order Blocks, Fair Value Gaps, and liquidity sweeps. Inner Circle Trader (ICT) methodology emphasizes time-based analysis through specific trading windows called killzones and the importance of previous day, week, and month highs and lows.
Rather than treating these concepts in isolation, the dashboard organizes them into a layered framework. Structure shows where the market has been. Zones show where it may react. Sessions and killzones show when activity tends to increase. The trend bias system combines all factors into a single weighted score, giving traders a quick read on overall market sentiment across timeframes.
The purpose of the Market Structure Dashboard is to present the current market activity across multiple timeframes and how these conditions relate to earlier market structure, volume, and timing.
(Screenshot: Multi-timeframe confluence example - all TFs showing bearish alignment)
(Screenshot: Multi-timeframe disagreement example - mixed signals across TFs)
MARKET STRUCTURE DASHBOARD FEATURES
The Market Structure Dashboard indicator includes 14 main features:
EMA Trend Detection
Swing High/Low Tracking
Market Structure Labels (HH/HL/LH/LL)
Order Block Detection
Fair Value Gap Detection
Liquidity Sweep & Reclaim Detection
Volume Analysis
Volatility Analysis
Trading Sessions
ICT Killzones
Trend Bias System
HTF Levels (PDH/L, PWH/L, PMH/L)
Visual Overlays
Dashboard Customization
Each component operates independently while sharing the same underlying market structure logic. All features are calculated across up to 7 user-configurable timeframes and displayed in a unified dashboard. Detailed explanations for each component are provided in the sections that follow.
EMA TREND DETECTION
🔹 What is an EMA?
An Exponential Moving Average (EMA) is a type of moving average that gives more weight to recent price data. Unlike a Simple Moving Average that weights all prices equally, the EMA responds faster to recent price changes while still considering historical data. Traders use EMAs to identify trend direction and dynamic support/resistance levels.
When price trades above the EMA, the short-term trend is considered bullish. When price trades below the EMA, the short-term trend is considered bearish. The distance between price and EMA can indicate trend strength, with larger distances suggesting stronger momentum.
🔹 How the Indicator Uses EMA
The dashboard calculates a 9-period EMA (configurable) for each enabled timeframe. The EMA Trend column displays both direction and distance.
◇ Direction is shown with an up arrow (↑) when price is above EMA, or a down arrow (↓) when price is below EMA.
◇ Distance is displayed as percentage, price, or pips based on the Distance Display setting. For example, "+0.45% ↑" means price is 0.45% above the EMA on that timeframe.
◇ Color coding shows green when price is above EMA (bullish) and red when price is below EMA (bearish).
The EMA can optionally be plotted as a visual overlay on the chart. It can also be included as a factor in the Trend Bias calculation, where each timeframe's EMA direction contributes to the overall bias score.
(Screenshot: EMA column showing bearish readings - red, ↓)
SWING HIGH/LOW TRACKING
🔹 What are Swing Highs and Lows?
A swing high is a price peak where a candle's high is higher than the highs of surrounding candles. A swing low is a price trough where a candle's low is lower than the lows of surrounding candles. These points represent short-term reversals and define the boundaries of price movement.
Swing points are foundational to market structure analysis. Breaking a swing high suggests bullish momentum. Breaking a swing low suggests bearish momentum. The sequence of swing points creates market structure patterns that reveal trend direction.
🔹 How the Indicator Tracks Swing Highs/Lows?
The indicator detects swing points using a configurable Swing Length parameter (default: 5). A swing high is confirmed when a candle's high is higher than the specified number of candles on both sides. A swing low is confirmed when a candle's low is lower than the specified number of candles on both sides. This confirmation requirement means swing points are identified with a delay, ensuring they are valid pivots rather than temporary spikes. This same Swing Length setting is also used by Order Block detection and Market Structure labels, so adjusting it affects all three features.
◇ The Swing H/L column displays a visual position indicator showing where price sits within the current swing range. A dot moves along a bar between L (swing low) and H (swing high) to show exact position.
◇ When price breaks outside the range, arrows indicate the direction. An up arrow (↑) appears when price breaks above the swing high. A swing high break indicates that buyers have pushed price beyond the previous peak, suggesting bullish momentum and a potential continuation higher.
(Screenshot: Price above Swing High)
A down arrow (↓) appears when price breaks below the swing low. A swing low break indicates that sellers have pushed price beyond the previous trough, suggesting bearish momentum and a potential continuation lower
(Screenshot: Price breaks Swing Low)
When a liquidity sweep occurs (price breaks a level then reclaims it), special arrows appear: ⤴ for a swept and reclaimed low, ⤵ for a swept and reclaimed high. A swept and reclaimed swing means price broke beyond the level, likely triggering stop-loss orders resting beyond it, but then reversed back inside the range. This suggests the breakout was a false move and the opposite direction may follow. Liquidity sweeps are explained in detail in the Liquidity Sweep & Reclaim Detection section below.
◇ Color coding shows green when price is in the lower half of the range or breaks above the swing high, and red when price is in the upper half or breaks below the swing low.
(Screenshot)
◇ Tooltips provide additional context when hovering over any Swing H/L cell, such as "Price is nearing swing low on 15M" or "Price above swing high on 1H - swing high broken."
MARKET STRUCTURE LABELS (HH/HL/LH/LL)
🔹 What is Market Structure?
Market structure refers to the pattern of swing highs and swing lows that price creates over time. By comparing consecutive swing points, each new swing can be classified into one of four types.
◇ HH (Higher High): A swing high that is higher than the previous swing high, indicating bullish momentum.
◇ HL (Higher Low): A swing low that is higher than the previous swing low, indicating bullish momentum.
◇ LH (Lower High): A swing high that is lower than the previous swing high, indicating bearish momentum.
◇ LL (Lower Low): A swing low that is lower than the previous swing low, indicating bearish momentum.
(Screenshot: Bullish and Bearish Swing Points)
Bullish structure consists of HH and HL patterns, where price makes higher highs and higher lows. Bearish structure consists of LH and LL patterns, where price makes lower highs and lower lows. Mixed structure contains conflicting patterns and indicates consolidation or potential trend change.
🔹 How the Indicator Displays Market Structure
The Structure column shows the last three structure labels in sequence along with an overall bias arrow.
◇ "LL-LH-HL →" indicates mixed structure with no clear direction.
◇ "HH-HL-HH ↑" indicates bullish structure with higher highs and higher lows.
◇ "LH-LL-LH ↓" indicates bearish structure with lower highs and lower lows.
(Screenshot: Dashboard showing neutral, bearish and bullish indication across different timeframes)
The indicator tracks each new swing point as it forms, compares it to the previous swing of the same type, and assigns the appropriate label. Market Structure labels use the same Swing Length setting as Swing High/Low tracking, so both features stay synchronized. Structure bias is determined by the most recent high type and low type combined. If the last swing high was HH and the last swing low was HL, bias is bullish. If the last swing high was LH and the last swing low was LL, bias is bearish. Any other combination shows neutral.
Color coding shows green for bullish structure, red for bearish structure, and gray for mixed or neutral structure.
ORDER BLOCK DETECTION
🔹 What is an Order Block?
An Order Block is a concept from Smart Money analysis representing a candle or consolidation area where institutional orders may have been placed. In SMC methodology, Order Blocks are identified as the last opposing candle before a significant price move that breaks market structure.
◇ A Bullish Order Block is the last bearish candle before a rally that breaks a swing high. When price returns to this zone, it may find support.
◇ A Bearish Order Block is the last bullish candle before a drop that breaks a swing low. When price returns to this zone, it may find resistance.
Order Blocks are considered "mitigated" when price trades completely through them, suggesting the institutional orders have been filled.
🔹 How the Indicator Detects Order Blocks
The detection algorithm follows a specific sequence to identify valid Order Blocks.
◇ Step 1: The indicator tracks swing highs and swing lows using the configured Swing Length setting (shared with Swing High/Low tracking and Market Structure labels).
◇ Step 2: When price breaks above a swing high, the indicator identifies a bullish breakout. When price breaks below a swing low, it identifies a bearish breakout.
◇ Step 3: For a bullish Order Block, the indicator finds the candle with the lowest low between the broken swing high and the current bar. For a bearish Order Block, it finds the candle with the highest high between the broken swing low and the current bar.
◇ Step 4: The Order Block zone is created spanning from that candle's low to its high.
◇ Step 5: Mitigation is applied when price closes through the Order Block. Bullish OBs are mitigated when price closes below the zone. Bearish OBs are mitigated when price closes above the zone.
The Order Block column shows the nearest unmitigated Order Block for each timeframe. "IN BULL OB ↑" means price is currently inside a bullish Order Block. "BULL OB (5.4%) ↑" means the nearest OB is bullish and 5.5% away. "NONE" means no unmitigated Order Blocks exist on that timeframe.
(Screenshot: Nearest order block is Bull OB)
(Screenshot: Price in Bear OB)
FAIR VALUE GAP DETECTION
🔹What is a Fair Value Gap?
A Fair Value Gap (FVG), also called an imbalance, is a three-candle pattern where a gap exists between the first and third candle that the middle candle did not fill. This gap represents an area where price moved quickly, creating an imbalance in the market.
◇ A Bullish FVG forms when the first candle's high is lower than the third candle's low, creating an upward gap. When price returns to this gap, it may find support.
◇ A Bearish FVG forms when the first candle's low is higher than the third candle's high, creating a downward gap. When price returns to this gap, it may find resistance.
FVGs are considered mitigated when price wicks into the gap, filling the inefficiency.
🔹 How the Indicator Detects FVGs
The detection logic checks for the three-candle gap pattern with specific conditions.
◇ For a Bullish FVG, the current candle's low must be above the candle from three bars ago's high (gap exists), and the middle candle must be bullish (displacement candle).
◇ For a Bearish FVG, the current candle's high must be below the candle from three bars ago's low (gap exists), and the middle candle must be bearish (displacement candle).
◇ The FVG zone spans from the gap's bottom to its top.
◇ Mitigation occurs when price wicks below the gap bottom for bullish FVGs, or above the gap top for bearish FVGs. Note that FVG mitigation is more sensitive than Order Block mitigation.
FVGs only need a wick to touch them, while Order Blocks require a close through them.
The FVG column displays similarly to Order Blocks. "IN BULL FVG ↑" means price is inside a bullish Fair Value Gap. "BULL FVG (0.2%) ↑" means the nearest FVG is bullish and 0.2% away. "NONE" means no unmitigated FVGs exist on that timeframe.
(Screenshot: Price in Bull FVG)
(Screenshot: Bear FVG +3.4% away)
LIQUIDITY SWEEP & RECLAIM DETECTION
🔹 What is a Liquidity Sweep?
Liquidity refers to resting orders in the market, particularly stop-loss orders. Traders commonly place stops just beyond swing highs and swing lows, creating pools of liquidity at these levels. A liquidity sweep occurs when price breaks beyond a swing point, potentially triggering stops, but then reverses and closes back inside the range.
◇ A Bullish Liquidity Sweep occurs when price breaks below a swing low, then reverses and closes back above it. This pattern suggests potential buying interest after weak hands have been stopped out.
◇ A Bearish Liquidity Sweep occurs when price breaks above a swing high, then reverses and closes back below it. This pattern suggests potential selling interest after weak hands have been stopped out.
🔹 How the Indicator Detects Liquidity Sweeps
The indicator tracks whether each swing level has been broken and then reclaimed.
◇ A swing low is marked as broken when price trades below it. A swing high is marked as broken when price trades above it.
◇ A reclaim is detected when price closes back above a broken swing low (bullish) or back below a broken swing high (bearish).
◇ The break and reclaim flags reset when a new swing point forms, ensuring fresh detection for each level.
When a liquidity sweep is detected, the Swing H/L column displays special indicators. The ⤴ symbol indicates a bullish liquidity sweep where price swept the low and reclaimed. The ⤵ symbol indicates a bearish liquidity sweep where price swept the high and reclaimed. Tooltips provide additional context such as "Liquidity sweep - price swept swing low and reclaimed on 15M."
(Screenshot: Swing High Swept)
(Screenshot: Previous Month Low Swept)
VOLUME ANALYSIS
🔹 What is Volume Analysis?
Volume represents the number of shares, contracts, or units traded during a given period. High volume suggests strong interest and participation behind a price move. Low volume suggests weak interest and moves may lack follow-through. Comparing current volume to average volume helps identify unusual activity.
🔹 How the Indicator Analyzes Volume The dashboard calculates current volume as a percentage of its 20-period simple moving average.
◇ The Volume column displays a visual bar using filled and empty blocks to represent volume level relative to average.
◇ Volume states are classified as EXTREME (over 200% of average), HIGH (over 120%), NORMAL (over 80%), LOW (over 50%), or VERY LOW (50% or less).
(Screenshot: Extreme Volume)
◇ Color coding shows yellow for extreme volume, orange for high volume, and gray for normal, low, and very low.
◇ Tooltips show the exact percentage, such as "Volume is currently at 145% of average."
VOLATILITY ANALYSIS
🔹 What is Volatility?
Volatility measures how much price fluctuates over a given period. High volatility means large price swings. Low volatility means small price movements. The Average True Range (ATR) is a common volatility measure that calculates the average of true ranges over a period.
🔹 How the Indicator Measures Volatility
The dashboard calculates a 14-period ATR and compares it to its own 20-period average (configurable).
◇ The Volatility column displays the current state as HIGH (ATR over 130% of average), NORMAL (ATR between 70-130% of average), or LOW (ATR under 70% of average).
◇ Color coding shows red for high volatility, gray for normal, and green for low volatility.
◇ Tooltips provide context such as "Volatility is currently high" or "Volatility is currently low."
Low volatility often precedes significant moves, making it a useful setup indicator when combined with price at key levels.
(Screenshot: High Volatility)
TRADING SESSIONS
🔹 What are Trading Sessions?
Financial markets have varying activity levels throughout the day. Trading is typically divided into three major sessions based on which financial centers are open.
◇ Asian Session runs from 7:00 PM to 3:00 AM EST. It is characterized by generally lower volatility and ranging price action
◇ London Session runs from 3:00 AM to 12:00 PM EST. It is characterized by higher volatility and trending moves
◇ New York Session runs from 8:00 AM to 5:00 PM EST. It has high volatility especially during the London overlap from 8:00 AM to 12:00 PM EST, affecting USD pairs and all majors.
🔹 How the Indicator Displays Sessions
The Session column shows the current session name in the first row as ASIAN, LONDON, NEW YORK, or OFF HOURS (between sessions from 5:00 PM to 7:00 PM EST).
◇ The second row shows a progress bar that fills as the session advances, with each block representing approximately one hour.
◇ Sessions are color-coded as blue for Asian, green for London, orange for New York, and gray for off hours. These colors can be customized in the settings
◇ The indicator uses New York (EST) timezone for all session calculations and includes replay mode support.
(Asian Session and Killzone)
ICT KILLZONES
🔹 What are Killzones?
Killzones are specific time windows within each trading session when market activity tends to be higher. These windows are derived from ICT (Inner Circle Trader) methodology and represent times when significant moves are more likely to occur.
◇ Asian Killzone runs from 8:00 PM to 12:00 AM EST and often sets the initial range for the day.
◇ London Killzone runs from 2:00 AM to 5:00 AM EST and covers the London open when major moves are common.
◇ New York AM Killzone runs from 9:30 AM to 11:00 AM EST and covers the NYSE open, a high volume period.
◇ New York Lunch runs from 12:00 PM to 1:00 PM EST and typically has lower activity and consolidation.
◇ New York PM Killzone runs from 1:30 PM to 4:00 PM EST when afternoon continuation moves occur.
🔹 How the Indicator Displays Killzones
The Killzone column shows the current killzone in the first row as ASIAN KZ, LONDON KZ, NY AM KZ, NY LUNCH, NY PM KZ, or NO KILLZONE when outside all killzones.
◇ When outside a killzone, the second row shows a countdown to the next killzone, such as "NY AM KZ in 2h:15m."
◇ Killzones are color-coded as blue for Asian, green for London, orange for NY AM, gray for NY Lunch, and purple for NY PM. These colors can be customized in the settings
TREND BIAS SYSTEM
🔹 What is Trend Bias?
The Trend Bias System aggregates multiple factors across all enabled timeframes to produce a single directional bias score. Instead of analyzing each factor and timeframe separately, this system provides a weighted summary of overall market sentiment.
🔹 How the Indicator Calculates Trend Bias The calculation involves three components working together.
(Screenshot: BTC Bearish Trend)
◇ Factors determine what contributes to bias. Users can enable or disable Structure (market structure bias), Order Block (direction of nearest OB), FVG (direction of nearest FVG), EMA Trend (price position relative to EMA), and Swing Position (where price sits in the swing range). Each enabled factor contributes +1 for bullish, -1 for bearish, or 0 for neutral per timeframe.
◇ Weights determine how much each timeframe matters. Each timeframe has a configurable weight from 0 to 10. Default weights are 1 for 1M and 5M, 2 for 15M, 1H, and 4H, 3 for Daily, and 4 for Weekly. Higher weights mean that timeframe contributes more to the final score.
(Screenshot: Gold Bullish Trend)
◇ Score Calculation combines factors and weights. For each active timeframe, the sum of factor scores is multiplied by the timeframe's weight. The total score is the sum of all timeframe scores. The maximum possible score is the sum of each weight multiplied by the number of enabled factors. The bias percentage equals the total score divided by the maximum possible score, multiplied by 100.
◇ Bias Labels are assigned based on percentage. Over 50% shows BULLISH ↑. Between 20% and 50% shows LEAN BULL ↑. Between -20% and 20% shows NEUTRAL →. Between -50% and -20% shows LEAN BEAR ↓. Below -50% shows BEARISH ↓.
The Trend Bias column displays the bias label in the first row and the raw score in the second row, such as "+22/60" meaning 22 points out of 60 possible.
HTF LEVELS (PDH/L, PWH/L, PMH/L)
🔹 What are HTF Levels?
Higher Timeframe (HTF) Levels are significant price points from previous completed periods. These levels represent clear, objective reference points that many traders watch.
◇ PDH/PDL (Previous Day High/Low) are the high and low of the previous completed trading day and act as intraday support and resistance.
◇ PWH/PWL (Previous Week High/Low) are the high and low of the previous completed week and are significant levels for swing trading.
◇ PMH/PML (Previous Month High/Low) are the high and low of the previous completed month and are major levels for position trading.
🔹 How the Indicator Displays HTF Levels The HTF Levels Dashboard section (optional) shows a swing-style position bar for each enabled level, displaying where price sits within the previous day, week, or month range.
◇ The same liquidity sweep detection applies to HTF levels. If price sweeps PDL and reclaims, the ⤴ indicator appears.
(Screenshot: Previous Week Low Swept)
◇ Visual overlays can plot HTF level lines on the chart with customizable colors and line styles.
◇ When multiple levels are close together, labels automatically combine. For example, "PDH/PWH" appears when both levels are at similar prices, or "PDL/PWL/PML" when all three lows align.
(Screenshot: PWH/PMH labels combined when Previous Week Low and Previous Month Low align)
VISUAL OVERLAYS
Beyond the dashboard, the indicator offers optional visual overlays that plot directly on the price chart.
🔹 Order Block Zones
When enabled, Order Blocks appear as semi-transparent rectangular boxes. Green boxes represent bullish Order Blocks and red boxes represent bearish Order Blocks. Boxes span from the OB candle's low to its high and extend forward based on the Extend setting. Optional labels show "OB ↑" or "OB ↓" inside the zones.
🔹 FVG Zones
Fair Value Gaps appear as boxes with dashed borders to distinguish them from Order Blocks. Green dashed boxes represent bullish FVGs and red dashed boxes represent bearish FVGs. They share the same extend and label options as Order Blocks.
(Order Blocks & Fair Value Gaps)
🔹 Swing Labels
HH, HL, LH, and LL labels can be plotted directly at each swing point on the chart. Labels appear above swing highs and below swing lows. Green labels indicate bullish structure (HH, HL) and red labels indicate bearish structure (LH, LL). The Show Last setting controls how many labels appear.
🔹 Swing Lines
Horizontal lines can be drawn at the current swing high and swing low. A red line appears at the swing high and a green line at the swing low. Line styles are customizable as solid, dashed, or dotted.
(Swing Labels & Swing Lines)
🔹 HTF Level Lines
Horizontal lines can be plotted at Previous Day, Week, and Month highs and lows. Each level has a separate enable toggle with customizable colors and line styles. Labels auto-combine when levels are close together.
🔹 EMA Line
A standard EMA line can be plotted on the chart using the same EMA Length setting as the dashboard with customizable color.
DASHBOARD CUSTOMIZATION:
The dashboard is highly customizable to fit different trading styles and screen setups.
🔹Dashboard Position
Choose from 9 dashboard positions including top left, top center, top right, middle left, middle center, middle right, bottom left, bottom center, and bottom right.
🔹Dashboard Colors
Two color themes are available. Dark Mode has dark backgrounds with light text and is the default. Light Mode has light backgrounds with dark text.
🔹Column Toggles
Enable or disable individual columns in each dashboard section to show only the information needed. The Market Structure Dashboard section can toggle EMA Trend, Swing H/L, Structure, Order Block, and FVG columns. The Current Timeframe Dashboard section can toggle Volume, Swing H/L, and Volatility columns. The Market Context Dashboard section can toggle Session, Killzone, and Trend Bias columns. The HTF Levels Dashboard section can toggle PDH/L, PWH/L, and PMH/L levels.
🔹Color Settings
Customize colors for trend colors (bull, bear, neutral), session colors (Asian, London, NY), and killzone colors (Asian KZ, London KZ, NY AM, Lunch, PM).
🔹Distance Display
Choose how distances are shown. Percent shows values like "0.45%" and is the default. Price shows raw values like "45.50". Pips shows values like "45 pips" and is useful for forex.
SETTINGS:
🔹 Timeframes
Configure which timeframes are analyzed in the dashboard. Enable toggles turn each of the 7 timeframes on or off. Timeframe selection sets the specific timeframe for each slot (1M, 5M, 15M, 1H, 4H, D, W, M, or custom). Trend weight controls how much each timeframe contributes to the overall bias calculation (0-10), with higher values giving that timeframe more influence.
🔹 Market Structure Dashboard
Controls the main multi-timeframe dashboard section. The enable toggle turns the entire section on or off. Column toggles allow you to show or hide individual columns: EMA Trend, Swing H/L, Structure, Order Block, and FVG. Disabling columns you don't need reduces visual clutter and focuses the dashboard on the information most relevant to your trading style.
🔹 Current Timeframe Dashboard
Controls the current chart timeframe section that displays volume, swing position, and volatility data. The enable toggle turns the entire section on or off. Column toggles allow you to show or hide individual columns: Volume, Swing H/L, and Volatility.
🔹 Market Context Dashboard
Controls the market context section that displays session, killzone, and trend bias information. The enable toggle turns the entire section on or off. Column toggles allow you to show or hide individual columns: Session, Killzone, and Trend Bias.
🔹 HTF Levels Dashboard
Controls the higher timeframe levels section that displays previous day, week, and month high/low data. The enable toggle turns the entire section on or off. Level toggles allow you to show or hide individual levels: PDH/L, PWH/L, and PMH/L.
🔹 Trend Bias Settings
Controls which factors contribute to the trend bias calculation. Factor toggles allow you to include or exclude Structure, Order Block, FVG, EMA Trend, and Swing H/L from the bias score. Disabling factors you don't find relevant customizes how the overall bias is determined.
🔹 Visual Overlays
Controls what is plotted directly on the price chart. Order Blocks and FVGs each have an enable toggle, bull/bear colors, show last count (how many zones to display), extend bars (how far zones project forward), and labels toggle. Swing Labels have an enable toggle, bull/bear colors, and show last count. Swing Lines have an enable toggle, high/low colors, line style (solid, dashed, dotted), and extend bars. HTF Level Lines for Previous Day, Week, and Month highs/lows each have an enable toggle, colors, and line style, with a shared extend setting for all HTF lines. EMA has an enable toggle and color setting.
🔹 General Settings
Core indicator parameters. EMA Length sets the period for EMA calculation (default 9). Swing Length sets how many bars are required to confirm a pivot and is used for Swing Point detection, Order Block detection, and Market Structure labels (default 5). Volatility Lookback sets the period for ATR averaging (default 20). Distance Display controls how distances are shown: Percent, Price, or Pips. Dashboard Position sets where the dashboard appears on the chart (9 options). Dashboard Theme switches between Dark Mode and Light Mode. Color settings allow customization of trend colors (bull, bear, neutral), session colors (Asian, London, NY), and killzone colors (Asian KZ, London KZ, NY AM, Lunch, PM).
(Full Dashboard)
(Customized Display)
UNIQUENESS:
The Market Structure Dashboard focuses on multi-timeframe confluence by calculating and displaying the same analytical components across up to 7 timeframes simultaneously. Unlike indicators that show one timeframe at a time, each row in the dashboard represents a complete analysis of that timeframe's structure, zones, and trend state. This allows traders to observe alignment, disagreement, and transitions across timeframes within a single view.
The weighted Trend Bias System combines structure, zones, EMA, and swing position into a single score that accounts for timeframe importance. Higher timeframes can be weighted more heavily, reflecting their greater significance in establishing overall market direction.
The dashboard also integrates time-based context through session and killzone tracking, helping traders identify when market conditions align with historically active trading windows. All components coexist without overriding each other, providing a comprehensive framework for multi-timeframe market structure analysis.
Smart NR2-NR20 and Inside Bar (Zeiierman)█ Overview
Smart NR2–NR20 + Inside Bar (Zeiierman) is a compression + breakout scanner that searches for the tightest Narrow Range (NR) condition across NR2…NR20, plus optional Inside Bar detection. When a valid compression forms, it draws a box around the setup, projects the high/low levels forward, and triggers on the first breakout. Optional Trend Filter logic can restrict triggers to trend-aligned breakouts, and optional Exit markers can annotate TP / SL / Time exits after a trigger.
🔘 What It Detects
The Smart Narrow Range (NR2…NR20) script continuously checks NR lengths from 2 to 20 and selects the most extreme contraction (tightest relative range vs history) inside the current Look Back window, highlighting the strongest “compression” zones where expansion risk is building. Optionally, it can also treat an Inside Bar as a valid compression trigger.
█ How It Works
⚪ 1) Compression Scan (NR Ranking Engine)
For each bar, the script evaluates NR2…NR20:
It calculates the N-bar range (highest high − lowest low).
It compares that range to prior N-bar ranges over Look Back.
It ranks candidates by “tightness” and keeps the strongest one.
Key effect:
Higher Look Back = fewer but higher-quality compressions
Lower Look Back = more frequent compressions
⚪ 2) Adaptive Look Back (Static or ADX-Adaptive)
Look Back can be:
Static: fixed comparison window
ADX Adaptive: Look Back dynamically shifts between LB Min and LB Max depending on trend strength
Conceptually:
Higher ADX (strong trend) — shorter Look Back (more responsive)
Lower ADX (chop/range) — longer Look Back (more selective)
█ How to Use
⚪ Bullish Setup
Wait for a tight range to form
Enter on a breakout above the range high
Stop below the opposite side of the range
Target a multiple of the range size or trail with momentum
Optional: wait for a small breakout retest before entering
⚪ Bearish Setup
Wait for a tight range to form
Enter on breakout below the range low
Stop above the opposite side of the range
Target a multiple of the range size or trail with weakness
Optional: enter on breakdown retest
█ Settings
Enable Inside Bar — toggles Inside Bar detection.
Look Back (compare window) — history window used to judge contraction quality.
Enable Trend Filter — gates long/short triggers relative to Trend MA.
Show Trend MA — plots the Trend MA on chart.
Trend MA Mode — Static or NR-Adaptive (length follows Look Back × multiplier).
MA Type — EMA or RMA smoothing for the Trend MA.
NR — MA Multiplier — scales adaptive MA length from Look Back.
Static MA Length — used when Trend MA Mode is Static.
Look Back Mode — Static or ADX Adaptive.
ADX Length / ADX Low / ADX High — controls adaptive response to trend strength.
LB Min / LB Max — bounds for adaptive Look Back range.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
TASC 2026.03 One Percent A Week█ OVERVIEW
This script implements "A High-Probability Weekly Trading Strategy For TQQQ" as dictated in the March 2026 edition of the TASC Traders' Tips , "Trading Snapbacks In A Leveraged ETF”. In this article the author creates a mean reversion strategy intended for systematic and discretionary traders with the goal of having a minimal number of rules, low time commitment, and a consistent weekly profit target.
█ INSTRUMENT SELECTION
TQQQ is a 3x leveraged fund based on the Nasdaq-100 index. The article focuses specifically on this instrument because of its key characteristics that are suitable for this type of strategy:
Strong trend behavior during bullish periods
Frequent and sometimes steep intraday pullbacks
High volatility, even on otherwise quiet market days
Long-term compounding when the underlying index rises
█ THE STRATEGY
Simply put, the goal of this strategy is to trade TQQQ using an objective system with simple rules and no weekend holds, targeting 1% weekly returns while controlling drawdowns and preventing overtrading.
This strategy was created to exploit short-term pullbacks during strong uptrends on TQQQ. With this in mind, the strategy is naturally long-only. Additionally, the strategy executes only one trade per week, which naturally limits trade activity and makes for a more robust system.
While this strategy may not outperform buy-and-hold returns, it can offer more consistent behavior with relatively modest drawdowns and gains over time. The resulting equity curve is typically smoother overall than that of a typical buy-and-hold position, and therefore potentially more favorable from a long-term performance perspective.
▌ Properties
Position Sizing: Sizing is 10% of equity, the same as in the article.
Commissions: Commission value is set to $0. Most major US brokers charge $0 commission on stocks and ETF trades, including leveraged ETFs such as TQQQ.
Slippage: Slippage is set to 0. This strategy uses only limit orders, with the exception of a market-on-close order for the end of the week as a hard exit. For this reason slippage is not a consideration for this script.
█ THE RULES
Track Monday's Opening Price: Each week, Monday's open is noted.
Enter on a 1% dip from the Open: On the open, a limit buy order is set at -1% from the open.
Set a 1% profit target: If the buy order is filled, a limit sell (take-profit) order is set at the start of the following day for +1% from the fill price. By waiting until the start of the following day, this allows for occasional profits greater than 1% each week.
Breakeven if 0.5% drawdown occurs: While in a position, if a drawdown of 0.5% or greater is observed, we immediately set a limit sell order at the entry price (breakeven).
Hard stop at Friday close: A market-on-close order is set for EOD Friday to exit us from any position which has not met the target or breakeven limits.
█ DISPLAY
In addition to the strategy script's order executions, the display consists of four lines for visualizing the levels that the strategy uses for execution.
Weekly Open: This yellow line plots at the start of the week. Once the profit target order is placed, this line stops plotting.
Weekly 1% Dip: This blue dashed line also plots at the start of the week. Similar to the Weekly Open line, this line also stops plotting once the profit target order is placed.
0.5% Drawdown: This red dashed line starts plotting once the strategy is in an active position.
Profit Target: This solid green line begins plotting once the profit target order has been placed at the start of the day after the buy order was filled.
The strategy aims to educate users about the specific trading approach outlined in the article. Therefore, it does not include customizable inputs to adjust calculations or levels. However, users can still adjust strategy parameters such as trade sizes, commissions, margin, etc. in the "Properties" tab.
Note: Certain lines may not be visible if the conditions for display only last one bar. This is simply caused by the strategy executions and price action.
Smart Trader, Concentric Candles & Aristotelian Cycloids
Smart Trader, Episode 05
Concentric Candles & Aristotelian Cycloids
by Ata Sabanci
The Spark — How a 2,000-Year-Old Paradox Found the Charts
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
It started with a film about Aristotle's Wheel
Paradox — a problem that puzzled mathematicians
for two millennia. The setup is deceptively
simple: two circles, one inside the other, share
the same center and roll together along a
straight line. The outer circle traces a distance
equal to its circumference. But the inner circle,
attached rigidly to the outer, also travels the
same distance — yet its circumference is smaller.
How?
The answer lies in slipping . The inner circle
doesn't truly roll — it is dragged . And as it
moves, a point on its rim traces a beautiful
curve called a curtate cycloid — a compressed
wave that never reaches the full height of the
outer wheel's standard cycloid.
The moment I saw those curves being drawn in the
film — the elegant, rhythmic arches of the
cycloid — a thought struck me: what if this
geometry lives inside price charts too? What if
each candle, with its High, Low, Open, and Close,
could be mapped onto a rolling circle — and the
resulting cycloid curves could reveal hidden
structure in market behavior?
That question became this indicator.
The Problem — Why Raw Charts Break Geometry
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
A financial chart has two axes that measure
completely different things : the horizontal
axis counts bars (time) , the vertical axis
measures price (currency) . Drawing a circle on
such a chart is meaningless — it stretches and
distorts with every zoom or rescale. A "circle"
on a 1-minute chart looks nothing like the same
"circle" on a daily chart.
To draw real geometry on a price chart, both
axes must speak the same language . I needed a
scientifically rigorous way to convert between
time and price — not an arbitrary ratio, but one
derived from the market itself.
The Bridge — Volatility-Diffusion Normalization (σ√t)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The answer comes from the σ√t scaling law in
financial mathematics. Under Geometric Brownian
Motion, the standard deviation of log-returns
scales as the square root of time:
std(Δ ln P) = σ × √Δt
This means 1 bar of time is equivalent to
σ_bar units of log-price . Once you know σ_bar,
both axes measure the same thing. Geometry
becomes invariant — it doesn't distort with
zoom, timeframe, or instrument.
For σ_bar, I use the Yang-Zhang volatility
estimator — the most statistically efficient
single-bar estimator in the literature. It uses
all four OHLC prices plus the overnight gap
between consecutive bars, combining three variance
components into one optimal estimate. After
extensive testing, a lookback of 20 bars proved
to be the best balance between responsiveness and
stability for geometric calibration.
Candle Selection — Finding the Dominant Voices
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Not every candle deserves a rolling wheel. The
indicator selects maxima candles — candles whose
H−L range is strictly larger than their immediate
chronological predecessor. These represent
volatility expansion events — moments when the
market spoke louder than the bar before it.
Two selection methods work in parallel:
1. Predecessor-Comparison (M0, M1): The scanner
walks backward from the basis candle. At each
step, it compares a candle's range to its
predecessor. When it finds one that is strictly
larger, that candle becomes a maxima. Two are
found this way.
2. Period Largest (M2): A separate scan finds
the single biggest candle (by H−L range) within
the last N bars (default 20). If it differs from
M0 and M1, it's appended as a third maxima — the
"biggest voice in the room."
Live vs. Closed Basis: The user can choose
whether the scanner starts from the live candle
(real-time, updates every tick) or the last closed
candle (stable, confirmed data). This affects both
the backward scan starting point and the CVCA
contact detection basis.
The Geometry — Three Concentric Circles per Candle
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Each selected maxima candle defines three
concentric circles in the normalized space — all
sharing the same center (the geometric midpoint
of the candle):
Outer Circle — diameter = H − L (full candle
range). This is the primary rolling wheel. A point
at its apex (the High) traces a standard cycloid .
Upper Wick Circle — diameter = H − max(O, C)
(upper wick). This inner wheel is dragged by the
outer — it slips along the baseline (Aristotle's
paradox). Traces a curtate cycloid with reduced
amplitude.
Lower Wick Circle — diameter = min(O, C) − L
(lower wick). Also dragged. Also traces a curtate
cycloid.
How the candle maps to circles:
⊚ Outer circle: diameter = H − L (full range)
→ traces a standard cycloid
▲ Upper wick circle: diameter = H − max(O,C)
→ traces a curtate cycloid
▼ Lower wick circle: diameter = min(O,C) − L
→ traces a curtate cycloid
All three share the same center (candle midpoint).
The outer circle is the driving wheel. The two
inner circles are dragged — they slip along the
rolling surface (Aristotle's paradox in action).
Drawing these curves in Pine Script was itself a
challenge — there's no native circle or parametric
curve function. By defining the normalized
coordinate space (where 1 bar = σ_bar units of
log-price) and using polylines with a hybrid
Newton-Bisection root solver to invert x(θ) → θ
at each bar index, I was able to render the
cycloid curves directly on the price chart with
high fidelity.
The parametric equations for each curve follow the
two-radius Aristotle's Wheel formulation:
x(θ) = R·θ − r·sin(θ+φ₀) + r·sin(φ₀)
y(θ) = R − r·cos(θ+φ₀)
Where R = outer rolling radius, r = traced
point's circle radius, and φ₀ = π (apex start,
clockwise rolling). The inverse transform
price = exp(lnLow + y_norm × σ_bar) maps the
normalized cycloid back to the price chart —
geometry anchored at the candle's Low.
On the chart, the curves appear as follows:
⊚ Outer Apex (y = 2R): highest cycloid point
▲ Upper Pin Apex (y = R + r_up): curtate peak
▲ Upper Pin Trough (y = R − r_up): curtate min
⊚ Outer Trough (y = 0): the rolling surface
= candle's Low price
The outer cycloid arches from Low up to 2R and
back. The pin cycloids oscillate within the outer
envelope with reduced amplitude — visible as
nested waves inside the main curve.
The Signal — Cycloid-Volume Contact Analysis (CVCA)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Drawing beautiful curves is one thing. The real
question is: what happens when price touches a
cycloid curve?
The CVCA engine detects real-time intersections
between the live candle and all active cycloid
curves. When contact is detected, it runs a
7-axis prediction matrix that combines geometry
with volume analysis:
Axis 1 — Contact Direction: Did the body cross
the curve? Did a wick test it? Five states: Passed
Up, Passed Down, Stopped, Wick Bounce, Wick
Reject.
Axis 2 — Curve Type: Which circle generated
this curve? Outer (strongest), Upper Pin, or Lower
Pin.
Axis 3 — Curve Zone: Is the contact near the
Apex (peak), Trough (bottom), or Mid-range of the
cycloid?
Axis 4 — Volume Magnitude: How does current
volume at the contact price compare to the maxima
candle's volume at the same price? Amplified,
Proportional, or Depleted.
Axis 5 — Delta Character: How has the buy/sell
imbalance changed since the maxima candle?
Continued, Weakened, or Flipped.
Axis 6 — Absorption Detection: Is heavy
opposing volume being absorbed while price holds?
Buy Absorption, Sell Absorption, or None.
Axis 7 — Multi-Cycloid Confluence: How many
other cycloid curves pass through the same price
level? Single, Double, or Triple+ confluence.
All seven axes feed into a continuous scoring
engine using logistic-sigmoid soft-clamping — no
hard thresholds, no cliff-edge label flips. The
output is a directional probability P(↑), a
conviction score, and a behavior classification
(Strong Bounce, Breakout, Exhaustion, Absorption,
Battle Zone, Delta Flip, Confluence Wall, and
more).
When footprint data is available (TradingView
Premium/Ultimate), CVCA operates at tick-level
precision — comparing buy and sell volume at the
exact contact price row between the maxima candle
and the current candle. Without footprint, it
falls back to geometry-only analysis using the
first three axes.
Scientific Foundations
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator draws on the following mathematical
and statistical frameworks:
• Geometric Brownian Motion — dS/S = μdt + σdW
— the σ√t diffusion scaling law that bridges
time and price axes.
• Yang-Zhang Volatility Estimator — Uses
O/H/L/C + overnight gaps; the most statistically
efficient single-bar σ estimator in the
literature.
• Rogers-Satchell Volatility — Drift-independent
variance component inside the Yang-Zhang
estimator.
• Aristotle's Wheel Paradox — Concentric circles
rolling together — the inner circle slips,
creating curtate cycloids.
• Cycloid Curves — Standard (outer) + curtate
(inner pin circles) — called the "Helen of
Geometry" by Galileo.
• Parametric Phase-Anchored Equations —
Two-radius cycloid:
x(θ)=Rθ−r·sin(θ+φ₀), y(θ)=R−r·cos(θ+φ₀).
• Hybrid Newton-Bisection Root Solver —
Numerical inversion of x(θ)→θ at each bar for
accurate curve rendering.
• Kyle-Obizhaeva Impact Law — σ√(Q/V) —
volume magnitude analysis for CVCA Axis 4.
• Easley-O'Hara PIN/VPIN — Delta as informed
trading proxy — CVCA Axis 5.
• Cont et al. (2014) OFI — Order Flow Imbalance
linear impact model — absorption detection in
CVCA Axis 6.
• Xu et al. (2019) MLOFI — Multi-Level Order
Flow Imbalance — confluence scoring for CVCA
Axis 7.
• Logistic Sigmoid Soft-Clamping — Continuous
scoring without cliff-edge thresholds — used
across all CVCA axes.
Architecture — How It All Connects
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The indicator processes data in the following
pipeline:
Stage 1: Raw Input
OHLC price data + volume arrive per bar.
Stage 2: Two Parallel Engines
→ Yang-Zhang σ_bar Estimator (Lookback = N):
Computes overnight variance, close-open
variance, and Rogers-Satchell variance.
Combines them into σ_bar.
→ Volume Engine (Geometric or Intrabar):
Splits total volume into buy/sell.
Stores per-bar for historical comparison.
Stage 3: Normalization
Converts axes: 1 bar = σ_bar, Y = ln(P) / σ.
Both axes now measure the same units.
Stage 4: Candle Selection
→ Predecessor-Comparison scan → M0, M1
→ Period-Largest scan → M2 (if unique)
Stage 5: Concentric Circles
Per maxima candle, 3 circles are defined:
⊚ Outer (H−L)
▲ Upper (H−max(O,C))
▼ Lower (min(O,C)−L)
Stage 6: Cycloid Math
Parametric equations + Newton-Bisection solver.
Phase φ₀ = π. Auto-revolutions extend curves
to the live bar.
Stage 7: Two Outputs
→ Polyline Render: 3 curves per Mi, bowl fill,
reference lines, geometric markers.
→ CVCA Engine: Contact detection, 7-axis
matrix, P(↑), conviction, behavior label.
Stage 8: Dashboard Table
Title + σ_bar info
Mi blocks (Offset, Length, Mid, Levels)
S/R Detection (Nearest Above/Below)
CVCA Contact Analysis (3-row layout)
Volume Engine (Buy/Sell/Delta/FP Status)
Settings Guide
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Core Settings
σ_bar Lookback Period: Rolling window for the
Yang-Zhang volatility estimator. Controls how many
bars are used to compute σ_bar — the bridge
between time and price axes. Larger values produce
more robust geometric calibration but respond
slower to regime changes. Default: 20.
Range: 1–2500.
Cycloid Display
Show Outer/Upper/Lower Traces: Toggle
visibility of each of the three concentric cycloid
curves. The Outer (H−L) is the primary rolling
wheel — the strongest geometric curve. Upper and
Lower Pin curves trace the wick circles and show
internal candle structure.
Show Period Largest Candle: Enables the
period-based maxima scanner (M2). Scans the last N
bars for the single biggest candle. If it already
matches M0 or M1, no duplicate is drawn.
Period Lookback Length: Number of bars to scan
for the period-based largest candle. Default: 20.
Range: 5–200.
Show Reference Lines: Draws horizontal dashed
lines at cycloid apex and trough levels — the
geometric S/R framework. Six individual toggles
control which levels are drawn: Outer Apex (2R),
Outer Trough (0), Upper Pin Apex/Trough, Lower
Pin Apex/Trough.
Curve Color — Above/Below Price: When the
Outer Apex level is above current close, all
curves for that maxima use the "Above" color
(default: orange). When below, they use the
"Below" color (default: cyan). This gives an
instant visual read of the curve's S/R context.
Volume Engine
Calculation Method: Two engines — Geometric
(estimates buy/sell from OHLC price action) and
Intrabar (uses lower timeframe tick data via
TradingView's ta library for precise
decomposition).
Intrabar Timeframe: Lower timeframe for
precise volume calculation. Only active in Intrabar
mode. 15S (15-second) recommended for most
instruments.
Calculation Basis: Current Candle uses live bar
data. Closed Candle uses only the last confirmed
bar — more stable, avoids intrabar noise.
Footprint & Contact Analysis
Show Contact Analysis (CVCA): Enables the
7-axis prediction engine in the dashboard. Detects
cycloid curve intersections and outputs directional
probability, conviction score, and behavior
classification. Requires TradingView
Premium or Ultimate for full footprint data; falls
back to Volume Engine data when footprint is
unavailable.
Dashboard Settings
Show Dashboard: Projects the full data
dashboard onto the main price chart. Shows σ_bar
info, all Mi blocks with reference levels, S/R
detection, CVCA contact analysis, and volume
metrics.
Dashboard Position: Four corners: Top Right
(default), Top Left, Bottom Right, Bottom Left.
Dashboard Language: English, Türkçe, or
العربية. Full localization of all labels,
tooltips, and natural-language sentences.
Show Mi Reference Prices: Expands each Mi
block in the dashboard to show all 6 reference
price levels (3 apex + 3 trough). Default: OFF to
keep the dashboard compact.
A Theory, Not a System — An Invitation to Explore
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is a theoretical exploration ,
not a proven trading system. The idea that
Aristotle's Wheel geometry maps meaningfully onto
price structure is a hypothesis — one that I
find compelling enough to build, share, and test
publicly, but one that requires far more data,
analysis, and community scrutiny to validate or
refute.
I chose to publish it on TradingView precisely
because this platform is a living laboratory —
constantly moderated, reviewed, and challenged by
a global community of traders, developers, and
analysts. If the cycloid geometry holds predictive
value, this community will find it. If it doesn't,
this community will expose it.
Use this indicator as a research tool, not as a
signal generator. Combine it with your own
analysis. Question its assumptions. Test it across
instruments and timeframes. And if you discover
something — share it.
The mathematics is beautiful. Whether the market
agrees is an open question.
MovingAveragesLibrary "MovingAverages"
A collection of O(1) numerically stable moving averages that support anchors and fractional lengths up to 100k bars.
Pine Script has a robust set of moving averages suitable for a majority of cases, making these alternatives useful only if you need anchoring, fractional lengths, or more than 5k bars. Included are the classic SMA , EMA , RMA , WMA , VWMA , VWAP , HMA , SWMA , Linear Regression , and ATR . The common parameters are:
source (float) : Series of values to process.
length (simple float) : Number of bars. Optional.
anchor (bool) : The condition that triggers a calculation reset. Optional.
parity (simple bool) : Sets if built-in function should be used. Optional.
Other DSP filter adaptations include One Euro , Laguerre , Super Smoother , and Holt , as well as rate limiting functions such as Smooth Damp and Slew Rate Limiter .
ANCHORING
This is the libraries first and primary benefit. Akin to the built-in VWAP, anchoring is managed by passing a series bool into the function. For sessional anchoring, the included new_session() returns true on the first bar of intraday sessions, and stabilize_anchor() helps reduce near-anchor volatility. When no length is provided, the series continues indefinitely until a new anchor is set. Values during the warmup period are returned.
source = close
length = 9.5
anchor = ma.new_session() // Assumes library is imported as "ma"
swma = ma.swma(source, length, anchor).stabilize_anchor(source, length, anchor)
STREAMING UPDATES
Rather than naively using loops to recalculate the whole series on each bar, linear interpolation (aka. "lerping") is used to incrementally update and translate between values. The canonical formula being: a + (b - a) * t. This formula is effectively an EMA, but it's applicable to nearly all averaging equations. Coupling this technique with a circular buffer captures 3 of the 5 benefits this library offers: O(1) computation, fractional lengths, and 100k bars.
NUMERIC STABILITY
The last benefit is how the library minimizes floating point errors. When possible, Pine Script functions are used for mathematical parity. Otherwise Kahan summation error compensation is used when calculating an average. Not only does this keep custom implementations stable throughout the series, it also helps keep them within 1.0e-10 of the built-in functions. Automatically defaulting to the built-in functions can be disabled by setting parity to false .
Clusters Volume Profile [LuxAlgo]The Clusters Volume Profile indicator utilizes K-Means clustering to categorize historical price action into distinct groups and generates individual volume profiles for each detected cluster. This tool provides a unique perspective on volume distribution by isolating price behaviors based on proximity rather than strictly chronological order.
🔶 USAGE
The indicator identifies "clusters" of price activity within a user-defined lookback period. Each cluster is assigned a unique color and its own horizontal volume profile, allowing traders to see where liquidity is most concentrated within specific price regimes.
🔹 Identifying Institutional Zones
Traders can use the Point of Control (POC) of high-volume clusters to identify significant institutional interest. Because the K-Means algorithm groups price action by density rather than time, a cluster's POC often represents a "fair value" level where significant exchange occurred. These dashed POC lines frequently act as robust support or resistance levels when price returns to them in the future.
🔹 Market Regime Detection
By observing the vertical distribution and overlap of clusters, traders can identify market phases. Overlapping clusters with high volume often indicate accumulation or distribution phases (sideways markets), whereas distinct, vertically separated clusters with lower volume gaps between them suggest a trending environment. A shift from multiple overlapping clusters to a new, isolated cluster can signal a breakout or the start of a new trend.
🔹 Precision Entry & Exits
Cluster boundaries and POC lines provide concrete levels for trade management. An entry can be sought when price retests a high-volume cluster POC, while stops can be placed outside the total price range of that specific cluster (the area covered by its volume profile). Conversely, targets can be set at the POC of the next major cluster above or below current price action.
🔹 Volume Conviction
The tool provides specific volume metrics that allow traders to gauge conviction. By comparing the "Total" volume label of one cluster against another, a trader can determine which price regime had more participation. A breakout into a price zone with a high-volume cluster suggests stronger conviction and a higher probability of the level holding compared to a zone with low total volume.
🔶 DETAILS
The script employs a K-Means clustering algorithm. This process involves:
Initializing "centroids" across the price range of the lookback period.
Iteratively assigning each price bar to the nearest centroid based on the HLC2 (median) price.
Recalculating centroids based on the volume-weighted average price of the assigned bars.
Finalizing assignments after the specified number of iterations to ensure stable clusters.
By separating price action into these clusters, the tool helps identify high-interest zones that might be obscured by a single, traditional Volume Profile.
🔶 SETTINGS
🔹 Clustering Settings
Lookback Period: Determines the number of recent bars used for the clustering analysis.
Number of Clusters: Sets how many distinct price groups the algorithm should attempt to find (2 to 10).
K-Means Iterations: Controls the number of times the algorithm refines the cluster centers. Higher values can lead to more stable results.
🔹 Volume Profile Settings
Rows per Cluster VP: Defines the vertical resolution (number of bins) for each individual cluster's profile.
Max VP Width (Bars): Sets the maximum horizontal length of the volume profile histograms.
VP Offset: Adjusts the horizontal spacing between the current bar and the start of the volume profiles.
Highlight Price Dots: Toggles the visibility of the colored dots on the price action to identify cluster assignments.
Dot Size: Adjusts the size of the cluster assignment dots on the chart, ranging from tiny to huge.
Central Bank Liquidity Gap IndicatorThis indicator measures the gap between global liquidity growth and stock market growth to identify potential buying opportunities.
Liquidity drives markets. When central banks print money, that liquidity eventually flows into stocks and other assets. If we spot when liquidity growth is outpacing market growth, we can spot moments when the market is "due" to catch up.
I like this quote:
Earnings don't move the overall market; it's the Federal Reserve Board... focus on the central banks and focus on the movement of liquidity."
- Stanley Druckenmiller
How Central Bank Liquidity Gap Indicator Works
The indicator calculates a simple divergence:
Divergence = Liquidity Growth % − S&P 500 Growth %
Green bars = Liquidity is growing faster than the market (bullish)
Red bars = Market is growing faster than liquidity (less bullish)
Multi-Country M2 Money Supply
Unlike basic M2 indicators, this one lets you combine money supply data from multiple economies, including US, UK, Canada, China, Eurozone, Switzerland and Japan.
Each country's M2 is automatically weighted by its actual size (converted to USD). Larger economies have more influence on the global liquidity picture.
I've added a discount for China. China's M2 weight is reduced by 50% to account for capital controls that limit how much Chinese liquidity flows into global markets and into the US market.
Fed Net Liquidity
You can also blend in Fed Net Liquidity for a more precise US liquidity measure:
Net Liquidity = Fed Balance Sheet − Treasury General Account − Reverse Repo
This captures the actual liquidity the Fed has injected into financial markets, not just the broad money supply.
How To Read It
The Buy Zone (5%+ Divergence)
When the divergence exceeds +5%, the indicator enters the "Buy Zone" (highlighted with green background). This means liquidity is significantly outpacing market growth — historically a good buy signal.
The Support Table
The info table shows:
Component weights: How much each country's M2 contributes
Corr w/ SPX: Current correlation between liquidity and SPX (are they moving together?)
Leads SPX by X: Does past liquidity predict future SPX moves? (higher = more predictive)
Divergence %: Current divergence value
Signal
Correlation Stats
Corr w/ SPX: Measures if liquidity and SPX are moving in sync right now
Leads SPX: Measures if liquidity changes predict future SPX moves. A positive value here suggests liquidity is a leading indicator.
Potential Use Cases
Long-term investing: Wait for 5%+ divergence (buy zone) to accumulate index funds, ETFs, or stocks
Leveraged ETFs: Use buy zone signals to time entries into UPRO, TQQQ, SSO (higher risk, higher reward)
Crypto: Bitcoin and crypto markets also correlate with global liquidity — use this for BTC accumulation timing
Risk management: Avoid adding positions when divergence is deeply negative
Important Notes
This is a long-term indicator and not for daytrading. It works best used on Daily/Weekly timeframes
It identifies accumulation zones and not precise bottoms
Truly yours, Henrique Centieiro
Inspired by the relationship between M2 money supply and market performance, enhanced with multi-country liquidity tracking and Fed balance sheet analysis.
Let me know if you have questions/suggestions.






















