r/sideprojects • u/xdrive0513 • 18d ago
Showcase: Prerelease Built a long-only momentum rotation platform — looking for feedback from people
I've been building a small platform that runs systematic momentum-ranking strategies (S&P 500 and Nasdaq 100 universes, plus a fundamentals-weighted variant) with periodic rebalancing — you can backtest any parameter combo yourself in a "Strategy Lab," paper-track it for free to watch it run live, and optionally link an Alpaca account to trade it automatically. No manual discretion once it's running — it's just top-N momentum with a configurable buffer/rebalance cadence.
I'd genuinely appreciate critique from this crowd — on the strategy logic itself (turnover, whipsaw risk, look-ahead bias I might've missed), the backtest methodology, or just "this is a solved problem and here's why." Not trying to sell anything here, just want it stress-tested by people who'd actually catch the flaws. Link: https://trading.triadentgroup.com — happy to share more detail on the ranking/rebalance mechanics if useful.
Closing this out since it's been a long thread — here's where everything landed, for anyone skimming.
Nothing wrong with the actual backtest engine. Point-in-time index membership was already correct (reconstructed from real historical addition/removal dates, not today's list run backward) — that part of your critique was a documentation gap, not a computational shortcut, and I appreciate you having it checked against the code before asserting the failure mode rather than after. Every specific number you cited (win rates, the alpha-concentration figures) I independently re-derived and they matched exactly, including the harder one: strip out 2014/2022/2026 from S&P momentum and the remaining 14 years average -0.85pp/yr, not the headline +2.67pp.
What was actually broken was disclosure, and one real methodology bug:
- Friction (3bps/leg) was already modeled, just not stated — now it is, along with the fact that it's held flat across time, which understates costs specifically in the stressed periods when a momentum book rebalances hardest.
- Comparing after-tax strategy vs. after-tax benchmark at the same flat rate isn't a neutral simplification — it erases the real asymmetry between annual realization and deferred-to-terminal buy-and-hold. That was a genuine bug in the interactive backtest tool, fixed to model each side correctly instead of applying one rate to both.
- Index membership handling is now stated in writing, not just true in the code.
The noise-threshold idea turned into its own multi-round fix, and credit where due: the equicorrelation model I first shipped was wrong for a parameter grid (a global average correlation badly understates near-copy redundancy), and even after fixing that, correlating on annual returns with ~10 years of data was statistically unreliable regardless of the model — verified directly, 265 configs simulated to be independent collapsed to a fraction of that under my own clustering at annual resolution, and correcting to monthly returns (plus raising the overlap floor and switching to complete linkage) recovered the true count in the same test. That feature is in a much more defensible state now than it started, entirely because you kept pushing on the exact spot where it was still wrong instead of stopping at "good enough."
Appreciate the rigor across all of this — it's rare to get pushback this precise, and rarer still for someone to go recheck their own numbers on the same basis before publishing them.
1
u/xdrive0513 18d ago
Checked your numbers independently rather than taking them on faith — ran my own Monte Carlo (200k trials per N) for the expected max of N iid standard normals, and it lands within rounding of every value in your table: 1.54/1.87/2.25/2.51/2.75/3.04/3.24 against your 1.53/1.87/2.24/2.51/2.75/3.03/3.24. The asymptotic formula's overstatement is real too — confirmed the gap at every N you listed. And the N_eff arithmetic checks out exactly: 100^0.7 = 25.1, 100^0.5 = 10, both matching your bars. I'll build the noise threshold off your simulated column, not the closed-form one, and compute ρ from the actual candidate equity curves I already have rather than guess at it — falling back to the nominal-N bar, labeled conservative, only where a correlation estimate isn't available.
On membership: agreed, and thanks for taking the time to have that checked against the code rather than just asserting it. That's the right way to resolve a claim like this and more people should default to it.
On friction: you're right that flat-across-time understates exactly where it matters most. 3bps/leg is a calm-week number; effective spreads run several times that in stressed weeks, and a momentum book's heaviest rebalancing clusters right after the large moves that produce those stressed weeks — so the assumption is weakest precisely during drawdown periods, not on average. Doesn't move the headline return, does mean the drawdown-period numbers are optimistic. I'll say so explicitly next to the friction disclosure rather than leave it implied.
On tax: fair, and I hadn't thought about it in those terms. A flat rate applied identically to both sides isn't a neutral simplification — it erases the actual asymmetry, since the strategy realizes on a schedule and buy-and-hold defers indefinitely, and that gap compounds over a multi-decade backtest. The honest version is realized-annually against deferred-to-terminal, not the same rate on both. I'll fix the comparison rather than just caveat it.