Thesis
Buy a fresh push above the 20-bar mean and trail the winner until it folds.
Fits Breakout setups — works best when the underlying market behavior matches the thesis, and breaks down when it doesn't. Pair with the backtester's walk-forward mode before committing real capital.
Trendy growth in directional regimes punctuated by ugly chop when price oscillates around the SMA. Best paired with a higher-timeframe trend filter to skip the chop.
YAML rule-set
Paste this into the Strategy Designer's Text tab, or use the dashboard button above to load it as a template.
name: donchian_breakout
weight: 1.0
long_only: true
indicators:
sma20: {kind: sma, period: 20}
entry:
combine: AND
rules:
- {lhs: {bar: close}, op: crosses_up, rhs: {indicator: sma20}}
exit:
combine: OR
rules:
- {lhs: {bar: close}, op: crosses_down, rhs: {indicator: sma20}}
risk:
trailing_stop_pct: 0.05
cooldown_bars: 4
Indicators
sma20SMA (period 20)Simple moving average over the last 20 closes — the cleanest possible trend baseline.
Entry conditions
The bot opens a position the bar after every condition below has fired.
- Enter long when close crosses above the 20-bar SMA.
- 4-bar cooldown after exit reduces back-to-back whipsaws.
Exit conditions
Any of the conditions below will close the position.
- Close on a cross back below the SMA.
- Trailing 5% stop catches deeper retracements before the SMA flips.
Expected behavior
Trendy growth in directional regimes punctuated by ugly chop when price oscillates around the SMA. Best paired with a higher-timeframe trend filter to skip the chop.
Equity-curve character, not a return forecast. Backtests are not promises about live performance.
Try it on your own data
Open the template in the dashboard to backtest it on BTC, ETH, or any CCXT symbol — or copy the YAML into the Strategy Designer to edit it first.
Past behavior on backtests is not a guarantee of future performance. Markets change; rule sets need re-validation. Trade at your own risk.