Skip to content
Menu

Donchian breakout on AAPL

Buy when the close crosses above the highest high of 20 days, up to the day before. Sell when the close crosses below the lowest low of 10 days, up to the day before.

Started from the “Donchian breakout” template. A template is a well-known idea to test, not a recommendation.

Buy when

Open a position when

Sell when

Close it when

Assumptions 10,000 to start · 0.05% cost per trade · fills at the next open
This rule
+19.5%
10,000 became 11,948
Buy and hold AAPL
+52.6%
10,000 became 15,262
Worst fall
−17.9%
−2,220 · back in 8 months
Trades
8
6 won · 2 lost · 1 still open · 75% win rate
Profit factor
2.52
gains ÷ losses
In the market
51%
of 500 days
  • Only 8 trades. A handful of trades says little about a rule: a few lucky or unlucky ones decide the result. Thirty or more is a common minimum; a longer period gives more.
  • Buying and holding did better. Over the same dates, simply holding AAPL returned 33 percentage points more than this rule after costs.

Account value

10,000 following this rule, beside the same cash bought and held, Nov 29, 2024 to Nov 27, 2026

8k10k12k14k−20.0%0%Fall from the peakNov 24Apr 25Sep 25Feb 26Jul 26Nov 26

Transactions chart

Buy and cover markers below the bar, sell and short markers above

200.0300.010.0k12.0kAccount valueNov 24Apr 25Sep 25Feb 26Jul 26Nov 26

Trades

8 round trips, oldest first. Each is an entry and its exit, after costs.

Backtest trades
SideEntryExitSharesHeldProfitReturnWorst / best
LongJul 2, 2025 · 208.91 the close crosses above the highest high of 20 days, up to the day beforeAug 1, 2025 · 210.87 the close crosses below the lowest low of 10 days, up to the day before47.8421 days+83.73+0.84%−0.8% / +3.5%
LongAug 8, 2025 · 220.83 the close crosses above the highest high of 20 days, up to the day beforeOct 13, 2025 · 249.38 the close crosses below the lowest low of 10 days, up to the day before45.6445 days+1,292.29+12.82%−0.7% / +17.4%
LongOct 21, 2025 · 261.88 the close crosses above the highest high of 20 days, up to the day beforeJan 7, 2026 · 263.20 the close crosses below the lowest low of 10 days, up to the day before43.4253 days+45.91+0.40%−2.5% / +10.2%
LongFeb 5, 2026 · 278.13 the close crosses above the highest high of 20 days, up to the day beforeMar 16, 2026 · 252.11 the close crosses below the lowest low of 10 days, up to the day before41.0526 days−1,078.91−9.45%−10.3% / +1.0%
LongApr 16, 2026 · 266.80 the close crosses above the highest high of 20 days, up to the day beforeJun 9, 2026 · 300.28 the close crosses below the lowest low of 10 days, up to the day before38.7537 days+1,286.28+12.44%−2.1% / +19.0%
LongJul 10, 2026 · 314.72 the close crosses above the highest high of 20 days, up to the day beforeAug 3, 2026 · 309.58 the close crosses below the lowest low of 10 days, up to the day before36.9316 days−201.36−1.73%−4.7% / +9.5%
LongSep 2, 2026 · 326.87 the close crosses above the highest high of 20 days, up to the day beforeNov 4, 2026 · 341.57 the close crosses below the lowest low of 10 days, up to the day before34.9444 days+502.00+4.39%−5.2% / +7.6%
LongNov 12, 2026 · 357.81 the close crosses above the highest high of 20 days, up to the day beforeNov 27, 2026 · 358.54 Still open33.3210 days+18.37+0.15%−4.8% / +0.8%

Return and risk

This rule beside buying and holding over the same dates

MeasureThis ruleBuy and hold
Total return+19.5%+52.6%
Return per year+9.3%+23.6%
Volatility per year16.1%29.0%
Worst fall from a peak−17.9%−33.4%
Longest time below a peak237 days298 days
Sharpe ratio0.630.87
Sortino ratio0.921.31
Return per year ÷ worst fall0.520.71

Trade statistics

Round trips for the long side, the short side and both together

Backtest results by side
StatisticLongShortTotal
Trades808
Won606
Lost202
Win rate75%—75%
Net profit+1,948.32—+1,948.32
Profit factor2.52—2.52
Average trade+243.54—+243.54
Average trade return+2.48%—+2.48%
Average win538.10—538.10
Average loss640.14—640.14
Average win ÷ average loss0.84—0.84
Largest win1,292.29—1,292.29
Largest loss1,078.91—1,078.91
Most losses in a row101
Average days held31.5—31.5

Does it hold up on the last part?

The last 30% of the period, from Apr 27, 2026, is shaded on the chart and counted apart. A rule that only worked earlier was probably fitted to the past.

PartThis ruleBuy and holdTrades
First 70%+5.0%+15.4%5
Last 30%+13.8%+32.3%3

Monthly returns

This rule, month by month. The last column is buying and holding for the same year.

YearJanFebMarAprMayJunJulAugSepOctNovDecYearHold
2026-3.2-5.1-4.61.715.0-3.8-1.90.21.83.5-0.8+1.2%+31.9%
20250.00.00.00.00.00.0-0.76.79.71.03.1-2.5+18.0%+8.6%
20240.00.00.0%+6.6%

How the trades turned out

The number of trades in each band of return, after costs

  • under −20% 0
  • −20% to −10% 0
  • −10% to −5% 1
  • −5% to −2% 0
  • −2% to 0% 1
  • 0% to +2% 3
  • +2% to +5% 1
  • +5% to +10% 0
  • +10% to +20% 2
  • over +20% 0

What this result assumes

  • Account. Starts with 10,000 in cash, 100% of the account on each entry, one position at a time. Fractional shares are allowed.
  • Fills. A signal is read at a bar’s close and fills at the next bar’s open.
  • Costs. 0.05% of the amount traded on every buy and every sell, for commission and slippage. This run paid 83.21 in all.
  • Exits. The exit condition closes the position. A position still open at the end is valued at the last close.
  • Signals. 47 in this period. Studies are calculated on the bars before the period as well, so they are warmed up when it starts.
  • Prices. 500 daily bars, adjusted for splits. Dividends are not included, for this rule or for buying and holding.
  • Buy and hold. The same cash put into AAPL at the first bar’s open, one cost, never sold.

These results are hypothetical. They come from applying a rule to past prices under the assumptions above, with the benefit of hindsight, and are not a record of real trading. Real orders can fill at other prices or not at all. Past results do not predict future results, and nothing here is investment advice. The Stock Master app calculates backtests differently, so its numbers will not match these.