This notebook compares two IBM moving averages, over 31 and 63 sessions. When the faster average is above the slower one, the backtest buys 100 shares at the following close. When the faster average is no longer above it, the portfolio goes back to cash. Original notebook
The first buy came after 32 closes
At the start, the notebook calculates the slower average using the closes it has available. On January 29, 2018, it had 32 closes and generated a buy signal. The backtest bought at the following close and sold on March 8. That trade lost $385.35.
What happened when the full window was required
I reran the calculation in Docker with the same calendar, rules and prices. The change was to wait until the slower average had all 63 observations. The first buy and its sale disappeared. The remaining five orders matched.
From December 2017 to April 2019, the notebook version lost 3.84%. The full-window version lost 2.30%. Both start with $25,000 and use the notebook's zero-cost assumption. The PDFs document the notebook replay.
What the engine measured
Cumulative return
Worst drawdown from a peak
Ratios, with their 95% interval
- Strategy
- Resampling range or 95% interval
Source: technical report of the test, linked below. Prices exclude dividends; the resampling uses the same historical series.
The technical report adds the margin of error to these figures. The Sharpe of the strategy was −0.54, with a 95% interval of −1.99 to 1.58. This report includes no reference, so there is no test against one.
When the same returns were resampled in blocks, the cumulative return fell between −14.34% and 5.75% in the central 90%, and the worst drawdown between 2.98% and 16.56%. What that resampling measures is explained in Block bootstrap and permutation Monte Carlo.
Test reports

How to read this document is explained in the guide to the technical report.
How to read both documents is in the guide to the technical report.
See Strateva's services if you want to check when your strategy's signals first become available.