OPEN-SOURCE SCRIPT
Consolidation Ranges [ITA]

🟠 OVERVIEW
Consolidation Ranges finds the places where price stopped trending and went sideways, draws the range while it forms, marks the bar that closes outside it, and then keeps watching to see whether that breakout actually held.
Finding a sideways range is the easy half. Every tool in this category draws the box and marks the breakout, and then stops, which is where the trader's real problem starts. The most common complaint about trading ranges is that the breakout fails and price comes straight back in, and almost nothing measures how often that happens.
So this one waits. After a breakout it gives price a set number of bars to stay outside. Close back inside within that window and the breakout is marked Failed. Stay out and it is marked Held. The running count of both sits in the corner.
🟠 CONCEPTS
* Consolidation - A stretch of bars whose full high to low span stays inside a chosen multiple of ATR. Measuring the range in ATR rather than in points means the same setting behaves the same way on a quiet symbol and a volatile one.
* Range Widening - While price stays inside, the box grows to contain each new bar, but only while the result is still narrow enough to count as a range. Without that limit a slow drift never breaks out, it just drags the box along with it.
* Breakout - The first close outside the box. The close matters rather than the wick, because a wick outside a range is the thing that most often reverses.
* Confirmation Window - The number of bars a breakout is given to prove itself.
* Held and Failed - What actually happened. Held means price stayed outside for the whole window. Failed means it closed back inside the range it had just left.
🟠 FEATURES
🔹 Range width measured in ATR, so one setting works across symbols and timeframes rather than needing to be retuned for each
🔹 The box builds live as the range develops and locks on the bar that breaks it
🔹 Breakouts marked in both directions at the price where the close happened
🔹 Every breakout followed to an outcome and labelled Held or Failed
🔹 A running count of held against failed breakouts, with the rate, for the symbol and timeframe on screen
🔹 Separate alerts for a break up, a break down, a failed breakout and a held breakout
🔹 If the settings are strict enough that nothing is found, the chart says so and names the two inputs to change, rather than leaving you looking at an empty chart unable to tell a quiet symbol from a bad setting
🟠 HOW TO USE
Set Range Length first. It decides how significant a consolidation has to be before it is drawn at all. Twenty bars is a reasonable starting point on any timeframe. Raise it for fewer and larger ranges.
Max Width is the second control. If nothing is being found on a volatile symbol, raise it. If the whole chart is boxes, lower it.
Then read the count in the corner before anything else. It is telling you whether breakouts on this symbol and timeframe have been worth taking. A symbol where most breakouts failed is not a symbol to trade breakouts on, and that is worth knowing before the next one rather than after it.
Bars To Confirm decides how patient the measurement is. A short window counts quick reversals as failures. A longer one only counts a breakout as failed if price genuinely came back.
🟠 CONCLUSION
Drawing the range is the part every tool does. The part that decides whether the range was worth trading is what happened after the break, and that is what this one records.
Consolidation Ranges finds the places where price stopped trending and went sideways, draws the range while it forms, marks the bar that closes outside it, and then keeps watching to see whether that breakout actually held.
Finding a sideways range is the easy half. Every tool in this category draws the box and marks the breakout, and then stops, which is where the trader's real problem starts. The most common complaint about trading ranges is that the breakout fails and price comes straight back in, and almost nothing measures how often that happens.
So this one waits. After a breakout it gives price a set number of bars to stay outside. Close back inside within that window and the breakout is marked Failed. Stay out and it is marked Held. The running count of both sits in the corner.
🟠 CONCEPTS
* Consolidation - A stretch of bars whose full high to low span stays inside a chosen multiple of ATR. Measuring the range in ATR rather than in points means the same setting behaves the same way on a quiet symbol and a volatile one.
* Range Widening - While price stays inside, the box grows to contain each new bar, but only while the result is still narrow enough to count as a range. Without that limit a slow drift never breaks out, it just drags the box along with it.
* Breakout - The first close outside the box. The close matters rather than the wick, because a wick outside a range is the thing that most often reverses.
* Confirmation Window - The number of bars a breakout is given to prove itself.
* Held and Failed - What actually happened. Held means price stayed outside for the whole window. Failed means it closed back inside the range it had just left.
🟠 FEATURES
🔹 Range width measured in ATR, so one setting works across symbols and timeframes rather than needing to be retuned for each
🔹 The box builds live as the range develops and locks on the bar that breaks it
🔹 Breakouts marked in both directions at the price where the close happened
🔹 Every breakout followed to an outcome and labelled Held or Failed
🔹 A running count of held against failed breakouts, with the rate, for the symbol and timeframe on screen
🔹 Separate alerts for a break up, a break down, a failed breakout and a held breakout
🔹 If the settings are strict enough that nothing is found, the chart says so and names the two inputs to change, rather than leaving you looking at an empty chart unable to tell a quiet symbol from a bad setting
🟠 HOW TO USE
Set Range Length first. It decides how significant a consolidation has to be before it is drawn at all. Twenty bars is a reasonable starting point on any timeframe. Raise it for fewer and larger ranges.
Max Width is the second control. If nothing is being found on a volatile symbol, raise it. If the whole chart is boxes, lower it.
Then read the count in the corner before anything else. It is telling you whether breakouts on this symbol and timeframe have been worth taking. A symbol where most breakouts failed is not a symbol to trade breakouts on, and that is worth knowing before the next one rather than after it.
Bars To Confirm decides how patient the measurement is. A short window counts quick reversals as failures. A longer one only counts a breakout as failed if price genuinely came back.
🟠 CONCLUSION
Drawing the range is the part every tool does. The part that decides whether the range was worth trading is what happened after the break, and that is what this one records.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Pine Script developer & trader. I build clean indicators - Smart Money Concepts, scanners, risk tools. ITAtradingtools.com
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Pine Script developer & trader. I build clean indicators - Smart Money Concepts, scanners, risk tools. ITAtradingtools.com
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.