OPEN-SOURCE SCRIPT

Chained Inside Bars

已更新
This script identifies consecutive inside bars by referencing only the most recent non-inside bar, so it avoids excessive lookback. An “inside” bar means its high is lower than the reference bar’s high, and its low is higher than the reference bar’s low. If the current bar is inside, it’s colored white; once price breaks outside, the script updates that new bar as the next reference.

Key Points
• Bars are compared against the last non-inside bar, chaining consecutive inside bars off that same reference bar.
• Inside bars are highlighted in white (non-inside bars retain default chart colors).
• Includes an alert condition for when a new inside bar forms.
• Prevents large dynamic indexing, making it more stable and efficient.

Use this indicator to quickly spot consecutive inside-bar formations without needing to track every single bar-to-bar relationship.
版本注释
This script identifies consecutive inside bars by referencing only the most recent non-inside bar, so it avoids excessive lookback. An “inside” bar means its high is lower than the reference bar’s high, and its low is higher than the reference bar’s low. If the current bar is inside, it’s colored white; once price breaks outside, the script updates that new bar as the next reference.

Key Points
• Bars are compared against the last non-inside bar, chaining consecutive inside bars off that same reference bar.
• Inside bars are highlighted in white (non-inside bars retain default chart colors).
• Includes an alert condition for when a new inside bar forms.
• Prevents large dynamic indexing, making it more stable and efficient.

Use this indicator to quickly spot consecutive inside-bar formations without needing to track every single bar-to-bar relationship.

=== Update 2025/01/20 ===
This “Chained Inside Bars” indicator prevents abnormally large (outlier) bars from becoming the reference bar and trapping all future bars inside their range. It uses a user-configurable average range length and range multiplier to identify when a bar is “too big.” Such huge bars are automatically skipped, so the script can properly detect normal inside-bar formations.
BARBARSCandlestick analysisHigh-Low IndexsmartmoneyTrend Analysis

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明