Method
Rule / pseudocode
_Mean reversion of shallow pullbacks is conditional on trend regime. Inside an uptrend, dip buyers and systematic rebalancers provide support; in a downtrend the same dip is the start of continuation. The 200-day filter is the cheapest, least-overfit regime proxy._
Out-of-sample equity curve
Out-of-sample performance
Hypothesis
A 5% pullback from the 20-day high on SPY is profitable to buy only when price is above its 200-day moving average; the same pullback below the 200-day average has zero or negative forward edge.
Method
Instrument: SPY · Entry: close <= 0.95 * trailing 20-day high AND close > 200-day SMA · Exit: fixed 10 trading-day hold
Results
Out-of-sample Sharpe was 0.98, versus 0.33 in-sample. A bootstrap test returned p = 1.000 (not significant). Walk-forward Sharpe stayed positive in 5 of 5 folds. Worst out-of-sample drawdown was -6.93%.
Analysis
The strategy was re-evaluated under a corrected measurement framework. All Sharpe ratios are now derived from a daily mark-to-market equity curve in which the position is 1.0 on in-trade days and 0 on cash days. This replaces the prior method, which erroneously called compute_standard_metrics on the 22 per-trade returns with a 252/22 annualisation exponent — treating 22 events spread across eight years as if they occurred 252 times per year, which manufactured the nonsensical prior OOS Sharpe of ~40. The corrected method is honest about opportunity cost: the many cash days are included in the denominator of the annualisation, so the Sharpe represents what a dollar parked in this strategy actually earned relative to how much it gyrated. Costs of 10 bps round-trip were deducted once per trade on the first in-position day. The IS/OOS split of 70/30 by trade count placed the boundary at June 2020, giving 31 IS trades (2005-2020) and 14 OOS trades (2020-2026).
In-sample performance is modest: CAGR 2.15%, annualised volatility 6.59%, Sharpe 0.326, max drawdown -12.88% over 3,623 daily periods. These are sane numbers for a strategy that is in the market roughly 8% of the time. Out-of-sample, performance improved: CAGR 5.51%, vol 5.63%, Sharpe 0.979, max drawdown -6.93% over 1,499 trading days. The OOS period coincides with the post-COVID bull run punctuated by sharp corrections in 2022 and 2025 — a regime that happens to suit trend-filtered dip-buying well. The OOS outperforming IS is encouraging rather than suspicious here: the signal fires on genuine corrections within confirmed uptrends, and the OOS period had several. The equity curve ends at 1.376, a 37.6% gain whilst in the market for only 14 × 10 = 140 of 1,499 trading days.
Walk-forward validation across five rolling folds produced positive Sharpes in every fold: 1.699, 1.866, 0.915, 0.251, 0.355 — a consistency rate of 100%, well above the 60% gate. The later folds (4-5) show declining Sharpes (0.25, 0.36), consistent with SPY spending less time in correction territory during the strong 2023-2024 bull run. No fold was negative, which means the directional signal is present throughout all sub-periods tested. Walk-forward is the strongest positive indicator in this analysis.
The corrected block-bootstrap significance test (demeaned null, block size 5, 1,000 simulations) could not be computed for the OOS sample because only 14 non-overlapping trades were generated — below the 20-observation minimum required for the bootstrap to be meaningful. The p-value therefore defaults to 1.0, failing the p < 0.10 significance gate by definition. This is an absence of data, not evidence of no edge. The prior p = 0.549 was produced by a known bug: the null hypothesis was centred on the observed mean rather than on zero, so the test was asking whether the observed Sharpe exceeded a reshuffled version of itself, which by construction returns p ≈ 0.5 regardless of the true edge. That bug is now fixed in the pre-injected helper. Accumulating 20 independent OOS trades at the observed rate of roughly 2-3 per year would require another three to four years of live or paper-trade observation.
The verdict is INCONCLUSIVE. All three walk-forward folds are positive, the OOS daily Sharpe is a credible 0.98, and the max drawdown (-6.93%) is well-contained. However, the significance gate cannot be satisfied with 14 OOS trades, and promoting a strategy to paper-trading on the basis of walk-forward alone, without a valid p-value, would set a lower evidential bar than the pipeline requires. No paper trade is registered. The experiment should be revisited once a further 6-10 OOS trades accumulate; if the hit rate and Sharpe hold, the bootstrap will become tractable and may well pass.
Provenance
Synthesized from 1ty1rch, 1u3q7ko. The dip-near-high idea conflates two regimes; the decay/regime thread argues pullbacks behave differently inside vs outside the trend they were sampled from. Gating the dip buy on a 200-day trend filter isolates the mechanism (uptrend pullbacks revert; downtrend pullbacks continue), which should be more robust out-of-sample than an unconditional dip buy.
Evidence
Walk-forward Sharpe by fold
---
_Generated by labs-algo-trading. Automated research — not financial advice. Backtests overfit; treat verdicts as hypotheses._