Donchian Breakout & Retest Signals [bitpunk]

Donchian Breakout & Retest Signals [bitpunk]
This indicator separates two ways to read a channel break: the first close outside the channel, and a later held retest. Use LB/SB to read a fresh long/short breakout, or LR/SR to wait for price to return and confirm again.
Two entry sequences 🧭
Long R watches the upper edge from above; short R mirrors it at the lower edge. A close beyond the pocket's adverse boundary cancels the watch; wick penetration alone does not. Same-side breakouts do not restart an active retest watch, while an opposite B replaces it.
Read the chart 📊
White ▲ LB / ▼ SB identify long/short breakouts; ▲ LR / ▼ SR identify long/short retest confirmations. The letters identify direction and timing, not signal quality. Signal Type defaults to Both; choose Breakout or Retest to select markers and alerts. If an accepted breakout and retest coincide in the same direction, Both reports R once.
By default, each direction receives one breakout and one independent retest signal until a completed close returns to the rolling channel midpoint. A breakout does not consume the later retest signal. This can suppress useful continuation entries; turn Structure Signal Reset off for the previous event stream.
Quiet lines show the rolling channel. The stronger fixed edge and shaded pocket show the retest watch; a dotted line is its confirmation gate. The panel reports the watch stage and remaining closes.
Useful settings ⚙️
Alerts and limits 🔔
Choose Any alert() function call, whose messages identify BREAKOUT / RETEST, or Long Channel Signal / Short Channel Signal. Signal Type applies to both routes. Enable Signals off hides entries and mutes alerts; Structure, panel and Normal / Enhanced remain display choices. Recreate alerts after changes.
Use standard time-based candles. All events wait for close. Breakouts can whipsaw; strict retests miss moves that never return. This independent MPL-2.0 implementation combines a prior-only Donchian breakout with a separate, time-limited held-test confirmation.
This indicator separates two ways to read a channel break: the first close outside the channel, and a later held retest. Use LB/SB to read a fresh long/short breakout, or LR/SR to wait for price to return and confirm again.
Two entry sequences 🧭
- B — Breakout. The channel uses the highest high and lowest low of the preceding 20 candles. A strict close outside it identifies a breakout. Wicks and equality do not count.
- R — Retest. A breakout freezes the broken edge and starts a watch. A later candle must touch its tolerance pocket and hold its adverse boundary on close. A still later candle must close beyond both the test candle's selected gate and the original edge. This is at least a three-candle sequence.
Long R watches the upper edge from above; short R mirrors it at the lower edge. A close beyond the pocket's adverse boundary cancels the watch; wick penetration alone does not. Same-side breakouts do not restart an active retest watch, while an opposite B replaces it.
Read the chart 📊
White ▲ LB / ▼ SB identify long/short breakouts; ▲ LR / ▼ SR identify long/short retest confirmations. The letters identify direction and timing, not signal quality. Signal Type defaults to Both; choose Breakout or Retest to select markers and alerts. If an accepted breakout and retest coincide in the same direction, Both reports R once.
By default, each direction receives one breakout and one independent retest signal until a completed close returns to the rolling channel midpoint. A breakout does not consume the later retest signal. This can suppress useful continuation entries; turn Structure Signal Reset off for the previous event stream.
Quiet lines show the rolling channel. The stronger fixed edge and shaded pocket show the retest watch; a dotted line is its confirmation gate. The panel reports the watch stage and remaining closes.
Useful settings ⚙️
- Retest Window — 10; Confirmation Window — 5. The first counts following candles after B to find a test. The second counts following candles after that test. Later contacts do not renew either clock.
- Retest Pocket (TR) — 0.25. Half-width around the edge, using mean true range captured before the breakout. Zero requires exact edge contact.
- Body Retest Gate — on. Uses the held test's body high/low instead of its wick extreme. Earlier confirmation can be weaker; turn it off for the wick rule.
- Max Retest Extension (TR) — 0. Zero disables the R distance cap. A positive value can skip wide tests and overextended R confirmations. B is never distance-capped; a skipped confirmation is not delayed into another R.
Alerts and limits 🔔
Choose Any alert() function call, whose messages identify BREAKOUT / RETEST, or Long Channel Signal / Short Channel Signal. Signal Type applies to both routes. Enable Signals off hides entries and mutes alerts; Structure, panel and Normal / Enhanced remain display choices. Recreate alerts after changes.
Use standard time-based candles. All events wait for close. Breakouts can whipsaw; strict retests miss moves that never return. This independent MPL-2.0 implementation combines a prior-only Donchian breakout with a separate, time-limited held-test confirmation.
Open research and indicators on stocks and crypto. Explore the work at bitpunk.io
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Open research and indicators on stocks and crypto. Explore the work at bitpunk.io
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.