All indicators

Flag Breakout Forecasts

Mar 20, 2026

Static chart image
Volume BasedSignalsForecastingChannelsPatternsPivot Based (Retrospective)

The Flag Breakout Forecasts indicator identifies converging price channels (flags and symmetric wedges) and provides probabilistic breakout forecasts based on historical distribution and real-time volume data. It uses a zigzag-based pivot detection algorithm to confirm patterns and estimates the likelihood of imminent breakouts, helping traders anticipate market resolutions with statistical backing.

Usage

The Usage section describes how the script can be used to identify potential market moves. It highlights confirmed patterns with solid lines and emerging patterns with dashed lines.

  • Pattern Identification: Solid lines represent fully confirmed channels where three collinear pivots have been identified on both sides. Dashed lines indicate that one side is still awaiting a third confirmed pivot, providing an early detection signal.
  • Probability Labels: The label above active patterns shows P(break) (probability of an imminent breakout based on duration), and P(bull) / P(bear) (directional probabilities). A P(break) above 70% suggests the pattern is statistically overdue for a resolution.
  • Volume Analysis: The net volume gauge and statistics table offer insights into supply and demand balance. A bullish-leaning gauge combined with a high P(bull) reading reinforces a long bias.
  • Breakout Signals: Arrow labels appear on the chart when a price break is confirmed, displaying the total volume absorbed and the pattern's duration.

Details

This tool utilizes several advanced concepts to provide objective pattern analysis:

  • Collinearity & Convergence: The script measures the deviation of middle pivots from projected trendlines to ensure geometric accuracy. It specifically filters for narrowing gaps between trendlines to distinguish flags from parallel channels.
  • Probabilistic Forecasting: Breakout duration probabilities are calculated using a normal CDF approximation (Abramowitz & Stegun) applied to the z-scores of historical breakout data for the specific instrument.
  • Volume Integration: The directional probability is adjusted using the Net Volume Ratio, which maps the balance of up-close vs. down-close bars to a -100 to +100 scale.
  • Confirmation Logic: Breakouts are validated either by two consecutive closes outside the boundary or by a single high-momentum candle (body size > 3 standard deviations above the 20-bar mean).

Settings

Main Settings

  • Zig Zag Length: The time horizon for swing detection; lower values (e.g., 3-7) capture intraday moves, while higher values (10-20) are for swing trading.
  • Collinearity Tolerance (%): Determines how strictly pivots must align. Lower values require cleaner lines; higher values allow for more approximate formations.

Appearance

  • Show Pattern Volume Table: Toggles the visibility of the volume statistics table.
  • Table Size / Position: Customizes the scale and location of the volume data on the chart.
  • Bullish / Bearish Color: Sets the color scheme for breakout signals, table cells, and labels.

FAQ

  • How do I interpret the P(break) value? It represents the likelihood that the pattern will resolve soon. It increases as the current pattern's duration exceeds the historical average duration of previous breakouts.
  • What is the difference between solid and dashed lines? Solid lines mean the trendline is fully confirmed by three pivots. Dashed lines use a "running extreme" as a temporary third point, signaling a potential pattern that hasn't yet met all confirmation criteria.
  • How can I access Flag Breakout Forecasts? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.