TradingView chart patterns

Bull flag pattern: measure the pause before the breakout

A bull flag pattern is an upward price impulse followed by a short consolidation inside roughly parallel boundaries. The impulse is the flagpole; the pause is the flag. A bullish flag pattern remains a candidate until price breaks the upper boundary under your chosen confirmation rule. A closing break can still reverse, so the shape alone does not establish a profitable trade.

See the decision guide

An illustrative specification for a bull flag chart pattern

There is no single threshold set implied by the name bull flag. This example uses a deliberately simple fixed-window definition, ordinary price candles and positive prices. Choose a start bar before examining its outcome. Let S be its close, E the close six bars later, and H = E - S. The next six completed bars form the proposed flag. These choices are hypothetical research rules, not recommended settings or the TradingView built-in algorithm.

  • Before confirmation, reject at a completed bar if its low is below E - 0.40H or its close is below L(t). Check rejection before breakout on the same bar. If neither occurs by the close of flag bar 10, expire the candidate.
  • The first-to-last-high line is a strict custom construction. A visually plausible flag can fail it. Do not move an anchor after seeing a breakout just to admit that example.
  • For an automated scan, also specify how start bars are selected and whether overlapping windows are allowed. This worked example classifies one preselected window; it does not define a market-wide scanner.
FeatureRule for this exampleMeaning
Upward poleH / S is at least 8%; at least five of the six close-to-close changes are positiveA concentrated advance rather than a small drift
Channel slopeJoin the highs of flag bars 1 and 6; slope m = (high6 - high1) / 5. Require -0.03 ≤ m / H ≤ 0Flat to downward slope, normalized by the pole height
Parallel boundariesU(t) = high1 + m × (t - 1). Reject if any of the six highs exceeds U(t). Set W to the largest U(t) - low(t), and L(t) = U(t) - WA fixed upper line and parallel lower line enclosing the six bars
Width and retracementRequire 0 < W / H ≤ 20% and 0 ≤ (E - lowest flag low) / H ≤ 40%The pause stays narrow and gives back a limited part of the advance
Confirmation windowEvaluate only flag bars 7 through 10; require close > U(t)The channel is known before the first eligible signal

Read the formation one bar at a time

This hypothetical bull flag pattern chart is represented as a price table so each observation can be checked. The pole closes at bars 0 through 6 are 100, 102, 104, 103.5, 106, 108 and 110. The gain is 10%, with five positive changes. Thus E = 110 and H = 10. The following rows are the six consolidation bars; t counts from the first bar after the pole.

  • At bar 12, m = (108.60 - 109.80) / 5 = -0.24 price units per bar. The normalized slope is -2.4% of the pole per bar. W = 1.20, or 12% of H; the deepest retracement is (110 - 107.40) / 10 = 26%. All pass the stated limits.
  • The equations become U(t) = 109.80 - 0.24 × (t - 1) and L(t) = U(t) - 1.20. Their anchors stay fixed, but their prices continue to change with each bar.
  • Bar 13 is not a confirmed breakout: 108.20 is below 108.36. Bar 14 is the first eligible closing break. A close exactly on the line would not qualify.
  • An alternative bar 14 closing below L(8) = 106.92 would invalidate the candidate. A low below 106 would also invalidate it, even if the close finished above the upper line.
Chart bar / tHighLowCloseInformation available
7 / 1109.80108.80109.20First proposed flag bar
8 / 2109.30108.36108.80The six-bar window is incomplete
9 / 3109.20108.50108.90Still forming
10 / 4109.08108.30108.70Still forming
11 / 5108.60107.90108.20One more completed bar is needed
12 / 6108.60107.40108.00Freeze the channel at this close
13 / 7108.60107.50108.20Wick crosses U = 108.36; close does not
14 / 8109.00107.80108.70Close exceeds U = 108.12: confirmation

Compare a flag with a pennant, a pullback and a failed continuation

StockCharts distinguishes flags by their parallel boundaries and pennants by their converging boundaries. Both require a preceding impulse. An ordinary pullback is a broader description: it need not fit either geometry. Keep those classifications separate when reviewing a bullish flag chart pattern.

  • For this example, label a continuation failed if any of the next three closes is below the saved breakout-boundary value, 108.12. A close of 107.90 at bar 16 meets that definition. This custom label is neither a protective stop nor the TradingView built-in Failed status.
  • Keep the bar 14 confirmation in the record after failure. Deleting losing signals or retaining only completed targets makes historical pattern displays misleading.
  • Volume is optional in this numerical example. If adding a breakout-volume filter, define its baseline, multiplier and behavior when volume is missing before comparing results.
Observed structureClassificationDecision
Strong advance, short parallel pauseBull flag candidateWait for the defined closing break
Strong advance, narrowing triangleBullish pennant candidateUse a convergence rule instead of this parallel channel
Decline after an advance, no qualifying channelOrdinary pullbackReject from this flag sample without predicting its next move
Valid upper break followed by a return below the saved breakout levelPossible failed continuationApply the failure horizon chosen before the test

TradingView drawings and usable signals have different timestamps

TradingView documents 5/5 pivots for its Bullish Flag indicator and uses closing prices to fix breakouts. A five-bar right-side pivot cannot be confirmed on the original swing bar. Its In Progress mode can include final points that are not yet pivots. That mechanism differs from the fixed-window example above.

  • Record the swing bar, the bar when its geometry became known, and the breakout bar separately. A drawing anchored in the past does not establish that an alert could have fired there.
  • If a custom pivot detector sees a break before all required anchors are confirmed, define whether to reject it or record a provisional event. Do not backdate the trade when later candles confirm the anchors.
  • Completed-bar checks avoid acting on an unfinished close. They do not remove every repainting cause; TradingView also documents historical plotting and data revisions.

Test the trading rules after checking the detector

A pole-length projection from the example breakout boundary is 108.12 + 10 = 118.12. It is a geometric reference, not a forecast or a measured probability. Before using it as an exit, define the entry, stop, position size and maximum holding period. A strategy can lose even when its detector follows every rule.

  • With default TradingView strategy behavior, an order created at a bar close fills at the next available tick, normally the next historical bar open. The bar 14 closing price of 108.70 is not evidence of an executable fill there.
  • Include commission and slippage, preserve gap effects, and keep chart type, session and timeframe fixed. Check the event sequence separately from the profit report.
  • Expose pole threshold, channel slope, retracement and expiry as inputs only after their definitions are complete. Compare parameter sets with the same trade and cost model, then examine a separate period. Selecting the best historical result does not demonstrate a durable edge.
  • Give the written specification to Pineify to draft the detector or strategy. Request a syntax check and inspect the generated events. Strategy Optimizer can then compare supported strategy input combinations; it cannot decide whether your definition of a flag is economically useful.
Where Pineify fits

Pine Script AI Coding Agent

Draft a bull-flag script from explicit pole, channel, retracement and confirmation rules. Review its logic and request syntax validation before testing. This educational page does not scan live markets.

Also useful: Strategy Optimizer. Compare parameter combinations for an implemented TradingView strategy. Set execution costs in the test and review a separate period before interpreting the selected settings.

Draft bull-flag rules

Frequently asked questions

Educational information, not investment advice. All prices, thresholds and outcomes in the worked example are hypothetical. No backtest or live performance is presented. A confirmed pattern or geometric target does not guarantee continuation, execution price or profit.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.