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

Auto Pattern Detector Targets [MarkitTick]💡 Operates as an advanced geometric mapping engine designed to automatically identify structural equilibrium states and dynamically project precise L-Pool extraction targets. This tool systematically scans raw time-series data to detect complex, multi-node fractal formations, mathematically verifying their symmetry and proportional validity before a kinetic breach occurs. By unifying dimensional pattern recognition with a strict quantitative filtration system, it provides traders with an objective, continuous visual feed of active market structures, fully calculated risk voids, and mathematically derived extraction zones.
● ✨ Originality and Utility
Standard geometrical analysis often falls victim to subjective interpretation and manual drawing errors, rendering statistical backtesting and real-time execution highly inconsistent. This system revolutionizes the approach by abstracting classical chart formations into an Algorithmic Liquidity Matrix. Instead of relying on approximate trendlines, it employs precise Void Node anchoring, measuring the exact percentage tolerances between swing vectors. The utility of this engine lies in its ability to actively discard false-positive structures by running them through a multi-layered verification process that accounts for standard deviation thresholds, volume kinetic spikes, and net-friction Risk:Reward parameters. It does not merely draw shapes; it engineers a complete, actionable mathematical hypothesis for every identified structure, complete with slippage and commission discounting.
● 🔬 Methodology and Concepts
• Algorithmic Void Node Collection
The core detection protocol does not use standard zigzag logic. Instead, it deploys an abstracted lookback and look-forward matrix to isolate Void Anchors. These anchors are stored in persistent memory arrays, allowing the engine to compare historical coordinate points against current price action to find symmetrical congruence.
• Geometric Void Projection
Once the requisite Void Anchors are collected, the system attempts to fit them into predefined topological models (such as bilateral compressions, horizontal equilibria, or multi-crest voids). It calculates the median delta between these anchors. If the variance falls within the user-defined Symmetry Tolerance, the structure is flagged as a "pending" sequence.
• Kinetic Breach Validation
A structure is only formalized when a Kinetic Breach is confirmed. This requires the price action to cleanly sever the boundary vector of the established Void. To prevent mapping noise, this breach can be strictly gated by checking if the moving average of volume has spiked by a specific multiplier, and if the breach distance exceeds an ATR-derived boundary.
• Friction-Adjusted R:R Filtration
To ensure that only mathematically viable structures are presented, the engine calculates the distance from the entry coordinate to the L-Pool Extraction target and the Risk Void. It then subtracts predefined slippage ticks and bidirectional percentage commissions from the gross reward. If this normalized Risk:Reward ratio falls below the minimum threshold, the sequence is silently invalidated and purged from the display.
● 🎨 Visual Guide
• Sliced Geometric Fills
Shaded Polygons: When a structure is detected, the area between the upper and lower boundary vectors is filled with a translucent color, mapping the precise domain of the Void.
Bullish Fills: By default, structures projecting an upward L-Pool extraction are shaded with a specific bullish tone.
Bearish Fills: Structures projecting a downward extraction are shaded with a specific bearish tone.
• Projection Vectors
Entry Line (Yellowish): A dashed boundary indicating the exact price coordinate where the Kinetic Breach was validated.
Target Line (Greenish): A dashed boundary indicating the projected L-Pool extraction zone, calculated via measuring the maximum depth of the active Void.
Stop Line (Reddish): A dashed boundary denoting the Risk Void, typically placed beyond the opposite structural boundary or calculated as a percentage of the target distance.
• The Analytics Dashboard
Pattern Bias: Displays the active geometric trajectory (Bullish or Bearish).
Active Pattern: Outputs the specific topological classification of the current Void sequence.
Vol Spike: A visual bar meter and percentage evaluating the current volume kinetics relative to the moving average, indicating the strength of the breach.
R:R Quality: A dynamic gauge rating the mathematical viability of the projection after accounting for all execution friction.
Pivot Depth: Evaluates the density of the collected Void Anchors feeding the current Algorithmic Liquidity Matrix.
● 📖 How to Use
• Sequence Identification
Allow the engine to operate without manual interference. When a new geometric Void is filled on the chart, visually inspect the projection vectors. The system has already filtered this sequence through the active tolerance parameters.
• Validating the Kinetic Breach
Do not front-run the Entry Line. The structure is mathematically confirmed only when the designated bar closes beyond the boundary (if strict closing is enabled) or pierces it with sufficient ATR momentum.
• Dashboard Confluence
Before executing any logic based on the mapped projection, consult the Analytics Dashboard. A high-quality sequence should ideally present a high Vol Spike percentage, confirming that the Kinetic Breach is supported by active market participation. Furthermore, ensure the R:R Quality gauge reflects a favorable asymmetry for your specific risk parameters.
• Extraction and Risk Management
The Target Line and Stop Line represent strict invalidation and extraction coordinates. If the price returns and breaches the Stop Line, the topological premise of the Void is mathematically nullified.
● ⚙️ Inputs and Settings
• General Tolerances
Symmetry Tolerance (%): The maximum allowed variance between Void Anchors to still be considered part of a uniform structure.
Level Tolerance (%): The strictness applied to horizontal alignment for flat-boundary formations.
Min Pattern Size: Gates out micro-structures by requiring the Void depth to exceed a specific ATR multiplier or raw price percentage.
• Structural Toggles
Allows the user to independently activate or disable the detection of specific topologies (e.g., bilateral compressions vs. horizontal channels).
• Void Anchor Parameters
Lookback Left/Right: The strict bar-count threshold used by the algorithm to confirm an isolated Void Anchor.
Max Pivots to Remember: Controls the depth of the historical array memory, optimizing engine performance.
• Filtration & Execution Costs
Require Candle Close/Body Breakout: Enforces strict logic where only the close or full body of the bar can trigger a Kinetic Breach.
Volume Spike Multiplier: The threshold of volume required relative to the SMA to validate the breach.
Min Risk:Reward Ratio: The baseline mathematical threshold for a valid setup.
Slippage (Ticks) & Commission (%): The raw friction metrics applied dynamically to the R:R calculation to ensure realistic projections.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The foundation of this system rests on the hypothesis of structural equilibrium within financial time-series data. Markets continuously cycle between phases of linear displacement and volumetric consolidation. During consolidation, price action forms distinct geometric boundaries driven by the algorithmic rebalancing of supply and demand. By quantifying these boundaries, we can treat the chart not as a random walk, but as a topological map of active liquidity matrices.
The engine utilizes an advanced array-based memory structure to index local extrema (Void Anchors). To prevent the algorithm from fitting noise into false geometries, it applies strict variance thresholds. This is scientifically akin to minimizing the residual sum of squares in regression models; if the coordinate points of the extrema deviate beyond the acceptable Z-Score-inspired boundaries of symmetry, the hypothesis of a coherent structure is rejected.
Upon the occurrence of a Kinetic Breach, the system applies standard deviation modifiers (Average True Range) to validate the momentum. A breach is only considered statistically significant if it occurs outside the normal distribution of localized volatility, essentially confirming a transition from equilibrium back into linear displacement. The volume moving average acts as a secondary confirmation factor, ensuring that the kinetic expansion is supported by a statistically anomalous influx of standard normal distribution participation.
Finally, the target projection relies on the concept of measured topological depth. The maximum amplitude of the consolidated Void is mathematically transposed to the point of the Kinetic Breach. This reflects the theory of energy conservation in market dynamics: the kinetic energy released during a breakout is roughly proportional to the potential energy stored during the preceding consolidation. By actively integrating execution friction (slippage and commission) into the final coordinate calculations, the engine shifts from purely theoretical geometry to applied quantitative modeling, providing a highly realistic framework for continuous market analysis.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indicator

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 PulseWire'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 PulseWire'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 PulseWire'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 PulseWire'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. Indicator

