OPEN-SOURCE SCRIPT
Head-Flag basic

Attention:
I've been waiting... seconds, minutes, even hours... But the real one isn't there. They're ghosts, illusions.
Yet, look... the eyes of humanity are fixed on that.
Detailed Description: How to Use the "Head-Flag Basic" Indicator
This indicator is designed to automatically detect classic chart patterns widely used in technical analysis. These patterns help identify possible trend reversals or continuations. The script works on any timeframe and with any asset, as long as data is available.
Patterns Detected by the Indicator
Head and Shoulders
A red cross appears above the bar.
Indicates a potential reversal from an uptrend to a downtrend.
The pattern forms when there’s a higher peak (the head) between two lower peaks (the shoulders), and the current low is below the middle low.
Inverted Head and Shoulders
A green diamond appears below the bar.
Indicates a potential reversal from a downtrend to an uptrend.
The opposite of the previous pattern: there’s a lower trough (the head) between two higher troughs (the shoulders), and the current high exceeds the head’s high.
Bull Flag
A blue flag appears below the bar.
Suggests a potential continuation of an upward trend.
The price forms higher highs and lows, and closes above a recent resistance.
Bear Flag
A yellow flag appears above the bar.
Suggests a potential continuation of a downward trend.
The price forms lower highs and lows, and closes below a recent support.
Ascending Triangle
A purple triangle appears above the bar.
Signals a consolidation pattern with a potential breakout to the upside.
Highs are flat (horizontal resistance), while lows are rising.
Descending Triangle
An orange triangle appears below the bar.
Signals a consolidation pattern with a potential breakout to the downside.
Lows are flat (horizontal support), while highs are falling.
How to Use the Indicator on the Chart
Copy the Pine Script code and paste it into the TradingView Pine Editor.
Click “Add to Chart.”
The indicator will automatically display graphic symbols above or below bars when patterns are detected.
Use the signals as alerts. Always confirm with other tools (such as volume, moving averages, RSI, or support/resistance zones).
Never trade solely based on the indicator. It should serve as a visual clue — not a confirmation by itself.
Final Notes
This is a simple, visual, and straightforward indicator. It helps you notice patterns that may go unnoticed in the market’s flow. However, no tool should be used in isolation. Use it wisely, validate it with broader context, and always follow your risk management plan.
I've been waiting... seconds, minutes, even hours... But the real one isn't there. They're ghosts, illusions.
Yet, look... the eyes of humanity are fixed on that.
Detailed Description: How to Use the "Head-Flag Basic" Indicator
This indicator is designed to automatically detect classic chart patterns widely used in technical analysis. These patterns help identify possible trend reversals or continuations. The script works on any timeframe and with any asset, as long as data is available.
Patterns Detected by the Indicator
Head and Shoulders
A red cross appears above the bar.
Indicates a potential reversal from an uptrend to a downtrend.
The pattern forms when there’s a higher peak (the head) between two lower peaks (the shoulders), and the current low is below the middle low.
Inverted Head and Shoulders
A green diamond appears below the bar.
Indicates a potential reversal from a downtrend to an uptrend.
The opposite of the previous pattern: there’s a lower trough (the head) between two higher troughs (the shoulders), and the current high exceeds the head’s high.
Bull Flag
A blue flag appears below the bar.
Suggests a potential continuation of an upward trend.
The price forms higher highs and lows, and closes above a recent resistance.
Bear Flag
A yellow flag appears above the bar.
Suggests a potential continuation of a downward trend.
The price forms lower highs and lows, and closes below a recent support.
Ascending Triangle
A purple triangle appears above the bar.
Signals a consolidation pattern with a potential breakout to the upside.
Highs are flat (horizontal resistance), while lows are rising.
Descending Triangle
An orange triangle appears below the bar.
Signals a consolidation pattern with a potential breakout to the downside.
Lows are flat (horizontal support), while highs are falling.
How to Use the Indicator on the Chart
Copy the Pine Script code and paste it into the TradingView Pine Editor.
Click “Add to Chart.”
The indicator will automatically display graphic symbols above or below bars when patterns are detected.
Use the signals as alerts. Always confirm with other tools (such as volume, moving averages, RSI, or support/resistance zones).
Never trade solely based on the indicator. It should serve as a visual clue — not a confirmation by itself.
Final Notes
This is a simple, visual, and straightforward indicator. It helps you notice patterns that may go unnoticed in the market’s flow. However, no tool should be used in isolation. Use it wisely, validate it with broader context, and always follow your risk management plan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.