Breakout Trading Algorithm Development
Breakout strategy: price consolidates in defined range for long time, then breaks boundary — signal to enter in direction of breakout. Logic: energy accumulated during consolidation expresses itself in strong directional move after breakout.
Types of Breakouts
Price level breakout: breakout of historical high/low, psychological levels (round numbers), Fibonacci levels.
Volatility breakout (Bollinger Band Squeeze): when Bollinger Bands narrow (low volatility), explosive move expected. Trade in direction of first exit from bands.
Range breakout (Donchian): N-period high or low breakout. Simple and effective approach.
Pattern breakout: triangle, wedge, flag level breakout. Described in pattern recognition system.
False Breakout Filtering
Main problem of breakout trading — false breakouts. Price briefly exits level and returns. Filtering methods:
Close confirmation: signal only on candle close beyond level (not intrabar breakout).
ATR filter: minimum breakout distance = 0.5 × ATR. Small breakout — likely false.
Volume confirmation: volume on breakout must be > 1.5× average. Breakout without volume = weak signal.
Time filter: breakout during active trading session (for crypto — Asia/Europe or Europe/USA overlap) more reliable.
Retest confirmation: wait for pullback to broken level (retest), bounce confirmation → more reliable entry. Less aggressive but fewer false positives.
Entry, Stop, and Target
Entry: immediately on close of confirmable candle beyond level, or on retest of level.
Stop-loss: beyond opposite boundary + ATR buffer. For example, breakout above $50,000, stop below $49,500 (level) − $200 (buffer).
Target projection:
- Range height projection: if consolidation was $500, add $500 to breakout point
- Fibonacci extension: 127.2% or 161.8% of range
- Next key level: nearest significant support/resistance above
Volatility-based Position Sizing
def breakout_position_size(capital, entry, stop, risk_pct=0.01):
risk_per_unit = abs(entry - stop)
risk_amount = capital * risk_pct
qty = risk_amount / risk_per_unit
return qty
Stack: Python + pandas + ta-lib, CCXT for exchange API, PostgreSQL for level and signal storage. Scan on each candle close, Telegram alerts on breakout trigger.







