OPEN-SOURCE SCRIPT

Inside Bars / Nested Bars (+ Gaps) [jenaparadies]

177
📌Features
  • Highlight inside bars
  • Highlight bars that remain within the range of a mother bar (called nested bars)
  • Highlight the mother bar (optional)
  • Highlight consecutive nested bars using a visual box (optional)
  • Enable no-gap candle logic (optional, see below)
  • Show no-gap candles on the chart (optional)
  • Fully customizable colors and appearance


📌Method
An inside bar is any candle whose high is lower than or equal to the previous candle's high, and whose low is higher than or equal to the previous candle's low. In other words, the entire price action of the inside bar remains within the range of the previous candle without exceeding it. The preceding candle is referred to as the mother bar.

Occasionally, the candle following the inside bar may break above or below the inside bar's range, while still remaining fully within the high and low of the mother bar. These candles are referred to as nested bars and are highlighted in a different color.
Optionally, sequences of consecutive nested bars can be enclosed within a box to emphasize consolidation zones.
ekran görüntüsü

📌No-Gap Candles (Optional)
This feature adjusts each candle’s opening price so that it matches the closing price of the previous candle. It is particularly useful for assets that frequently experience large gaps between candles.

By extending each candle's effective range to include the previous candle's close, the indicator maintains structural consistency over timeframes, especially when the open price deviates significantly from the prior close. Inside bars are then identified relative to the extended range of the mother bar.

Optionally, the adjusted no-gap candles can be visualized directly on the chart for better clarity.
ekran görüntüsü

🎁Bonus
Activating the "Show No-Gap Candles" option transforms any line chart into a gap-free bar chart ‒ ideal for visualizing economic data such as inflation rates.
ekran görüntüsü

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.