Free lesson · Technical analysis
Breakout detection, false breaks and retests
Open interactive lessonPractice calculationsExplore labs
Start with the idea
A breakout compares a new observation with a boundary fixed before that observation. A buffer controls how far beyond the boundary counts.
Symbols, units & horizon
- U_t: highest high of n prior bars in price units
- H_(t−j): high j bars before t
- C_t: completed current close
- n: positive lookback count
- k: nonnegative buffer in ATR multiples
- ATR_(t−1): positive prior ATR
- B_t: binary breakout flag
- 1{ }: one if the condition holds, zero otherwise
When and why to use this
Use breakouts as event labels or as a candidate continuation entry. Test the full exit, sizing and execution policy.
- Use a prior high/low channel as the first reproducible boundary. Exclude the current bar from the lookback.
- Define whether a break means a wick, a trade through the level or a completed close beyond it. These triggers have different information times.
- Normalize a buffer by prior ATR or tick size. A larger buffer reduces signals but delays entry; it does not automatically improve net performance.
- A close back inside the channel can define a failed breakout. Choose its maximum waiting time before examining outcomes.
- A retest requires a later return to a predeclared zone and a specified acceptance/rejection rule. Trade only after the required confirmation.
- Volume, spread, time of day and trend are candidate conditioning variables. Compare them through ablations rather than stacking indicators until the history looks attractive.
- If a stop and target are both touched in one OHLC bar, use finer data or a documented conservative ordering.
Breakout detection, false breaks and retests
- Take the maximum of the prior highs only. For [100,102,101], U=102.
- Compute the buffer: k=.5 and prior ATR=2 add 1 price unit.
- The boundary is 103. Close=103.2 passes a strict greater-than rule; close=103 does not.
Excluding today prevents its high from moving the very boundary that the close must beat. A valid flag is available only after the selected closing observation.
Use the rule
- Fix the definition, units and information timestamp.
- Compute the example and inspect the graph.
- Compare with a simple baseline on untouched periods after costs.
Before moving on
Write the exact rule, its availability time, an invalidation condition and a fair out-of-sample test.
- Research context: review the related evidence checkpoint. The numerical convention here defines a candidate feature; that related research does not validate this exact rule.
Python implementation
Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.
def breakout(prior_highs,close,prior_atr,buffer=.5):
if not prior_highs or prior_atr<=0 or buffer<0: raise ValueError("Prior bars, positive ATR and nonnegative buffer required")
boundary=max(prior_highs)+buffer*prior_atr
return boundary,close>boundary
print(breakout([100,102,101],103.2,2))Continue learning
Technical Analysis: Geometry, Structure & Evidence — all lessons- Support, resistance and reversal: start with a price zone
- Breakout detection, false breaks and retests
- Fibonacci retracements: anchors before ratios
- Harmonic patterns: ratio constraints and competing candidates
- Elliott Wave: count hypotheses, rules and invalidation
- Fair value gaps (FVG): three-bar geometry and fill measurement
- Heikin-Ashi: smoothed candles are synthetic prices
- Renko: price-driven bricks and the missing time axis
- Dynamic support, trend lines and Gann angles
- Momentum indicators, oscillators and divergence
- Volume, supply/demand zones and what OHLCV cannot reveal
- Market structure, BOS and CHOCH as a state machine
- Moon phases: encode a calendar hypothesis and try to falsify it
Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations