**Indicator Type:** Overlaid on the chart (overlay=true)
**Main Features:**
- Detection and visualization of various technical patterns. - Generation of BUY and SELL signals based on detected patterns. - Display of Fibonacci levels to identify potential support and resistance levels. - Ability to enable or disable each pattern through the indicator settings.
---
**Indicator Settings**
**Switches to Enable/Disable Patterns**
At the top of the indicator, there are parameters that allow the user to select which patterns will be displayed on the chart:
- Three Drives - Rounding Top - Rounding Bottom - ZigZag Pattern - Inverse Head and Shoulders - Fibonacci Retracement
**Parameters for ZigZag**
Settings are also available for the ZigZag pattern, such as the depth of peak and trough detection, allowing the user to adjust the indicator's sensitivity to price changes.
---
**Pattern Detection**
Each pattern is implemented with its own logic, which checks specific conditions on the current bar (candle). Below are the main patterns:
1. **Three Drives** - **Description:** This pattern consists of three consecutive price movements in one direction (up or down). It can signal the continuation of the current trend or its reversal. - **How It Works:** - **Upward Drive:** The indicator checks that the closing price of each subsequent candle is higher than the previous one for three bars. - **Downward Drive:** The indicator checks that the closing price of each subsequent candle is lower than the previous one for three bars.
2. **Rounding Top** - **Description:** A pattern representing a smooth decrease in maximum prices over several bars, which may indicate a potential downward trend reversal. - **How It Works:** - The indicator checks that the maximum prices of the last five bars are gradually decreasing, and the current bar shows a decrease in the maximum price.
3. **Rounding Bottom** - **Description:** A pattern characterized by a smooth increase in minimum prices over several bars, signaling a possible upward trend reversal. - **How It Works:** - The indicator checks that the minimum prices of the last five bars are gradually increasing, and the current bar shows an increase in the minimum price.
4. **ZigZag Pattern** - **Description:** Used to identify corrective movements on the chart. The pattern shows peak and trough points connected by lines, helping to visualize the main price movement. - **How It Works:** - The indicator uses a function to determine local maxima and minima based on the specified depth. - Detected peaks and troughs are connected by lines to create a visual zigzag structure.
5. **Inverse Head and Shoulders** - **Description:** An inverted head and shoulders formation signals a possible reversal of a downward trend to an upward one. - **How It Works:** - The indicator looks for three local minima: the left shoulder, the head (the lowest minimum), and the right shoulder. - It checks that the left and right shoulders are approximately at the same level and below the head.
6. **Fibonacci Retracement Levels** - **Description:** Automatically builds key Fibonacci levels based on the maximum and minimum prices over the last 50 bars. These levels are often used as potential support and resistance levels. - **How It Works:** - Daily, the minimum and maximum prices over the last 50 bars are calculated. - Based on these values, Fibonacci levels are drawn: 100%, 23.6%, 38.2%, 50%, 61.8%, and 0%. - Old levels are removed when a new day begins to keep the chart clean and up-to-date.
---
**Generation of Buy and Sell Signals**
The indicator combines the results of detected patterns to generate trading signals:
- **Buy Signals (BUY):** - Rounding Bottom - Three Drives Up - Inverse Head and Shoulders - ZigZag Low
- **Sell Signals (SELL):** - Rounding Top - Three Drives Down - Inverse Head and Shoulders - ZigZag High
**How It Works:**
- If one or more buy conditions are met, a "BUY" label is displayed below the corresponding bar on the chart. - If one or more sell conditions are met, a "SELL" label is displayed above the corresponding bar on the chart.
---
**Visualization of Patterns on the Chart**
Each detected pattern is visualized using various graphical elements, allowing traders to easily identify them on the chart:
- **Three Drives Up:** Green upward triangle below the bar. - **Three Drives Down:** Red downward triangle above the bar. - **Rounding Top:** Orange "RT" label above the bar. - **Rounding Bottom:** Blue "RB" label below the bar. - **Inverse Head and Shoulders:** Turquoise "iH&S" label below the bar. - **ZigZag High/Low:** Purple circles at the peaks and troughs of the zigzag.
---
**Displaying Fibonacci Levels**
Fibonacci levels are displayed as horizontal lines on the chart with corresponding labels. These levels help traders determine potential entry and exit points, as well as support and resistance levels.
---
**Drawing ZigZag Lines**
ZigZag lines connect the detected peaks and troughs, visualizing corrective movements. To avoid cluttering the chart, the number of lines is limited, and old lines are automatically removed as new ones are added.
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.