Trading Dev AcademyFree quant education

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.
Ut=max1≤j≤n⁡Ht−j,Bt=𝟏{Ct>Ut+kATRt−1}
Specified chart rule · derivation and arithmetic

Breakout detection, false breaks and retests

  1. Take the maximum of the prior highs only. For [100,102,101], U=102.
  2. Compute the buffer: k=.5 and prior ATR=2 add 1 price unit.
  3. The boundary is 103. Close=103.2 passes a strict greater-than rule; close=103 does not.
Work it by hand

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.

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
  1. Support, resistance and reversal: start with a price zone
  2. Breakout detection, false breaks and retests
  3. Fibonacci retracements: anchors before ratios
  4. Harmonic patterns: ratio constraints and competing candidates
  5. Elliott Wave: count hypotheses, rules and invalidation
  6. Fair value gaps (FVG): three-bar geometry and fill measurement
  7. Heikin-Ashi: smoothed candles are synthetic prices
  8. Renko: price-driven bricks and the missing time axis
  9. Dynamic support, trend lines and Gann angles
  10. Momentum indicators, oscillators and divergence
  11. Volume, supply/demand zones and what OHLCV cannot reveal
  12. Market structure, BOS and CHOCH as a state machine
  13. Moon phases: encode a calendar hypothesis and try to falsify it

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations