Smart Trader, Episode 07, ICS Geometric Buyers/Sellers Pressure🔶 Overview
ICS Geometric Buyer/Seller Pressure measures the real-time balance between buying and selling forces through a geometric framework built on triangle areas. Rather than relying on volume, oscillators, or moving-average crossovers, this indicator constructs two right triangles on every bar — one representing seller pressure above the current price, one representing buyer pressure below it — and computes their areas inside a normalized coordinate system called the Isotropic Coordinate System (ICS).
The ICS transforms raw price and time into a dimensionless plane using Yang-Zhang composite volatility as the scaling factor. Because both axes are divided by the same volatility estimate, the resulting triangle areas carry no unit — they are pure geometric ratios. This makes the pressure reading comparable across any instrument, any timeframe, and any price scale, without the trader needing to adjust parameters when switching charts.
From these two normalized areas, the indicator derives a single metric called B, which condenses the entire buyer-versus-seller balance into a value between −1 and +1. B is then converted into intuitive percentage readings (Red % for seller dominance, Blue % for buyer dominance) and visualized through a gradient barometer column, a triangle fan overlay, and data-window plots ready for alerts.
🔶 Conceptual framework
To measure the real-time balance between buying and selling forces, this indicator takes a geometric approach rather than relying on volume analysis, oscillator divergences, or moving-average crossovers. Two right triangles are constructed on every bar — one above the current price toward the range ceiling, one below toward the range floor — and their areas are compared to determine which side of the market currently dominates.
Computing triangle areas in raw price-versus-time coordinates, however, introduces a structural problem: the same price movement produces a different geometric shape depending on the chart's zoom level, time compression, or display resolution. A 30-point rally on a compressed weekly chart creates a steep, narrow triangle; the identical rally on a stretched intraday chart creates a flat, wide one. The areas differ even though the underlying market event is the same.
To eliminate this distortion, the indicator applies a normalization layer referred to here as the Isotropic Coordinate System (ICS). The principle behind it is dimensional analysis — a well-established technique in physics and engineering for removing unit-dependent artifacts from measurements. The horizontal axis (time) is rescaled by dividing bar offsets by sigma, and the vertical axis (price) is rescaled by dividing the natural logarithm of price by the same sigma. Because both axes share the same divisor, the resulting coordinate plane is isotropic: triangle areas reflect only the structural relationship between price and range boundaries, not how the chart happens to be displayed.
The sigma used for this normalization is the Yang-Zhang (2000) composite volatility estimator, a published academic method (Journal of Business, Vol. 73, No. 3). It combines three independent variance components — overnight (close-to-open), intraday (open-to-close), and the Rogers-Satchell high-low-close estimator — into a single unbiased measure with minimum-variance weighting. This makes sigma robust across instruments with overnight gaps (equities, futures) and those that trade continuously (forex, crypto).
The practical result: the normalization layer adapts to the volatility regime of each instrument, making triangle areas structurally comparable across different charts and timeframes and reducing the need for manual recalibration when switching instruments.
🔶 The B metric: from triangle geometry to a single number
The core output of this indicator is a single value called B, which captures the instantaneous buyer-versus-seller balance in one dimensionless number.
Picture any bar on your chart. The indicator draws two right triangles around it. The upper triangle sits between the bar's high and the range ceiling: its three vertices are (1) the current bar's high, (2) the range ceiling at the current bar, and (3) the range ceiling at the prime-offset bar, 101 bars back. This triangle represents seller territory — the geometric "room" that sellers occupy above the current price. The lower triangle mirrors this below: its vertices are the current bar's low, the range floor at the current bar, and the range floor at that same prime-offset bar. This is buyer territory — the room below the current price. The larger the seller triangle relative to the buyer triangle, the more the market is tilted toward selling pressure, and vice versa.
Why prime-numbered offsets?
The indicator uses the first 25 prime numbers (3, 5, 7, 11, ... 97, 101) as its sampling offsets. Prime numbers share no common factors with each other or with any periodic cycle in the data. When a signal is sampled at evenly spaced intervals (e.g. every 10, 20, 30 bars), there is a risk that the sampling grid locks onto a periodic pattern in the price — a weekly cycle, an options expiration rhythm, or any recurring structure — and either amplifies or masks it. This is a form of harmonic aliasing. Prime offsets avoid this: because no prime is a multiple of any other, the sampling set {3, 5, 7, ... 101} is maximally non-periodic, ensuring that each offset captures a structurally independent slice of the price range.
Two roles: measurement and visualization
For the B calculation itself, only the widest triangle is used — the one anchored at prime offset 101. This single pair of triangles (upper and lower) captures the broadest structural pressure across the entire lookback window. The remaining 24 primes serve a visual role: they generate the triangle fan overlay you see on the chart. But this visual layer is not merely decorative. Each triangle in the fan maps a pressure boundary at a different time horizon.
As the screenshot above illustrates, candles that approach the red triangle edges tend to encounter resistance and reverse — the fan effectively draws a multi-scale map of where selling pressure intensifies. The blue fan does the same for buyer pressure below. Taken together, the fan gives the trader a spatial reading of how pressure distributes across shorter and longer horizons.
A notable property observed during testing across multiple instruments and timeframes: regardless of triangle size or lookback period, B consistently produces values within the bounded range of -1 to +1. This is not a coincidence — it is a mathematical consequence of the symmetric ratio formula that derives B from the two triangle areas.
The formula
Both triangle areas are first computed using the Shoelace formula — a standard computational geometry method that yields the exact area of any polygon from its vertex coordinates. Then B is derived through a symmetric ratio:
r1 = A_hi / A_lo r2 = A_lo / A_hi B = (r1 - r2) / (r1 + r2)
When the seller triangle is much larger than the buyer triangle (A_hi >> A_lo), r1 grows large while r2 shrinks, and B approaches +1. When buyer pressure dominates, B approaches -1. When both areas are equal, B = 0 — balanced pressure. The formula is symmetric by construction, meaning it treats buyer and seller sides with identical mathematical weight.
Percentage conversion
To make B immediately readable on the chart, the indicator converts it into two percentage values:
Red % = (B + 1) x 50 seller dominance, scale 0 to 100
Blue % = (1 - B) x 50 buyer dominance, scale 0 to 100
Red % and Blue % always sum to 100. They are available in the Data Window for any bar and are exposed as alert-ready plots, allowing traders to set threshold-based alerts (e.g. "Red % crosses above 80") directly from TradingView's alert builder, without writing any code.
🔶 Features at a glance
🔸 Gradient barometer — A vertical column rendered to the right of the last bar. It splits the effective range into a red (seller) zone and a blue (buyer) zone, with the dividing line set by B. The gradient fades from full opacity at the split point to near-transparent at each range boundary, giving an immediate visual sense of which side is dominant and by how much.
🔸 Prime triangle fan — 25 filled triangles (one per prime offset from 3 to 101) overlaid on the chart. Upper triangles are colored red (seller pressure), lower triangles blue (buyer pressure). Together they form a fan that maps pressure intensity across multiple time horizons simultaneously. Optional dashed outlines can be enabled for each side independently.
🔸 Range lines with price labels — Horizontal lines marking the effective high and low of the lookback window. Each line carries a price label placed to the left of the range start. When the channel is frozen (see Freeze/Revival below), a snowflake icon (❄) appears on the labels.
🔸 Diamond markers and prime labels — At each prime-offset bar, a diamond marker is placed at both the range ceiling and the range floor. The corresponding prime number is displayed above the ceiling diamond, providing a visual ruler of the sampling structure.
🔸 Freeze / Revival system — When a confirmed close breaches the range boundary, the mother channel freezes and a child channel is born on the breach side. The child computes its own pressure metric (B'), and when the opposing force inside the child reaches a user-defined threshold, the mother channel revives. This mechanism tracks regime transitions without discarding the prior range context. A dedicated label at the breach candle shows the child's B' value in real time.
🔸 Live and Closed display modes — "Live" updates tick by tick using the current bar's data. "Closed" anchors all calculations on the last confirmed bar, eliminating intra-bar noise for traders who prefer signal stability.
🔸 Data Window and alert-ready plots — Three invisible plots (Red %, Blue %, raw B) are exposed in the Data Window and available for TradingView's alert condition builder. Traders can create threshold, crossover, or crossing alerts on any of these values without writing Pine Script.
🔸 Full visual customisation — Every visual element (triangle fill colors, line colors, diamond size, text size, barometer width, barometer offset, gradient steps) is independently configurable through the indicator's settings panel.
🔶 Deep dive: the barometer
The barometer is a vertical gradient column displayed to the right of the last bar on the chart. Its purpose is to translate the abstract B value into a shape that the eye can read instantly: a column split into a red zone (seller pressure) on top and a blue zone (buyer pressure) on the bottom.
The column spans the full effective range — from rangeLow at the bottom to rangeHigh at the top. The split point between red and blue is not placed at the midpoint of the range. Instead, it is calculated directly from B:
yMid = rangeHigh − (B + 1) × range / 2
When B = 0 (balanced), yMid sits at the exact center of the range. When B approaches +1 (full seller dominance), yMid drops toward the range floor, making the red zone fill nearly the entire column. When B approaches −1 (full buyer dominance), yMid rises toward the range ceiling, and the blue zone dominates.
The gradient is rendered using a configurable number of boxes (default: 50). In the red zone, opacity is strongest near yMid and fades to near-transparent at rangeHigh. In the blue zone, opacity is strongest near yMid and fades toward rangeLow. This creates a natural "heat" effect: the most intense color always concentrates at the boundary where the two forces meet.
At the top and bottom of the column, percentage labels display the Red % and Blue % values. These are the same percentages available in the Data Window, presented here as a quick visual reference.
The barometer responds to the selected display mode. In "Live" mode, it updates on every tick using the current bar's B value. In "Closed" mode, it uses the B computed from the last confirmed bar, providing a stable reading that does not flicker with intra-bar price movement.
Barometer settings
🔸 Show barometer — Toggle the entire barometer on or off. Default: on.
🔸 Offset (bars right) — How far to the right of the last bar the column is placed. Default: 11. Increase this if the barometer overlaps with other right-margin elements.
🔸 Width (bars) — The horizontal thickness of the column, measured in bars. Default: 5.
🔸 Gradient steps — The number of boxes used to render the gradient. Higher values produce a smoother fade. Default: 50.
🔶 Deep dive: the prime triangle fan
The triangle fan is the indicator's signature visual element. It renders 25 filled triangles on the chart — one for each prime offset from 3 to 101 — fanning out from the current bar toward the left side of the lookback window. Upper triangles are shaded red (seller pressure) and lower triangles are shaded blue (buyer pressure), each with high transparency so the underlying candlesticks remain clearly visible.
Every triangle in the fan shares two of its three vertices with the current bar: the bar's high (for upper triangles) or the bar's low (for lower triangles), and the corresponding range boundary at that bar. The third vertex sits at the range boundary at the prime-offset bar. Because each prime offset is a different distance back in time, the triangles vary in width — the smallest is narrow and captures very short-term pressure, while the largest stretches across the full lookback and captures the broadest structural picture.
Reading the fan as a pressure map
The fan functions as a multi-scale pressure map. Each triangle edge represents a boundary where one side's territory begins. When price approaches a cluster of red triangle edges from below, it is entering a zone where seller pressure intensifies across multiple time horizons simultaneously. The denser the overlap of red edges at a given price level, the stronger the structural resistance at that level. The same logic applies in reverse for blue edges and buyer support.
This is visible in practice: candles that push into the red fan often stall or reverse at the triangle boundaries, while candles that drop into the blue fan tend to find support. The fan gives the trader a spatial sense of how much room each side has — a wide blue zone with thin red edges suggests buyers have structural space to move, and vice versa.
Color flipping during freeze
When the Freeze/Revival system is active and price moves beyond the frozen range boundary, the triangle colors on the breached side flip to reflect the new structural reality.
Consider a downward breach: price closes below the frozen rangeLow and continues falling. The lower triangles — which normally appear blue to represent buyer territory — switch to red. This signals that what was once the buyer's domain has been structurally penetrated; the geometry now measures selling pressure extending below the old floor. At the same time, the upper triangles remain red as they always are, and because the distance between the current price and the frozen rangeHigh has grown dramatically, the seller area expands. The visual result: the entire fan turns uniformly red, reflecting overwhelming seller dominance across every time horizon in the fan.
The mirror case works identically. During an upward breach, price closes above the frozen rangeHigh and continues rising. The upper triangles flip from red to blue, signaling that seller space has been penetrated from below. The lower triangles remain blue, and because the gap between the current price and the frozen rangeLow is now vast, buyer area dominates. The entire fan turns uniformly blue, reflecting overwhelming buyer dominance.
The color flip is automatic and requires no user intervention. It is driven entirely by the relationship between the current price and the frozen boundaries — when price returns inside the frozen range, colors revert to their normal assignment.
Diamond markers and prime labels
At each prime-offset bar, the indicator places diamond-shaped markers at both the range ceiling and the range floor. Above the ceiling diamond, the prime number itself is displayed as a label. These markers serve as a visual ruler: they show the trader exactly where each sampling point falls in time and make the non-periodic spacing of the primes immediately visible on the chart.
Fan settings
🔸 Show lower triangle lines / Show upper triangle lines — Toggle dashed outlines for each side. Default: off. When enabled, the outlines make individual triangle edges more distinct, which can be helpful when reading overlapping edges at specific price levels.
🔸 Lower / Upper line color — Stroke color for the dashed outlines.
🔸 Lower / Upper fill color — Fill color and transparency for the triangle bodies. Default: high transparency so candles remain readable.
🔸 Show vertical lines — Draws a vertical line at each prime-offset bar. Default: off.
🔸 Show prime labels — Displays the prime number and diamond at each offset. Default: on.
🔸 Diamond color / Diamond size — Visual styling for the diamond markers.
🔸 Label text size — Font size for the prime number labels.
🔸 Deep dive: Freeze / Revival
Markets do not stay inside ranges forever. When price breaks out, most range-based indicators simply reset and start a new range from scratch, discarding whatever structural context existed before the breakout. The Freeze/Revival system takes a different approach: it preserves the prior range as a frozen reference while simultaneously tracking the new regime that emerges beyond it.
How a freeze is triggered
A freeze occurs when a confirmed close — not a wick, not an intra-bar spike — breaches the effective range boundary. The indicator compares the previous bar's close against the range that existed one bar before it, so the breach signal is fully confirmed and cannot repaint. Once a breach is detected:
🔸 The mother channel freezes — its high and low are locked at the values they held just before the breach.
🔸 A child channel is born on the breach side. For an upward breach, the child's floor is the frozen rangeHigh and its ceiling expands with each new high. For a downward breach, the child's ceiling is the frozen rangeLow and its floor drops with each new low.
🔸 A snowflake icon (❄) appears on the range price labels, and the triangle colors flip as described in the section above.
The child channel and B'
While the mother channel is frozen, the child channel computes its own independent pressure metric called B'. B' uses the same ICS triangle formula as the mother's B, but measured against the child's own boundaries. This means B' tracks the buyer/seller balance exclusively inside the new regime — the territory beyond the old range.
A dedicated label appears at the breach candle showing the current B' value, converted to the percentage of the opposing force. For a downward breach, the label displays the buyer percentage inside the child; for an upward breach, it displays the seller percentage. This tells the trader how much counter-pressure is building inside the breakout zone.
B' as a structural overbought / oversold reading
When B' shows a very low opposing-force percentage shortly after a breach, the breakout side is structurally dominant — price has moved aggressively beyond the old range with minimal resistance. This condition is analogous to what traders call an overbought or oversold state, but derived from geometry rather than from momentum oscillators. The reading reflects the spatial imbalance between the two forces inside the child channel: one side occupies nearly all the geometric territory.
As time passes, if the opposing force gradually builds — the B' percentage climbs — it signals that the breakout is losing its structural one-sidedness. The market is beginning to rebalance inside the new territory. Watching B' evolve over successive bars gives the trader a real-time gauge of whether the breakout retains its structural conviction or is approaching exhaustion.
Revival: when does the freeze end?
The freeze lifts when the opposing force inside the child channel reaches a user-defined threshold (default: 50%). At that point, the indicator interprets this as the exhaustion of the breakout: the force that drove the breach is being met by equal or greater counter-pressure. The freeze is lifted, all freeze state is reset, and the mother channel resumes normal range tracking. The snowflake icons, B' label, and color flips are removed.
The revival threshold is configurable. A lower value makes the system more sensitive — it revives sooner, treating even moderate counter-pressure as a regime reset. A higher value makes it more patient — it waits for stronger opposition before releasing the freeze. The default represents balanced equilibrium: the freeze ends when the opposing side has matched the breach side.
Why this matters
The Freeze/Revival cycle gives the trader a structured way to observe regime transitions. Rather than watching a range silently reset after a breakout, the trader sees the old range preserved as context (frozen lines with ❄), the new regime measured in real time (B' at the breach candle with its overbought/oversold implication), and a clear signal when the transition is complete (revival). This makes it possible to distinguish between a genuine regime change and a brief spike that reverts — without relying on arbitrary time delays or fixed-bar re-entry rules.
🔸 Reading the indicator
This indicator does not generate buy or sell signals. It is a measurement tool that quantifies the geometric balance between buyer and seller pressure. How that measurement is incorporated into a trading decision is entirely up to the trader. The following observations describe what the indicator shows, not what the trader should do.
The barometer as a quick-glance gauge
The barometer provides the fastest reading. A column dominated by red indicates that seller pressure is structurally larger than buyer pressure across the lookback window. A column dominated by blue indicates the reverse. When the split point sits near the center, pressure is approximately balanced. Watching how the split point migrates over successive bars reveals whether the pressure balance is shifting gradually or remaining stable.
The fan as a spatial context layer
The triangle fan adds spatial depth to the barometer's single-number reading. While the barometer tells you the current balance, the fan shows you where that balance is concentrated in price space. Areas where multiple triangle edges converge represent zones of intensified pressure — structural resistance above (red edges) or structural support below (blue edges). When price trades inside a region with sparse triangle coverage, it has more structural room to move before encountering the next pressure boundary.
Freeze events as regime markers
When a freeze occurs, it marks a structural event: price has left the established range. The frozen lines (marked with ❄) preserve the old context, and B' at the breach candle provides a real-time measure of how one-sided the new regime is. A very low opposing-force reading in B' indicates a structurally extended condition — the breakout side has occupied nearly all geometric territory. As B' climbs toward the revival threshold, it indicates increasing counter-pressure. The moment of revival itself marks the point where the new regime's one-sidedness has been structurally neutralized.
Combining readings
The three visual layers — barometer, fan, and freeze state — work together. For example, a barometer showing strong seller dominance combined with a fan whose red edges are densely clustered near the current price suggests concentrated structural resistance. If a freeze is also active with a low B', the structural picture is one of strong directional conviction on the breach side. Conversely, a barometer near balance with widely spaced fan edges and no active freeze suggests a structurally neutral environment.
Data Window and alerts
The Red %, Blue %, and raw B values are available in TradingView's Data Window for any bar by hovering over it. These same values are exposed as alert-ready plots, meaning traders can set alerts directly from TradingView's alert builder — for example, triggering when Red % crosses above or below a chosen level, or when B crosses zero. No Pine Script knowledge is required to create these alerts.
🔸 Open-source structure and reusability
This script is published open-source under the Mozilla Public License 2.0. The full computation pipeline — the Yang-Zhang volatility estimator, the ICS coordinate transformation, the Shoelace area calculation, and the symmetric ratio that produces B — is readable, auditable, and reusable.
B is a bounded output: it always falls between −1 and +1, carries no unit, and is computed from normalized geometry. These properties make it suitable as an input for other scripts. Examples of how B can serve as input to further analysis include:
🔸 Plotting B as a standalone oscillator with its own zero line and structural extremes.
🔸 Applying moving averages of different periods to B and studying their crossovers as indicators of shifting pressure regimes.
🔸 Using B as a weighting coefficient to scale other measurements by the current geometric pressure balance.
🔸 Comparing B across timeframes, since the ICS normalization makes the metric structurally comparable regardless of the chart resolution.
🔸 Testing for divergences between B and price action.
🔸 Using B as a filter condition for entry or exit logic in other strategies.
The code is available for study and extension under MPL 2.0. Traders and developers who wish to build on this metric have full access to its derivation.
🔸 Settings reference
Range Lines
🔸 Lookback length — Number of historical bars used to compute the high/low range. Default: 101.
🔸 Line width — Pixel width of the horizontal range lines. Default: 1.
🔸 Display mode — "Live" updates tick by tick using the current bar. "Closed" anchors on the last confirmed bar, eliminating intra-bar noise. Default: Live.
ICS
🔸 ICS Window — Number of bars fed into the Yang-Zhang volatility estimator. Controls how much historical data shapes the normalization sigma. Default: 101.
Prime Verticals and Labels
🔸 Show vertical lines — Draws a vertical line at each prime-offset bar. Default: off.
🔸 Show prime labels — Displays the prime number and diamond marker at each offset. Default: on.
🔸 Vertical line color — Color for vertical lines at prime offsets.
🔸 Diamond color — Color of diamond markers and their labels.
🔸 Label text size — Font size for prime number labels, in points.
🔸 Diamond size — Size of the diamond-shaped markers, in points.
Prime Triangles
🔸 Show lower triangle lines — Toggle dashed outlines for lower (buyer) triangles. Default: off.
🔸 Show upper triangle lines — Toggle dashed outlines for upper (seller) triangles. Default: off.
🔸 Lower line color — Stroke color for lower triangle dashed outlines.
🔸 Upper line color — Stroke color for upper triangle dashed outlines.
🔸 Lower fill color — Fill color and transparency for lower (buyer) triangle bodies.
🔸 Upper fill color — Fill color and transparency for upper (seller) triangle bodies.
Barometer
🔸 Show barometer — Toggle the barometer column on or off. Default: on.
🔸 Offset (bars right) — Horizontal distance from the last bar to the barometer column. Default: 11.
🔸 Width (bars) — Horizontal thickness of the barometer column. Default: 5.
🔸 Gradient steps — Number of boxes used to render the gradient. Higher values produce a smoother fade. Default: 50.
Freeze and Revival
🔸 Revival threshold (B') — When the opposing force inside the child channel reaches this percentage, the freeze ends and the mother channel resumes. A lower value revives sooner; a higher value waits for stronger counter-pressure. Default: 50.
🔸 Disclaimer
This indicator is a technical analysis tool designed for educational and informational purposes. It measures the geometric balance between buyer and seller pressure using the methodology described above. It does not predict future price movements, does not guarantee any outcome, and does not constitute financial, investment, or trading advice.
The B metric, the barometer, the triangle fan, and the Freeze/Revival system are structural measurements derived from historical price data. Like all technical indicators, they reflect past and present conditions and carry inherent limitations. Market conditions can change rapidly, and no single measurement tool can account for all factors that influence price.
Traders should use this indicator as one component within a broader analytical framework, always in combination with their own research, risk management practices, and judgment. Past performance of any reading or pattern observed through this indicator is not indicative of future results.
Use this tool at your own risk. The author assumes no liability for any trading decisions made based on the information provided by this indicator.
Индикатор Pine Script®






















