Skip to content
Scan guide

Bull Flag Scanner

Stocks that ran, paused on lighter volume and broke the pause.

What the setup is

A bull flag scan looks for three things in order: a sharp move up (the pole), a short, shallow pullback on lighter volume (the flag), and a trade above the top of the flag. Each part is easy to state. The scan is only useful if it checks that they happened in that order and close together.

Most scanners cannot. They can list stocks up 5% with volume, or stocks a little below their high, but both lists are full of names that never flagged: stocks that faded all morning, stocks that ran late and have not paused, and stocks that pulled back on heavier volume than the run. A flag is a sequence, and a snapshot of current values does not contain one.

The version below splits the last 30 one-minute bars into two windows. The earlier 20 bars must hold the pole, the most recent 10 must hold a tight flag with lighter volume, and the last trade must clear the flag high.

The scan as a sentence

In Fastur you can describe the scan in plain English. For this setup the sentence looks like this:

ran 5% in the 20 minutes before the last 10, pulled back less than half of it on lighter volume, and just broke the pullback high

The assistant turns that into code you can read. The core of it is below. It is a fragment that shows the idea, not a complete script.

PoleHigh = m1.high[11:30].max
logicblock FlagPole = PoleHigh > m1.close[30] * 1.05
logicblock FlagHolds = m1.high[1:10].max < PoleHigh and m1.low[1:10].min > (PoleHigh + m1.close[30]) / 2 and m1.volume[1:10].mean < m1.volume[11:30].mean * 0.6
logicblock FlagBreak = FlagPole and FlagHolds and trade.last > m1.high[1:10].max

What each part checks

PoleHigh > m1.close[30] * 1.05
The pole. The highest price of bars 11 to 30 is more than 5% above the close 30 bars ago, so the run happened in the earlier window.
m1.high[1:10].max < PoleHigh
No new high in the last 10 bars. The stock paused instead of grinding higher, so the pole high came first.
m1.low[1:10].min > (PoleHigh + m1.close[30]) / 2
The pullback gave back less than half of the pole. A deeper retrace is a failed move, not a flag.
m1.volume[1:10].mean < m1.volume[11:30].mean * 0.6
Average volume per bar in the flag is under 60% of the pole. Sellers did not show up on the pullback.
trade.last > m1.high[1:10].max
The last trade is above the highest price of the flag. This is the trade that lists the stock.

The choices that change the results

Flag high or trendline
Breaking the flag high is a level the scan can check exactly. Many traders enter on a break of the falling line across the flag highs instead, which is earlier and lists more stocks that fail. The flag high trades a later entry for fewer false starts.
Pole size and timeframe
Five percent in 20 one-minute bars suits small and mid caps in the morning. Large caps rarely move that much, so use 2% or switch to five-minute bars with the same shape for slower flags.
How deep the flag can go
Half the pole is a loose limit. A third keeps only the tightest flags, the ones that barely give anything back, and the list gets much shorter.
Where the flag sits
A flag that holds above VWAP or above the premarket high is a different trade from one that sits below them. Add the level you care about as one more condition on the flag low.

Common mistakes

Fixed windows on a moving pattern
Real flags are not exactly 20 and 10 bars long. The windows slide forward every minute, so a flag usually fits at some point, but a long, slow flag will not. Run a second version on five-minute bars rather than stretching the one-minute windows.
Ignoring volume in the flag
A pullback on volume as heavy as the run is distribution, not a pause. Without the volume line the scan lists both, and they look the same on a price-only chart.
Checking it on a timer
The break of the flag high is a single trade. A scan that runs every minute lists the stock after the breakout bar has closed, often near its high. Checking every trade lists it on the break.

Questions

How do you scan for bull flags?
Check three things in order over two windows of bars: a strong move up in the earlier window, a shallow pullback with lighter volume and no new high in the recent window, and a trade above the high of that recent window.
What makes a bull flag valid?
A sharp pole, a pullback that holds the upper half of it, lighter volume during the pullback than during the run, and a break of the flag on rising volume. A deep or heavy pullback is usually a failed move.
Can a stock screener find bull flags?
A screener can find stocks that are up and near their highs, but it cannot check that the run came before the pullback or that volume fell during it. That takes conditions on separate windows of bars, which most screeners don't offer.
Build the scan

Write a scan, then run it live

Create the logic once, run it live, and let scanner alerts tell you what changed.

New LogicBlockDescribe it in plain English
up 5% today on triple its usual volume
MomoVolumein scan
trade.last >= d1.close[1] * 1.05 and d1.volume >= d1.volume[1:20].mean * 3
Momo Volumelive, every trade6 matches
TickerLastChg%RelVol
NXAT0.82+27.69%5.51
RAYA0.82+25.40%7.39
DOGZ0.28+23.93%19.24
TRUG0.31+19.16%3.39
MNDR0.57+13.51%4.87
FINV2.57+5.59%5.38
Alert logFINV entered