Downloading...
OPEN-SOURCE SCRIPT

Expansion Triangle [TradingFinder] MegaPhone Broadening

1 196
🔵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:

snapshot

Short Setup:

snapshot


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

snapshot


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

snapshot


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

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.