Bull/bear Flag
By LuxAlgoJun 14, 2026
Bull/bear Flag detects flags from measured rules rather than trendline eyeballing: a near-vertical pole built from strong closes, a brief counter-drift channel fitted to the pause by least squares, and a decisive close out of the channel in the pole's direction. It is the definitive clean build of the bull and bear flag pattern — pole height, flag depth, tilt, and bar-range contraction are all enforced before a label prints.
How to Trade the Bull/bear Flag?
- Bull Flag / Bear Flag label: the pause qualified — the pole and parallel channel draw while the pattern is live.
- Breakout triangle: the bar closes outside the flag boundary on the pole's side; a dotted line projects the measured target — pole height from the breakout.
- Diamond: the measured target was reached.
- Cross: a close beyond the far flag edge — the stop side — invalidates the pattern.
Flags are continuation trades: the pause should be passive profit-taking inside an impulse. The same logic anchors much of the chart pattern family.
Bull/bear Flag Settings
- ATR Length (default 14): the volatility unit for pole height.
- Maximum Pole Duration (default 10): longest span from pole origin to tip.
- Minimum Pole Height (ATR) (default 3): smallest qualifying impulse.
- Strong Closes (%) (default 60): share of pole bars closing in the impulsive half of their range.
- Flag Duration (default 4 to 15): fewest and most pause bars.
- Maximum Flag Depth (% of Pole) (default 50): deepest retracement allowed.
- Maximum With-Trend Tilt (% of Pole) (default 10): a channel drifting steeply with the pole is rejected.
- Require Bar-Range Contraction (default on): flag bars must average smaller ranges than pole bars.
- Volume Filter (default off): the classical contraction-then-expansion signature; bypassed without volume data.
- Style toggles (Show Pole, Channel Fill, Pattern Labels, Show Measured Target, Event Markers, all default on).
Frequently Asked Questions
What separates a flag from a pennant?
The shape of the pause. A flag drifts inside two parallel boundaries; a pennant contracts into a small converging triangle. Both follow the same impulsive pole and share the measure rule.
Why did a drawn flag disappear?
The candidate degraded — too long, too deep, or tilted with the trend — and was deleted rather than left posing as a pattern. That deletion is the qualification working.
Is the measured target a prediction?
No — it is the classical first objective, the pole's height projected from the breakout. Treat it as a planning device for partials or risk-reward math rather than an exit promise.
The Library is free. Quant makes it yours.
Pull any concept or indicator into Quant: rebuild it, retune it, or turn it into a backtested strategy of your own.
