
A technical analysis script identifying Bull and Bear Flag patterns on TradingView, highlighting potential price continuation trends through visual chart signals and pattern recognition.
Explore complementary indicator rolesHow it works
The script identifies flag patterns by first detecting a flagpole, which represents a significant price movement in a specific direction. It calculates percentage changes over a defined number of bars to determine the validity of the initial price surge, checking if the movement meets a user-specified threshold.
After identifying the flagpole, the script then examines the subsequent price consolidation period to confirm the flag pattern. It checks whether the price remains within specific bounds during the flag formation, using parameters like flag length and percentage change to validate the pattern's characteristics.
Why it may be useful
Flag patterns are crucial for traders as they provide insights into potential trend continuations, helping predict future price movements based on historical price action. These patterns offer a structured approach to understanding market momentum, allowing traders to identify potential entry and exit points with higher probability.
By incorporating visual signals and customizable parameters, the script enhances traders' ability to recognize and interpret market trends. The added features like cooldown periods and debugging labels further improve signal reliability and traders' understanding of the identified patterns.
When to explore it
Flag patterns work best in trending markets with clear directional movements, where price experiences sharp initial moves followed by consolidation periods. They are particularly effective in markets displaying strong momentum, such as during breakout scenarios or when significant news events influence price action.
Traders should utilize this script across various timeframes and financial instruments, adjusting parameters to suit specific market conditions. It is most reliable when combined with other technical analysis tools and fundamental market understanding, providing a complementary approach to trading decision-making.
Keep exploring
What we’ve verified
Access, alerts and repainting behaviour have not been independently verified for this indicator. Check the creator’s current publication and settings.
General descriptions and classifications are recovered research. Verified details above identify the specific checks we have completed. Check the creator’s current publication for later changes.

![Flag Screener [QuantVue] chart preview](https://s3.tradingview.com/n/ne686qmR.png?v=1732373918)
![Flags and Pennants [Trendoscope®] chart preview](/_next/image?url=%2Fmedia%2F27194.png&w=3840&q=90&dpl=dpl_Jt27hmzh6tNsGuJ13vyBBWgv8XSW)
![Flags With Measured Move [QuantVue] chart preview](https://s3.tradingview.com/b/bSHQwqcV.png?v=1716296216)


