OPEN-SOURCE SCRIPT
Telah dikemas kini Inside/Outside Bar Sequence Detector

# Inside/Outside Bar Sequence Detector
## English Description
**Inside/Outside Bar Sequence Detector**
This indicator identifies and visualizes sequences of Inside and Outside bars on any chart. It highlights important price action patterns that can signal potential market reversals or continuation moves.
**Key Features:**
- Automatically detects consecutive Inside bars (where price action is contained within the previous bar's range) and Outside bars (where price action exceeds the previous bar's range)
- Displays sequences with customizable labels showing the pattern type
- Highlights the price range of each sequence with a transparent box
- Marks individual Inside bars with "i" and Outside bars with "o" below each candle
- Applies special pattern recognition rules for more accurate trade signals
- Fully customizable appearance including colors, opacity, and label positioning
Adjust the minimum sequence length according to your trading timeframe and strategy to filter out noise and focus on significant patterns.
## 中文描述
**内包/外包K线序列检测器**
这个指标可以识别并可视化任何图表上的内包和外包K线序列。它突出显示重要的价格行为模式,这些模式可能预示市场潜在的反转或延续走势。
**主要特点:**
- 自动检测连续的内包K线(价格活动被限制在前一根K线范围内)和外包K线(价格活动超出前一根K线范围)
- 通过可自定义的标签显示模式类型
- 用透明框突出显示每个序列的价格范围
- 在每根K线下方用"i"标记内包蜡烛,用"o"标记外包蜡烛
- 应用特殊模式识别规则,提供更准确的交易信号
- 完全可自定义的外观,包括颜色、透明度和标签位置
根据您的交易时间框架和策略调整最小序列长度,以过滤噪音并专注于重要模式。
## English Description
**Inside/Outside Bar Sequence Detector**
This indicator identifies and visualizes sequences of Inside and Outside bars on any chart. It highlights important price action patterns that can signal potential market reversals or continuation moves.
**Key Features:**
- Automatically detects consecutive Inside bars (where price action is contained within the previous bar's range) and Outside bars (where price action exceeds the previous bar's range)
- Displays sequences with customizable labels showing the pattern type
- Highlights the price range of each sequence with a transparent box
- Marks individual Inside bars with "i" and Outside bars with "o" below each candle
- Applies special pattern recognition rules for more accurate trade signals
- Fully customizable appearance including colors, opacity, and label positioning
Adjust the minimum sequence length according to your trading timeframe and strategy to filter out noise and focus on significant patterns.
## 中文描述
**内包/外包K线序列检测器**
这个指标可以识别并可视化任何图表上的内包和外包K线序列。它突出显示重要的价格行为模式,这些模式可能预示市场潜在的反转或延续走势。
**主要特点:**
- 自动检测连续的内包K线(价格活动被限制在前一根K线范围内)和外包K线(价格活动超出前一根K线范围)
- 通过可自定义的标签显示模式类型
- 用透明框突出显示每个序列的价格范围
- 在每根K线下方用"i"标记内包蜡烛,用"o"标记外包蜡烛
- 应用特殊模式识别规则,提供更准确的交易信号
- 完全可自定义的外观,包括颜色、透明度和标签位置
根据您的交易时间框架和策略调整最小序列长度,以过滤噪音并专注于重要模式。
Nota Keluaran
Inside/Outside Bar & Micro Channel DetectorEnglish Description
Overview
The Inside/Outside Bar & Micro Channel Detector is a comprehensive Pine Script indicator designed for TradingView that identifies and visualizes
two powerful price action patterns: Inside/Outside Bar sequences and Micro Channels. This dual-purpose tool helps traders spot consolidation
periods and trending micro-structures in any timeframe.
Key Features
📊 Inside/Outside Bar Detection
- Inside Bars: Identifies candles with high ≤ previous high and low ≥ previous low
- Outside Bars: Identifies candles with high ≥ previous high and low ≤ previous low
- Sequence Detection: Groups consecutive Inside/Outside bars into meaningful sequences
- Smart Filtering: Applies intelligent rules to filter out noise and highlight significant patterns
- Visual Markers: Displays sequence labels and background highlighting
📈 Micro Channel Detection
- Bullish Micro Channels: Detects sequences where lows progressively rise or remain equal
- Bearish Micro Channels: Detects sequences where highs progressively fall or remain equal
- Dynamic Trend Lines: Draws trend lines connecting channel boundaries
- Real-time Updates: Updates trend lines as channels extend or terminate
- Historical Persistence: Preserves completed channel trend lines for reference
Settings & Customization
Inside/Outside Bar Settings
- Minimum Sequence Length (2-10): Set the minimum bars required for a valid sequence
- Marker Color & Opacity: Customize the appearance of individual bar markers
- Label Settings: Control text color, size, and position of sequence labels
- Background Box: Configure color and opacity of sequence highlighting
Micro Channel Settings
- Enable/Disable: Toggle Micro Channel detection on/off
- MC Minimum Length (3-20): Set minimum bars required for a valid channel
- Trend Line Width (1-5): Adjust thickness of channel trend lines
- Trend Line Opacity (0-100%): Control transparency of all trend lines
- Color Settings: Separate colors for bullish and bearish channels
How to Use
1. Add to Chart: Apply the indicator to any chart and timeframe
2. Configure Settings: Adjust parameters in the "Inputs" tab to match your trading style
3. Interpret Signals:
- Inside/Outside bar sequences often indicate consolidation before breakouts
- Micro Channels show short-term trending behavior and potential reversal points
4. Combine with Other Analysis: Use alongside support/resistance, volume, and other indicators for comprehensive analysis
Best Practices
- Use on multiple timeframes for confluence
- Combine with volume analysis for better signal quality
- Pay attention to sequence breaks as potential reversal signals
- Adjust opacity settings based on chart background for optimal visibility
Technical Specifications
- Pine Script Version: v6
- Overlay: True (draws on price chart)
- Max Objects: 500 labels, 500 boxes, 500 lines
- Author: WendellZhang
- License: Mozilla Public License 2.0
---
中文说明
概述
Inside/Outside Bar & Micro Channel Detector(内包外包K线与微通道检测器)是一个为TradingView设计的综合性Pine
Script指标,能够识别和可视化两种强大的价格行为模式:内包/外包K线序列和微通道。这个双功能工具帮助交易者在任何时间框架内发现盘整期和趋势微结构。
核心功能
📊 内包/外包K线检测
- 内包K线:识别最高价 ≤ 前一根最高价且最低价 ≥ 前一根最低价的K线
- 外包K线:识别最高价 ≥ 前一根最高价且最低价 ≤ 前一根最低价的K线
- 序列检测:将连续的内包/外包K线组合成有意义的序列
- 智能过滤:应用智能规则过滤噪音,突出重要模式
- 视觉标记:显示序列标签和背景高亮
📈 微通道检测
- 多头微通道:检测低点逐步抬高或保持相等的序列
- 空头微通道:检测高点逐步降低或保持相等的序列
- 动态趋势线:绘制连接通道边界的趋势线
- 实时更新:随着通道延伸或终止更新趋势线
- 历史保持:保留已完成的通道趋势线供参考
设置与定制
内包/外包K线设置
- 最小序列长度 (2-10):设置有效序列所需的最少K线数量
- 标记颜色与透明度:自定义单个K线标记的外观
- 标签设置:控制序列标签的文字颜色、大小和位置
- 背景框:配置序列高亮的颜色和透明度
微通道设置
- 启用/禁用:开启或关闭微通道检测
- MC最小长度 (3-20):设置有效通道所需的最少K线数量
- 趋势线宽度 (1-5):调整通道趋势线的粗细
- 趋势线透明度 (0-100%):控制所有趋势线的透明度
- 颜色设置:为多头和空头通道设置不同颜色
使用方法
1. 添加到图表:将指标应用到任何图表和时间框架
2. 配置设置:在"输入"选项卡中调整参数以匹配您的交易风格
3. 解读信号:
- 内包/外包K线序列通常表示突破前的盘整
- 微通道显示短期趋势行为和潜在反转点
4. 结合其他分析:与支撑/阻力、成交量和其他指标结合使用,进行综合分析
最佳实践
- 在多个时间框架上使用以获得共振
- 结合成交量分析以获得更好的信号质量
- 关注序列破坏作为潜在反转信号
- 根据图表背景调整透明度设置以获得最佳可见性
技术规格
- Pine Script版本:v6
- 覆盖图表:是(在价格图表上绘制)
- 最大对象数:500个标签、500个框、500条线
- 作者:WendellZhang
- 许可证:Mozilla公共许可证2.0
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.