OPEN-SOURCE SCRIPT
已更新 Inside/Outside Bars

---
Inside/Outside Bars Detector
This indicator identifies and visualizes Inside Bars and Outside Bars (Engulfing Bars) on your chart, helping traders spot potential breakout and consolidation patterns.
What are Inside/Outside Bars?
• Outside Bars (Outer Bars): Candles that break BOTH the high AND low of the previous candle. These represent periods of increased volatility and potential trend continuation or reversal. Marked with red triangle arrows by default.
• Inside Bars (Inner Bars): Candles where NEITHER the high NOR low breaks the previous candle's range. These represent consolidation and often precede significant price moves. Marked with orange triangle arrows by default.
Features:
✓ Visual arrows above bars for easy identification
✓ Fixed pixel-size arrows that remain visible at any chart zoom level
✓ Statistics table showing counts of outer bars, inner bars, and total bars analyzed
✓ Fully customizable with multiple settings
Customization Options:
• Toggle outer bars and inner bars independently
• Customize arrow colors for each pattern
• Show/hide the statistics table
• Adjust calculation bars (1000 default, max 5000)
• Set to 0 to analyze all available bars up to 5000
How to Use:
Inside bars often indicate consolidation before a breakout, while outside bars suggest increased volatility and potential momentum shifts. Use these patterns in conjunction with your trading strategy to
identify entry/exit points or to confirm trend direction.
---
Inside/Outside Bars Detector
This indicator identifies and visualizes Inside Bars and Outside Bars (Engulfing Bars) on your chart, helping traders spot potential breakout and consolidation patterns.
What are Inside/Outside Bars?
• Outside Bars (Outer Bars): Candles that break BOTH the high AND low of the previous candle. These represent periods of increased volatility and potential trend continuation or reversal. Marked with red triangle arrows by default.
• Inside Bars (Inner Bars): Candles where NEITHER the high NOR low breaks the previous candle's range. These represent consolidation and often precede significant price moves. Marked with orange triangle arrows by default.
Features:
✓ Visual arrows above bars for easy identification
✓ Fixed pixel-size arrows that remain visible at any chart zoom level
✓ Statistics table showing counts of outer bars, inner bars, and total bars analyzed
✓ Fully customizable with multiple settings
Customization Options:
• Toggle outer bars and inner bars independently
• Customize arrow colors for each pattern
• Show/hide the statistics table
• Adjust calculation bars (1000 default, max 5000)
• Set to 0 to analyze all available bars up to 5000
How to Use:
Inside bars often indicate consolidation before a breakout, while outside bars suggest increased volatility and potential momentum shifts. Use these patterns in conjunction with your trading strategy to
identify entry/exit points or to confirm trend direction.
---
發行說明
percent added to stats table 發行說明
# Inside/Outside Bars DetectorThis indicator identifies and visualizes **Inside Bars**, **Outside Bars** (Engulfing Bars), and **Mother Bars** on your chart, helping traders spot potential breakout and consolidation patterns.
## What are Inside/Outside/Mother Bars?
### Outside Bars (Outer Bars)
Candles that break **BOTH** the high AND low of the previous candle. These represent periods of increased volatility and potential trend continuation or reversal.
- Marked with **red triangle arrows** by default
### Inside Bars (Inner Bars)
Candles where **NEITHER** the high NOR low breaks the previous candle's range. These represent consolidation and often precede significant price moves.
- Marked with **orange triangle arrows** by default
### Mother Bars
Bars where **both** the previous and next bars are inside bars relative to the mother bar. These are significant consolidation zones that often lead to strong breakouts.
- Marked with **blue diamond** by default
## Features
- Visual markers above bars for easy identification
- Statistics table showing:
- Count of each bar type
- Percentage of total bars
- Probability column (based on even distribution analysis)
- Fully customizable colors and toggles
- Configurable calculation period
## Customization Options
| Setting | Description | Default |
|---------|-------------|---------|
| Show Outer Bars | Toggle outer bar markers | On |
| Show Inner Bars | Toggle inner bar markers | On |
| Show Mother Bars | Toggle mother bar markers | On |
| Breaks Both Color | Color for outside bars | Red |
| Breaks Neither Color | Color for inside bars | Orange |
| Mother Bar Color | Color for mother bars | Blue |
| Show Statistics Table | Toggle the info table | On |
| Calculation Bars | Number of bars to analyze (0 = All, max 5000) | 1000 |
| Show Probability Column | Toggle probability display | On |
## Probability Calculation
The probability column estimates the likelihood of each bar type occurring based on even distribution analysis:
- Calculates expected interval based on historical percentage
- Looks back within that expected range
- **Higher probability** when pattern is "overdue" (no occurrences in expected range)
- **Base probability** when one occurrence found in range
- **Lower probability** when multiple occurrences found (pattern is "clustered")
## How to Use
1. **Inside Bars**: Look for breakout opportunities after consolidation periods
2. **Outside Bars**: Identify volatility expansion and potential momentum shifts
3. **Mother Bars**: Watch for strong breakouts after double-inside consolidation patterns
Use these patterns in conjunction with your trading strategy to identify entry/exit points or confirm trend direction.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。