Triangle Pattern Detection [Dots3Red]Triangle Pattern Detection Indicator detects and draws triangle chart patterns in real time. The indicator identifies pivot highs and lows, validates converging trendlines, calculates the mathematical apex, and classifies each pattern by type.
How it works
The indicator scans for pivot highs and pivot lows using a configurable lookback length. Once two valid pivot highs and two valid pivot lows are found, it verifies that:
The trendlines are genuinely converging (spread shrinks from left to right)
No bar between the pivots violates the trendline boundary
The upper and lower patterns are aligned in time
The pattern meets minimum and maximum width requirements
If all conditions pass, the apex is calculated mathematically as the exact intersection point of the two trendlines, and the full triangle is drawn from the shared start bar to the apex.
Pattern Types Detected
Symmetrical Triangle — both lines converging toward each other
Ascending Triangle — flat upper resistance, rising lower support
Descending Triangle — declining upper resistance, flat lower support
Rectangle — both lines near horizontal
Visuals
🟡 Electric glow triangle
▼ / ▲ Pivot markers at pattern boundaries ( commented out in the code )
🔵 Bullish breakout signal / 🔴 Bearish breakout signal with glow effect and stem line
Number label at each triangle's start for cross-referencing with the info table
Info Table (top right)
Keeps a record of the last 5 detected triangles showing:
Column - Description
ID - Triangle number
Type- Pattern classification
Width - Pattern width in bars
BO date - The day the price broke out from the triangle pattern
Status - Live breakout status — Bull / Bear / Inside
The Status column updates on every bar so you can see in real time whether price has broken out of any recent pattern.
Settings
Pivot Length - Sensitivity of pivot detection (1–10). Lower = more patterns
Max Pattern Width - Maximum bars between first and second pivots
Start Bar Alignment Tolerance - Max distance between the start of the upper and lower pivots of the triangle's sides
Max Apex Distance - How far ahead the apex can project
Min Pattern Width - Filters out patterns that are too narrow to be meaningful
Breakout Threshold % - How far the price must close beyond the trendline to confirm a breakout
Notes
All triangles are drawn on the last bar only, avoiding repainting of historical patterns
Breakout detection scans from the leftmost bar of the pattern to the apex, firing on the first confirmed close beyond the boundary
Example on BTC 🪙 chart
Indicator

