OPEN-SOURCE SCRIPT
Обновлено Confined Range Candle Finder

This indicator finds candlesticks which are confined within the range of a previous candlestick. This indicates volatility contraction which often leads to volatility expansion, i.e. large price movements.
While every confined range will contain at least 1 inside bar, this indicator differs from the Inside Bar Finder which only finds consecutive inside bars.
This indicator includes options such as:
- The minimum number of candlesticks confined within the range of a previous candlestick to trigger the indicator
- Labels to indicate the number of confined candles
- Signal lines to indicate the high and low of the containing candlestick
Try out this indicator with different options on different timeframes to see if confined ranges increase the probability of identifying the direction of price movements. Breaks or closes outside signal lines can be used to trigger trade signals.
While every confined range will contain at least 1 inside bar, this indicator differs from the Inside Bar Finder which only finds consecutive inside bars.
This indicator includes options such as:
- The minimum number of candlesticks confined within the range of a previous candlestick to trigger the indicator
- Labels to indicate the number of confined candles
- Signal lines to indicate the high and low of the containing candlestick
Try out this indicator with different options on different timeframes to see if confined ranges increase the probability of identifying the direction of price movements. Breaks or closes outside signal lines can be used to trigger trade signals.
Информация о релизе
v2 Release NotesEnhancements:
1. Added a % Tolerance so extremely small violations of the high/low can be ignored
2. Added a background fill color for the confined range
3. "Include Wicks" checkbox replaced by a "Range Boundary" dropdown: Wicks or Candle Bodies
4. Once found, a range is tracked until it breaks, with no length limit and a much faster calculation
5. Upgraded to Pine Script v6
Fixes:
1. Fixed range detection when wicks are excluded (now "Candle Bodies" mode)
2. Each confined range is now drawn once: the box, signal lines and count label extend with the range instead of stacking duplicates
3. Fixed the time calculation for assets that don't trade 24/7, so ranges anchor correctly across weekend/holiday gaps
4. Ranges longer than 50 candles are no longer cut off or re-drawn as overlapping boxes
5. Fixed false ranges on the first bars of chart history
6. Count label text is now readable (white text on the signal line color)
Информация о релизе
v3 Release NotesFixes:
1. Reduced default opacity
Информация о релизе
v4 Release NotesEnhancements:
1. Added a "Containing Candle Direction" filter (Any/Up/Down) to only find ranges whose containing candle closed up (close >= open) or down
Fixes:
1. Count label text now switches between black and white automatically for contrast, so it stays readable with light signal line colors such as white
Информация о релизе
v5 Release NotesEnhancements:
1. Added multi-timeframe support: a new "Timeframe" input finds confined ranges on the chart's timeframe or any higher timeframe
2. Added "Signal Mode": Confirmed (default, non-repainting, ranges appear after the candle closes) or Live (updates with the forming candle and may repaint)
3. Inputs are organized into Range Detection, Display, and Timeframe groups
4. Added a separate "Background" checkbox, so the range fill and lines can be shown independently
Changes:
1. Renamed "Show Signal Lines" to "Lines" and "Confined Range Fill Color" to "Background". Each now has its color on the same row. Any customized settings for these inputs will reset to the defaults
2. On the live bar, ranges now appear when the candle closes (Confirmed mode). Select "Live" to keep the previous behavior
Информация о релизе
v6 Release NotesEnhancements:
1. Added a "Midline" option: a dotted line halfway between the range boundaries, with its own color (off by default)
Changes:
1. Renamed "Lines" to "Boundary Lines". If you customized this setting, it will reset to the default (on)
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Technical analysis should be made as simple as possible, but no simpler. --Albert Einstein
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Technical analysis should be made as simple as possible, but no simpler. --Albert Einstein
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.