Rule backtest — every trade, the equity curve and the drawdown
A trading rule is replayed bar by bar over the price path, and the full record is published: every trade, the equity curve, the win rate, average R (the reward-to-risk of a typical trade), profit factor and maximum drawdown — with a note on what each number means. The rule shown is a 20-day moving-average crossover (long when price closes above its 20-day average, exit when it closes below, with an 8% stop). Fills happen at the bar close, so there is no look-ahead, replayed on daily history covering 2021-09-13 → 2026-09-11 (1249 daily bars). Results are gross of costs — no commission, spread or slippage is deducted.
Measured over 2021-09-13 → 2026-09-11 (1249 daily bars) · one symbol, one rule, 52 trades. A dash means this sample could not measure that number — it is not a zero.
- Period
- 2021-09-13 – 2026-09-11
- Out-of-sample from
- none — whole period in sample
- Trades
- 52
- Costs charged
- 0 bps per side 0 bps commission + 0 bps slippage, charged on every position change
Hypothetical, backtested results — not the record of a traded account. Past results do not predict future returns; the strategy set was chosen with knowledge of the history it is measured on, and no financing, borrow, tax or capacity constraints are modelled. One name’s result does not generalise. There is no out-of-sample split: every bar behind these figures was already available when the rule was chosen.
Equity curve — the rule's running NAV
| Sharpe | 0.98 | Sortino | 1.45 |
| Calmar | 0.79 | Annualized (extrapolated from 1249 bars) | +17.94% |
| Avg win | +7.34% | Avg loss | -2.36% |
Fills execute at the bar CLOSE on the signal bar — no look-ahead. Profit factor = gross gains ÷ gross losses; avg R = average win ÷ average loss; max drawdown = the deepest peak-to-trough fall in this curve. A dash is a number this sample could not measure (no losing trade → no profit factor; no drawdown → no Calmar) — never a zero and never an infinity.
The rule under test
Backtest glossary
- Backtest
- Replaying a fixed set of trading rules over historical prices to estimate how they would have performed.
- Sharpe ratio
- Annualised return divided by the volatility of returns — reward per unit of total risk.
- Sortino ratio
- Like Sharpe but only counts downside volatility in the denominator.
- Calmar ratio
- Annualised return divided by the maximum drawdown — reward per unit of worst-case pain.
- Max drawdown
- The largest drop from a peak in the equity curve to a subsequent trough.
- Profit factor
- Gross profit divided by gross loss; above 1 means the strategy is net profitable.
- Exposure
- The fraction of bars the strategy was actually in a position (capital at work).
- Stress test
- Re-running the strategy on a deliberately worse price path to see if it survives bad conditions.
- Sim-to-live promotion
- The gate that decides whether a paper-traded rule-set is trustworthy enough to run with real consequences.
Trade ledger — all 52 fills
| 1 | 23 @ 143.76 | 42 @ 147.92 | 19 bars | +2.89% | rule |
| 2 | 44 @ 149.99 | 80 @ 174.92 | 36 bars | +16.62% | rule |
| 3 | 96 @ 170.33 | 106 @ 168.64 | 10 bars | -0.99% | rule |
| 4 | 107 @ 168.88 | 110 @ 168.88 | 3 bars | +0.00% | rule |
| 5 | 130 @ 163.98 | 146 @ 165.75 | 16 bars | +1.08% | rule |
| 6 | 162 @ 166.02 | 163 @ 156.77 | 1 bars | -5.57% | rule |
| 7 | 179 @ 149.64 | 183 @ 145.38 | 4 bars | -2.85% | rule |
| 8 | 184 @ 146.14 | 187 @ 142.64 | 3 bars | -2.39% | rule |
| 9 | 197 @ 141.66 | 199 @ 137.44 | 2 bars | -2.98% | rule |
| 10 | 202 @ 138.93 | 241 @ 163.62 | 39 bars | +17.77% | rule |
| 11 | 280 @ 147.27 | 288 @ 145.03 | 8 bars | -1.52% | rule |
| 12 | 294 @ 146.87 | 305 @ 144.22 | 11 bars | -1.80% | rule |
| 13 | 307 @ 148.03 | 311 @ 142.91 | 4 bars | -3.46% | rule |
| 14 | 335 @ 133.49 | 362 @ 148.48 | 27 bars | +11.23% | rule |
| 15 | 370 @ 151.03 | 375 @ 148.50 | 5 bars | -1.68% | rule |
| 16 | 376 @ 150.47 | 397 @ 160.10 | 21 bars | +6.40% | rule |
| 17 | 398 @ 165.56 | 406 @ 163.77 | 8 bars | -1.08% | rule |
| 18 | 408 @ 168.41 | 474 @ 192.58 | 66 bars | +14.35% | rule |
| 19 | 493 @ 184.12 | 499 @ 177.56 | 6 bars | -3.56% | rule |
| 20 | 519 @ 174.91 | 529 @ 175.46 | 10 bars | +0.31% | rule |
| 21 | 539 @ 177.57 | 574 @ 193.60 | 35 bars | +9.03% | rule |
| 22 | 590 @ 188.63 | 599 @ 184.40 | 9 bars | -2.24% | rule |
| 23 | 603 @ 189.30 | 605 @ 188.32 | 2 bars | -0.52% | rule |
| 24 | 632 @ 176.08 | 634 @ 171.37 | 2 bars | -2.67% | rule |
| 25 | 638 @ 173.31 | 639 @ 171.48 | 1 bars | -1.06% | rule |
| 26 | 648 @ 175.04 | 651 @ 169.38 | 3 bars | -3.23% | rule |
| 27 | 658 @ 169.89 | 659 @ 169.30 | 1 bars | -0.35% | rule |
| 28 | 660 @ 173.50 | 662 @ 169.30 | 2 bars | -2.42% | rule |
| 29 | 663 @ 173.03 | 719 @ 218.54 | 56 bars | +26.30% | rule |
| 30 | 733 @ 221.27 | 748 @ 220.85 | 15 bars | -0.19% | rule |
| 31 | 759 @ 228.87 | 771 @ 221.69 | 12 bars | -3.14% | rule |
| 32 | 772 @ 225.77 | 788 @ 230.10 | 16 bars | +1.92% | rule |
| 33 | 801 @ 228.02 | 831 @ 243.85 | 30 bars | +6.94% | rule |
| 34 | 847 @ 238.26 | 851 @ 228.01 | 4 bars | -4.30% | rule |
| 35 | 854 @ 233.22 | 855 @ 227.63 | 1 bars | -2.40% | rule |
| 36 | 857 @ 232.62 | 868 @ 237.30 | 11 bars | +2.01% | rule |
| 37 | 869 @ 241.84 | 870 @ 238.03 | 1 bars | -1.58% | rule |
| 38 | 890 @ 222.13 | 893 @ 204.36 | 3 bars | -8.00% | stop |
| 39 | 906 @ 204.60 | 914 @ 198.89 | 8 bars | -2.79% | rule |
| 40 | 919 @ 210.79 | 925 @ 206.86 | 6 bars | -1.86% | rule |
| 41 | 946 @ 201.00 | 972 @ 211.27 | 26 bars | +5.11% | rule |
| 42 | 978 @ 213.25 | 1002 @ 226.79 | 24 bars | +6.35% | rule |
| 43 | 1004 @ 234.07 | 1024 @ 245.27 | 20 bars | +4.78% | rule |
| 44 | 1030 @ 262.24 | 1050 @ 267.46 | 20 bars | +1.99% | rule |
| 45 | 1054 @ 271.49 | 1069 @ 274.11 | 15 bars | +0.97% | rule |
| 46 | 1099 @ 258.28 | 1109 @ 261.73 | 10 bars | +1.34% | rule |
| 47 | 1111 @ 263.88 | 1113 @ 260.58 | 2 bars | -1.25% | rule |
| 48 | 1115 @ 266.18 | 1119 @ 264.18 | 4 bars | -0.75% | rule |
| 49 | 1142 @ 255.63 | 1188 @ 301.54 | 46 bars | +17.96% | rule |
| 50 | 1205 @ 308.63 | 1219 @ 308.91 | 14 bars | +0.09% | rule |
| 51 | 1232 @ 316.83 | 1233 @ 311.30 | 1 bars | -1.75% | rule |
| 52 | 1237 @ 313.45 | 1248 @ 332.27 | 11 bars | +6.00% | eod |
Exit reasons: rule = the exit predicate fired; stop = the protective stop was hit; target = the take-profit was hit; eod = closed at the last bar. Bar index = position in the price path, not a calendar date.