ATAI Triangles — Volume-Based & Price Pattern Analysis (v1.01)ATAI Triangles — Volume-Based & Price Pattern Analysis (v1.01)
Overview
ATAI Triangles identifies two synchronized triangle structures — Hi-Lo-Hi (HLH) and Lo-Hi-Lo (LHL) — and analyzes them both geometrically and volumetrically. For each triangle, volume is split between its two legs (segments), providing interpretable insights into buyer vs seller activity along each path.
The idea is that certain geometric shapes, when paired with volume distribution on each leg, can reveal patterns worth exploring. Users are encouraged to share their observations and interpretations in the PulseWire comments section so that more aspects of these triangle combinations can be discovered collectively.
Extra (for fun)
For a bit of entertainment, we’ve included a symbolic “hexagram” glyph that appears when both triangle types align in a particular way — it’s just a visual nod to geometry and has no predictive or trading value.
Interface & data clarity
- Inputs and parameters are organized by function (pattern geometry, volume analysis, visuals, HUD, labels).
- Each input includes tooltips explaining its purpose, units, and possible effects on calculations.
- All on-chart objects (polylines, labels, connectors) are named and colored to reflect their role, with volume values formatted in engineering notation (K, M, B).
- HUD columns and label texts use concise terms and consistent units, so that every displayed value is directly traceable to a calculation in the code.
- Daily and lower-timeframe volume series are clearly separated, with update logic documented to indicate intrabar provisional values vs finalized bar-close values.
Usage notes
Designed to be used alongside other indicators and chart tools for context; it is not a standalone signal generator.
All Buy/Sell volumes are absolute (non-negative); Δ = Buy − Sell.
Intrabar values update live and finalize at bar close (no repaint after close).
Disclaimer
For research, discussion, and educational purposes only. This is not financial advice and does not guarantee any outcome. Trade at your own risk.
Indicator

