Walk-forward study of the built-in strategies¶
Built on 2026-12-05 by trading study docs/research/study.yaml. Every number below comes from that command; nothing is edited by hand. Rebuild it with make research.
Setup¶
- Data: Yahoo Finance bars (
1d, split- and dividend-adjusted) from 2010-01-01 to 2025-01-01, end exclusive. Symbols: SPY, QQQ, IWM, EFA, EEM, TLT, GLD, VNQ (strategies may override them, as noted below). - Walk-forward: rolling windows, 756 bars to train, 252 to test; the sharpe_ratio of each training window picks the parameters.
- Costs: commission $0.005 a share (at least $1 a fill), 1 bp of slippage plus half of a 2 bp spread, and square-root market impact with a coefficient of 1. Short positions pay 0.5 % a year to borrow; cash earns 0 %.
- Account: $100,000, sizing
percentat 12.5 % of equity a position, buying power 1x equity, gross exposure capped at 1.05x. momentum_rotation:strategy.top_k: 3,order_manager.percent_equity: 33.0.pairs:simulation.symbols: [EWA, EWC],order_manager.allow_short: true,order_manager.percent_equity: 50.0,portfolio.margin_multiplier: 2.0.
Out-of-sample results¶
Each strategy's test windows, chained, after costs. The confidence interval is a stationary bootstrap of the out-of-sample returns. Alpha, beta and the information ratio are against an equal-weight buy and hold of the strategy's own symbols.
| Strategy | CAGR | Sharpe | Sharpe 95 % CI | Max drawdown | Alpha | Beta | Information ratio | Fills | WF efficiency |
|---|---|---|---|---|---|---|---|---|---|
buy_and_hold |
+7.49 % | 0.63 | 0.07 to 1.27 | 26.9 % | +0.10 % | 1.00 | 0.20 | 88 | 0.81 |
random |
+0.58 % | 0.12 | -0.40 to 0.69 | 16.8 % | -3.32 % | 0.52 | -1.03 | 9723 | 0.49 |
ma_crossover |
+3.22 % | 0.41 | -0.17 to 1.11 | 25.0 % | -0.86 % | 0.55 | -0.57 | 245 | 0.60 |
rsi |
+4.44 % | 0.45 | -0.13 to 1.10 | 25.8 % | -1.18 % | 0.77 | -0.52 | 1861 | 0.53 |
momentum_rotation |
+5.29 % | 0.49 | -0.03 to 1.07 | 22.6 % | +0.63 % | 0.66 | -0.22 | 253 | 0.57 |
pairs |
+0.85 % | 0.21 | -0.23 to 0.71 | 9.6 % | +0.74 % | 0.03 | -0.27 | 230 | 0.43 |

