The notebook reads SPY's trend and volatility to choose an allocation. In some regimes it puts around 80% into QQQ. In others it uses a basket of funds or takes a small position in an inverse fund and holds the rest in cash. It simulates orders at the following open. Original notebook
Three ways to allocate the portfolio
The Docker replay recorded 48 rebalances. Cash is measured at the close of the day each rebalance was executed.
| Allocation | Rebalances | Average closing cash |
|---|---|---|
| QQQ | 21 | 19.92% |
| Diversified basket | 15 | 24.93% |
| Defensive position in SH | 12 | 92.51% |
February 4, 2020 is an example. The portfolio sold QQQ and closed with 92.52% in cash and 7.48% in SH.
The full historical result
From January 2019 to December 2024, the strategy gained 26.48% net and its largest decline from a peak was 20.03%. URTH, the global equity fund used as the notebook's benchmark, gained 118.85% and fell as much as 34.01% from its peak. The report measures both series from close to close and keeps the notebook's trading costs and interest on cash.
What the engine measured
Cumulative return
Worst drawdown from a peak
Ratios, with their 95% interval
- Strategy
- Reference: URTH
- 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.24, with a 95% interval of −0.47 to 0.96. Against URTH, the average annual difference was −10.49%, with a t-statistic of −1.46: it cannot be told apart from zero.
When the same returns were resampled in blocks, the cumulative return fell between −13.74% and 82.56% in the central 90%, and the worst drawdown between 10.39% and 31.05%. 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 how your portfolio was allocated in each phase.