Expansion Triangle [TradingFinder] MegaPhone Broadening🔵 Introduction
The Expanding Triangle, also known as the Broadening Formation, is one of the key technical analysis patterns that clearly reflects growing market volatility, increasing indecision among participants, and the potential for sharp price explosions.
This pattern is typically defined by a sequence of higher highs and lower lows, forming within two diverging trendlines. Unlike traditional triangles that converge to a breakout point, the expanding triangle pattern becomes wider over time, leaving no precise apex for a breakout to occur.
From a price action perspective, the pattern represents a prolonged tug-of-war between buyers and sellers, where neither side has taken control yet. Each aggressive swing opens the door to new opportunities whether it's a trend reversal, range trading, or a momentum breakout. This dual nature makes the pattern highly versatile across market conditions, from exhausted trend ends to volatile consolidation zones.
The custom-built indicator for this pattern uses a combination of smart algorithms and detailed analysis of swing dynamics to automatically detect expanding triangles and highlight low-risk entry points.
Traders can use this tool to capitalize on high-probability setups from shorting near the upper edge of the structure with confirmation, to trading bearish breakouts during trend continuations, or entering long positions near the lower boundary during bullish reversals. The chart examples included in this article demonstrate these three highly practical trading scenarios in live market conditions.
A major advantage of this indicator lies in its structural filtering engine, which analyzes the behavior of each price leg in the triangle. With four adjustable filter levels from Very Aggressive, which highlights all potential patterns, to Very Defensive, which only triggers when price actually touches the triangle's trendlines the indicator ensures that only structurally sound and verified setups appear on the chart, reducing noise and false signals significantly.
Long Setup :
Short Setup :
🔵 How to Use
The pattern typically forms in conditions of heightened uncertainty and volatility, where price swings generate a series of higher highs and lower lows. The expanding triangle consists of three key legs bounded by diverging trendlines. The indicator intelligently analyzes each leg's direction and angle to determine whether a valid pattern is forming.
At the core of the indicator’s logic is its leg filtering system, which controls the quality of the pattern and filters out weak or noisy setups. Four structural filter modes are available to suit different trading styles and risk preferences. In Very Aggressive mode, filters are disabled, and the indicator detects any pattern purely based on the sequence of swing points.
This mode is ideal for traders who want to see everything and apply their own discretion.
In Aggressive mode, the indicator checks whether each new leg extends no more than twice the length of the previous one. If a leg overshoots excessively, the structure is invalidated.
In Defensive mode, the filter enforces a minimum movement requirement each leg must move at least 2% of the previous one. This prevents the formation of shallow, weak patterns that visually resemble triangles but lack substance.
The strictest setting, Very Defensive, combines all previous filters and additionally requires the price to physically touch the triangle’s trendlines before issuing a signal. This ensures that setups only appear when real market interaction with key structural levels has occurred, not based on assumptions or geometry alone. This mode is ideal for traders seeking maximum precision and minimal risk.
🟣 Bullish Setup
A bullish setup within the Expanding Triangle pattern occurs when price revisits the lower support boundary after a series of broad swings typically near the third leg of the formation. This area often represents a shift in momentum, where sellers begin to lose strength and buyers prepare to take control.
Ideally, the setup is accompanied by a bullish reversal candle (e.g. doji, pin bar, or engulfing) near the lower trendline. If the Very Defensive filter is active, the indicator will only issue a signal if price makes a confirmed touch on the trendline and reacts from that level. This significantly improves signal accuracy and filters out premature entries.
After confirmation, traders may choose to enter a long position on the bullish candle or shortly afterward. A logical stop-loss is placed just below the recent swing low within the pattern. The target can be set at or near the upper trendline, or projected using the full height of the triangle added to the breakout point. On higher timeframes, this reversal often marks the beginning of a strong uptrend.
🟣 Bearish Setup
A bearish setup forms when price climbs toward the upper resistance trendline, usually as the third leg completes. This is where buyers often begin to show exhaustion, and sellers step in with strength providing an ideal low-risk entry point for short positions.
As with the bullish setup, if the Candle Confirmation filter is enabled, the indicator will only show a signal when a bearish reversal candle forms at the point of contact. If Defensive or Very Defensive filters are also active, the setup must meet strict criteria of proportionate leg movement and an actual trendline touch to qualify.
Once confirmed, traders can enter on the reversal candle, placing a stop-loss slightly above the recent high. The target can be set at the lower trendline or calculated based on the triangle's full height, projected downward. This setup is particularly useful at the end of weak bullish trends or in volatile market tops.
🔵 Settings
🟣 Logic Settings
Pivot Period : Defines how many bars are analyzed to identify swing highs and lows. Higher values detect larger, slower structures, while lower values respond to faster patterns. The default value of 13 offers a balanced sensitivity.
Pattern Filter :
Very Aggressive : Detects all patterns based on point sequence with no structural checks.
Aggressive : Ensures each leg is no more than 2x the size of the previous one.
Defensive : Requires each leg to be at least 2% the size of the previous leg.
Very Defensive : The strictest level; only confirms patterns when price touches trendlines.
Candle Confirmation : When enabled, the indicator requires a valid confirmation candle (doji, pin bar, engulfing) at the interaction point with the trendline before issuing a signal. This reduces false entries and improves entry precision.
🟣 Alert Settings
Alert : Enables alerts for SSS.
Message Frequency : Determines the frequency of alerts. Options include 'All' (every function call), 'Once Per Bar' (first call within the bar), and 'Once Per Bar Close' (final script execution of the real-time bar). Default is 'Once per Bar'.
Show Alert Time by Time Zone : Configures the time zone for alert messages. Default is 'UTC'.
🔵 Conclusion
The Expanding Triangle pattern, with its wide structure and volatility-driven nature, represents chaos but also opportunity. For traders who can read its behavior, it provides some of the most powerful setups for reversals, breakouts, and range-based trades. While the pattern may seem messy at first glance, it is built on clear logic and when properly detected, it offers high-probability opportunities.
This indicator doesn’t just draw expanding triangles it intelligently evaluates their structural quality, validates price interaction through candle confirmation, and allows the trader to fine-tune the detection logic through adjustable filter levels. Whether you’re a reversal trader looking for a turning point, or a breakout trader hunting momentum, this tool adapts to your strategy.
In volatile or uncertain markets, where fakeouts and sudden shifts are common, this indicator can become a cornerstone of your trading system helping you turn volatility into structured, high-quality opportunities.
Indicator

Library

Indicator