Findings¶
- Against buy and hold (Sharpe ratio 0.63 out of sample): no other strategy had a higher out-of-sample Sharpe ratio.
- Distinguishable from luck (95 % interval for the Sharpe ratio above zero):
buy_and_hold.
Fitting the whole period instead¶
A single sweep over all the data picks the parameters with the best in-sample sharpe_ratio. The deflated Sharpe ratio is the probability that the winner's true Sharpe ratio is above zero, given how many combinations were tried; compare its in-sample Sharpe ratio with what walking forward delivered.
| Strategy | Combinations | Best parameters | In-sample Sharpe | Deflated Sharpe | Out-of-sample Sharpe |
|---|---|---|---|---|---|
buy_and_hold |
1 | strategy.type=buy_and_hold |
0.74 | > 0.99 | 0.63 |
random |
1 | strategy.type=random |
0.68 | > 0.99 | 0.12 |
ma_crossover |
6 | strategy.fast_period=10, strategy.slow_period=200 |
0.75 | > 0.99 | 0.41 |
rsi |
8 | strategy.period=14, strategy.oversold=30, strategy.overbought=90 |
0.69 | 0.87 | 0.45 |
momentum_rotation |
6 | strategy.lookback=126, strategy.rebalance_every=21 |
0.73 | 0.99 | 0.49 |
pairs |
4 | strategy.lookback=120, strategy.entry_z=2.0 |
0.25 | 0.55 | 0.21 |
Each strategy¶
buy_and_hold¶
Grid: strategy.type ['buy_and_hold'].
fold test window type IS sharpe_ratio OOS sharpe_ratio
------------------------------------------------------------------------------
0 2013-01-04..2014-01-03 buy_and_hold 0.808 0.856
1 2014-01-06..2015-01-05 buy_and_hold 0.676 1.269
2 2015-01-06..2016-01-05 buy_and_hold 1.119 -0.225
3 2016-01-06..2017-01-04 buy_and_hold 0.590 1.181
4 2017-01-05..2018-01-04 buy_and_hold 0.659 3.057
5 2018-01-05..2019-01-07 buy_and_hold 0.936 -0.500
6 2019-01-08..2020-01-07 buy_and_hold 0.828 2.549
7 2020-01-08..2021-01-06 buy_and_hold 1.173 0.843
8 2021-01-07..2022-01-05 buy_and_hold 0.740 0.992
9 2022-01-06..2023-01-06 buy_and_hold 1.089 -0.865
10 2023-01-09..2024-01-09 buy_and_hold 0.229 1.132
random¶
Grid: strategy.type ['random'].
fold test window type IS sharpe_ratio OOS sharpe_ratio
------------------------------------------------------------------------------
0 2013-01-04..2014-01-03 random 1.048 0.924
1 2014-01-06..2015-01-05 random 0.432 0.861
2 2015-01-06..2016-01-05 random 0.535 -1.307
3 2016-01-06..2017-01-04 random -0.152 0.175
4 2017-01-05..2018-01-04 random 0.141 2.473
5 2018-01-05..2019-01-07 random -0.044 -0.299
6 2019-01-08..2020-01-07 random 0.111 1.171
7 2020-01-08..2021-01-06 random 0.437 0.401
8 2021-01-07..2022-01-05 random -0.204 -0.190
9 2022-01-06..2023-01-06 random 0.333 -0.755
10 2023-01-09..2024-01-09 random -0.309 -0.082
ma_crossover¶
Grid: strategy.fast_period [10, 20, 50], strategy.slow_period [100, 200].
fold test window fast_period slow_period IS sharpe_ratio OOS sharpe_ratio
--------------------------------------------------------------------------------------------
0 2013-01-04..2014-01-03 50 100 0.847 1.301
1 2014-01-06..2015-01-05 50 100 0.763 1.179
2 2015-01-06..2016-01-05 50 200 1.236 -0.767
3 2016-01-06..2017-01-04 50 100 0.232 0.405
4 2017-01-05..2018-01-04 50 200 0.145 2.794
5 2018-01-05..2019-01-07 50 200 1.175 -0.485
6 2019-01-08..2020-01-07 10 100 0.827 1.301
7 2020-01-08..2021-01-06 50 200 1.117 0.074
8 2021-01-07..2022-01-05 10 200 1.287 1.021
9 2022-01-06..2023-01-06 10 200 1.148 -1.764
10 2023-01-09..2024-01-09 50 100 1.000 -0.350
rsi¶
Grid: strategy.period [2, 14], strategy.oversold [10, 30], strategy.overbought [70, 90].
fold test window period oversold overbought IS sharpe_ratio OOS sharpe_ratio
----------------------------------------------------------------------------------------------------------
0 2013-01-04..2014-01-03 2 10 70 0.942 0.652
1 2014-01-06..2015-01-05 2 10 90 0.802 0.524
2 2015-01-06..2016-01-05 14 30 70 1.301 0.073
3 2016-01-06..2017-01-04 14 30 70 0.396 1.497
4 2017-01-05..2018-01-04 14 30 70 0.828 1.972
5 2018-01-05..2019-01-07 14 30 90 1.155 -0.468
6 2019-01-08..2020-01-07 2 30 90 1.063 2.007
7 2020-01-08..2021-01-06 2 30 90 0.993 0.965
8 2021-01-07..2022-01-05 14 30 90 0.840 0.988
9 2022-01-06..2023-01-06 2 30 90 0.983 -0.464
10 2023-01-09..2024-01-09 2 30 70 0.565 0.045
momentum_rotation¶
Grid: strategy.lookback [63, 126, 252], strategy.rebalance_every [21, 63].
fold test window lookback rebalance_every IS sharpe_ratio OOS sharpe_ratio
-----------------------------------------------------------------------------------------------
0 2013-01-04..2014-01-03 126 21 1.178 1.258
1 2014-01-06..2015-01-05 252 63 1.286 1.304
2 2015-01-06..2016-01-05 252 21 1.312 -0.141
3 2016-01-06..2017-01-04 126 63 0.946 0.724
4 2017-01-05..2018-01-04 63 63 0.610 2.149
5 2018-01-05..2019-01-07 252 63 1.245 -0.626
6 2019-01-08..2020-01-07 126 21 0.619 0.912
7 2020-01-08..2021-01-06 63 21 0.732 0.838
8 2021-01-07..2022-01-05 126 63 0.844 1.129
9 2022-01-06..2023-01-06 126 63 1.345 -1.006
10 2023-01-09..2024-01-09 63 63 1.186 0.304
pairs¶
Grid: strategy.lookback [60, 120], strategy.entry_z [1.5, 2.0].
fold test window lookback entry_z IS sharpe_ratio OOS sharpe_ratio
--------------------------------------------------------------------------------------------
0 2013-01-04..2014-01-03 120 1.5 0.101 -0.837
1 2014-01-06..2015-01-05 120 1.5 -0.231 0.612
2 2015-01-06..2016-01-05 120 2.0 0.080 0.477
3 2016-01-06..2017-01-04 120 1.5 0.695 3.011
4 2017-01-05..2018-01-04 120 1.5 1.485 0.025
5 2018-01-05..2019-01-07 120 1.5 1.148 0.030
6 2019-01-08..2020-01-07 120 1.5 0.630 1.050
7 2020-01-08..2021-01-06 120 1.5 0.462 0.006
8 2021-01-07..2022-01-05 120 2.0 0.771 -0.519
9 2022-01-06..2023-01-06 120 2.0 0.480 -0.544
10 2023-01-09..2024-01-09 120 1.5 -0.172 0.189
Data¶
| Symbol | File | SHA-256 |
|---|---|---|
| SPY | SPY_1d_2010-01-01_2025-01-01.csv |
398ea564e7c8a677fba7e88cba2482ed66778e0094c1b8a2c777ee5454ca4041 |
| QQQ | QQQ_1d_2010-01-01_2025-01-01.csv |
f664d3d422b37c4a8177c6c265fd261d272c4ccd31ec533cb9c80137cc989479 |
| IWM | IWM_1d_2010-01-01_2025-01-01.csv |
af0075c2bb1ca55d84098def841de6d2089b07bf1dad19158c70a8ad527c974c |
| EFA | EFA_1d_2010-01-01_2025-01-01.csv |
575f48da3e006bd5d4047bd8c32e1dded8847f9d8412bad4988f61be93deb8aa |
| EEM | EEM_1d_2010-01-01_2025-01-01.csv |
cb3bb66d36984da7c4dd6f74616367b554de333e4b81f24119f33dc6e745406e |
| TLT | TLT_1d_2010-01-01_2025-01-01.csv |
9ca9bc2c17cf0b49c845b1008df0183c079e2d1cf928427977af83e7c55a6f3c |
| GLD | GLD_1d_2010-01-01_2025-01-01.csv |
fc245a5dfa2f73cae9564694dd5974bdc0f139905877ffbc365bf90c32b9d70c |
| VNQ | VNQ_1d_2010-01-01_2025-01-01.csv |
35f16662c0eded43310881787d85533600cf2d3312ab30f83c4b4365fe860232 |
| EWA | EWA_1d_2010-01-01_2025-01-01.csv |
798bc032cb1dd21091b11ae93ece465eeee3c8bf1162104532ce7514d7eba121 |
| EWC | EWC_1d_2010-01-01_2025-01-01.csv |
e5963ae429d45a350594c6c77cca85f0aae7de95cf5507d83f5c71f1cc73d5d9 |
A rebuild that downloads afresh may get revised prices (Yahoo adjusts its history for every dividend), and then different checksums and numbers. With the files above in the cache, it reruns offline and reproduces this report.
Caveats¶
- One history. Fifteen years is a few market regimes, not a distribution of them. The intervals above measure noise within this history, not the chance it repeats.
- Chosen today. The ETFs were picked knowing they still trade; a fund that closed would not be here.
- Modelled costs. Fills are simulated from daily bars at the next open, with the costs in the setup. Real fills differ;
trading comparemeasures by how much. - Small grids. Each strategy is tuned over a handful of values. A wider search would fit the training windows better and, most likely, the test windows no better.
- Idle cash. Unless the setup says otherwise, cash earns nothing, which understates strategies that spend time out of the market by the interest they would have earned.