OPEN-SOURCE SCRIPT
Zaktualizowano 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.
Informacje o Wersji
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)
Informacje o Wersji
v3 Release NotesFixes:
1. Reduced default opacity
Informacje o Wersji
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
Informacje o Wersji
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
Informacje o Wersji
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)
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Technical analysis should be made as simple as possible, but no simpler. --Albert Einstein
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Technical analysis should be made as simple as possible, but no simpler. --Albert Einstein
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.