OPEN-SOURCE SCRIPT
3-1-3 Pattern

This Pine Script indicator analyzes and visualizes a specific candlestick pattern called the "3-1-3 Pattern" across multiple timeframes. Here's what it does:
Core Functionality
Pattern Detection: The script looks for a 7-bar candlestick pattern:
Bearish 3-1-3: 3 red candles + 1 green candle + 3 red candles
Bullish 3-1-3: 3 green candles + 1 red candle + 3 green candles
Visual Output
When a 3-1-3 pattern is detected, the script:
Creates a colored box around the middle bar (bar 3) of the pattern
Adds a small label showing the pattern type ("Bear 1H" or "Bull 4H", etc.)
Extends the box forward until the price breaks above the pattern's high or below its low
Pattern Management
The script actively manages the patterns by:
Tracking active patterns for each timeframe separately
Removing expired patterns when price breaks the pattern's high/low levels
Extending boxes to the current time to keep them visible
Practical Use
This indicator helps traders:
Spot reversal patterns across multiple timeframes simultaneously
See confluence when patterns align on different timeframes
Track pattern validity (boxes disappear when invalidated by price action)
Essentially, it's a multi-timeframe pattern recognition tool that automatically identifies and tracks these specific 7-bar reversal patterns on your chart.
Core Functionality
Pattern Detection: The script looks for a 7-bar candlestick pattern:
Bearish 3-1-3: 3 red candles + 1 green candle + 3 red candles
Bullish 3-1-3: 3 green candles + 1 red candle + 3 green candles
Visual Output
When a 3-1-3 pattern is detected, the script:
Creates a colored box around the middle bar (bar 3) of the pattern
Adds a small label showing the pattern type ("Bear 1H" or "Bull 4H", etc.)
Extends the box forward until the price breaks above the pattern's high or below its low
Pattern Management
The script actively manages the patterns by:
Tracking active patterns for each timeframe separately
Removing expired patterns when price breaks the pattern's high/low levels
Extending boxes to the current time to keep them visible
Practical Use
This indicator helps traders:
Spot reversal patterns across multiple timeframes simultaneously
See confluence when patterns align on different timeframes
Track pattern validity (boxes disappear when invalidated by price action)
Essentially, it's a multi-timeframe pattern recognition tool that automatically identifies and tracks these specific 7-bar reversal patterns on your chart.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。