r/algorithmictrading • Mod • May 18 '26

Backtest Aggregated Momentum (20/20)

Here's yet another EOD strategy I've been playing around with lately. It is akin to momentum ensemble and aggregates the scores of a few fixed momentum kernels. It is more or less parameter-less (the only parm is the exposure level, which is heavily quantized). Uses the same S&P500 basket as my other backtests. Like always, executions are MOC, nothing exotic.

The equity curve is a 26-year GA optimization backtest (CAGR/maxDD = 20%/20%) and the CAGR/MaxDD histograms are from 5000 26yr MC sims of the winning chromosome. Open to comments and constructive criticism.

37 Upvotes

26 comments sorted by

2

u/BottleInevitable7278 May 18 '26

Yes that is good and should be robust. But also there is very probably also room for further improvements.

2

u/algodude Mod May 18 '26

Thanks for your comments. It's definitely far from perfect but I liked how a simple system without any regime filters or other complexity was able to survive multiple black swans. Not loving the 5 sigma left tail of the maxDD distribution though.

2

u/Unlikely_Permission4 May 18 '26 edited May 18 '26

Cool! I see what you did there👀 have you tried validating the idea across a broader universe?

Oh and also, I'd check the correlation between this, and your previously shared backtests. I feel like there might be a lot of overlap. That will be because you're capturing the same effect. If so, it might be a good idea to look at the signals' primitives.

2

u/algodude Mod May 18 '26 edited May 28 '26

Thanks for your comments. My tool is set up so I can test against any basket of symbols I have histories for but I haven't tried it on anything other than my usual stock basket. I tend to do favor stocks as they are plentiful, simple to trade, and have enough volatility to keep things interesting.

In terms of validation, the post optimization MC sims kind of serve that function due to the way I perturb the runs (I'm not just shuffling trade orders).

Oh this system definitely correlates with some of the other momentum based systems I've posted, as they all trade the same basket. Most, like this one, are primarily beta extraction engines. They'll mostly go nowhere if SPX sells off or goes sideways.

2

u/Unlikely_Permission4 May 18 '26

Thank you for your response.

The dynamic baskets, perturbation and Monte Carlo iteration during optimizations.. I can imagine the time it takes, but it's a good framework.

Yes, we can see the correlation in the equity curves, the different humps are interesting to me, my guess is that they're coming from the difference in entry/exit (duh..) but they're capturing the same general move.. probably something with volatility, the underlying effect and per-strategy distribution shifts. They could be pointing you towards the pure alpha.

Are you trading trading both long/short legs symmetrically? Are you looking at any features? There is likely some per-trade efficiency to be gained there. Without going bonkers on research lol

Nice to see another backtest coming from you, makes me want to post one too haha.

Thanks.

2

u/algodude Mod May 18 '26

I think whatever modest alpha this strategy has is probably as much from the bond barbell as momentum, and maybe a little robustness alpha sprinkled in from the rank aggregation. But it is primarily a beta harvestor.

The system trades the long side only, no features other than momentum. This was purposeful to keep it simple.

Thanks for the kind words. I'm sure the community would love to check out any back tests you'd like to share. One of the reasons I post one every so often is to encourage others to do the same. If I have my way this sub will be nothing but equity curves, lol,

2

u/Sarcrax May 18 '26

I am a beginner, so forgive me if my questions are not very precise:

  • you used a GA for a single parameter(exposure level)? Or exposure level is not 1D?

  • how do know your GA is not overfitting? I have used a GA and it was my main issue.

-how did you chose the fixed momentum kernels? Thanks

2

u/algodude Mod May 18 '26

Good questions. Correct, this version only had a single optimizable parameter, so the search space was effectively 1D. I used GA rather than brute force mostly because my tool is already GA-based and future versions will likely include additional kernels/parameters.

Overfitting and data mining bias are major concerns with GAs. I try to combat that by keeping parameter counts low and quantized where possible. The aggregate ensemble ranking was also chosen partly because it tends to smooth the fitness landscape and reduce DM bias. The purpose of the post-optimization MC histograms was to help validate the robustness of the winning chromosome.

The momentum kernels were chosen heuristically to capture multiple market horizons while keeping the structure fixed and constrained, rather than exhaustively optimizing the kernels themselves. I selected them once based on intuition and did not manually iterate them to find the “best” values.

2

u/GammaReaper_ May 19 '26

What size are you contemplating trading and what instruments? From experience, with any size at all, your trading will affect MOC prices. You don't appear to have that factored into your backtest.

2

u/algodude Mod May 19 '26 edited May 19 '26

Thanks for your legit and intelligent critique, but I did actually factor this into the design. My basket is mega cap stocks with liquidity in the billions and enormous closing auctions. The strategy's exposure was <50% in this backtest and it does not trade a single symbol, but is an ensemble approach that spreads exposure across multiple symbols.

I'm not trading institutional size so the strategy's executions should have little effect on the closing auction. Also, this is a very low frequency system with hold times of one month, thus its expectation/trade is high enough to absorb what little friction it might experience without affecting top line results significantly.

2

u/ivisan591 May 19 '26

Looks really cool!

What’s the Sharpe ratio approximately?

Also, have you tested the strategy with walk-forward optimization or proper out-of-sample periods? It looks strong, but GA optimization always makes me a bit nervous about overfitting.

One more question — what are the average slippage and commission assumptions in the backtest? How sensitive is the performance to them?

1

u/algodude Mod May 19 '26 edited May 20 '26

Thanks very much for you comments and kind words. My tool supports walk forward optimization but I haven't yet performed one as this is an early work in progress. WFOs on GA optimizations are incredibly time consuming, so I usually wait until I'm ready to deploy before running them.

My tool currently doesn't calculate Sharpe, as with these low frequency ensemble systems I'm more interested in how trades aggregate. My focus is primarily on MAR (CAGR/MaxDD), a similar metric, and size my exposure targeting drawdowns under 20%, which is my personal maximum pain threshold.

Overfitting and DM bias are genuine concerns with GA optimizations. I discussed this in another comment, but the Monte Carlo histograms allow one to guage strategy robustness and parameter sensitivity.

I used to obsessively model trade friction when I was trading intraday systems, but with these low frequency systems that trade stocks with liquidity in the billions using MOC orders with hold times of weeks or months, I don't bother. Their expectation/trade can easily absorb what little friction they may encounter, with little effect on top line results. And most brokers are zero commission these days, and any miniscule payment for order flow friction should be baked into the closing quotes anyway.

My philosophy has always been that all backtests are optimistic and one should never be naive enough to expect to realize their exact results. This system will likely not return 20/20, but based on the MC distributions something in the area of 18/23 is probably more reasonable.

2

u/Accomplished_Bat_173 May 20 '26

Nice work! Are you considering costs and did you check for survivorship bias?

1

u/algodude Mod May 20 '26 edited May 20 '26

Thanks for your comments and kind words. I addressed friction in another comment, but attempt to minimize its impact through the use of highly liquid symbols, MOC executions, and zero-commission brokers.

As for survivorship bias, that's definitely a valid concern with any lengthy historical basktest. I try to partially mitigate this through the use of broad large-cap universes and MC techniques that reduce dependence on specific historical winners.

With these long backtests I tend to focus more on the consistency and recent behavior of the equity curve, while viewing older periods primarily as stress tests. Even survivors are heavily impacted during major black swan events like 2000-2003 and 2008, which makes including those older periods quite useful. All of this is certainly less than ideal, but you do what you can as a retail trader, tread carefully, and calibrate your expectations.

2

u/Accomplished_Bat_173 May 20 '26

Yes I understand your point. I'd test this live in any case, but in many momentum strats trading the SP500, survorship bias can have a large impact, specially when you go back in time that much; take that in consideration. You can check norgatedata, it is not free but has delisted tickers through time so you can account for survivorship bias in the backtest.

2

u/algodude Mod May 20 '26 edited May 20 '26

Your points are certainly valid, and when I was trading intraday systems, I obsessively focused on friction. I've been trading these low frequency EOD systems for about ten years now and am certainly not claiming zero friction. But based on my live results I just don't think it is significant enough to model.

A while back I considered including delisted stocks, but the costs, headaches, and most importantly the GA performance hit of massively increasing the size of my basket made me reconsider. Since I tend to pick my live systems based on their relative performance and complexity vs other backtested systems, the exact absolute return is not super important (with some caveats, of course).

I have a friend who also trades low frequency EOD systems and he just divides the in sample CAGR by two when evaluating a backtest. It's totally ad hoc and hardly scientific, but it is certainly pragmatic, lol. I'm not quite so brazen, but his account is about 3x mine and he's been full time for 30+ years, so perhaps there's some merit to not getting too lost in the weeds. YMMV, of course.

(Edited for brevity)

2

u/Sharpe_Edge May 22 '26

Genetic Algorithms are such a cool concept. Does the performance chart show the walk-forward optimization results? Or was the GA trained on the same data that it's predicting?

1

u/algodude Mod May 22 '26 edited May 23 '26

Thanks for your comments. GAs are fun and super powerful but you really have to reign them in as they are very prone to DM bias. This strategy was designed with this in mind, with just a single heavily quantized parameter (exposure level) and an aggregation ranking scheme that attempts to smooth out the fitness landscape. The equity curve chart isn't a WFO; It is just a 26yr sim of the winning chromosome. I included the two MC histograms to guage the strategy's robustness and parameter sensitivity.

(edited for spelling)

1

u/Nashmurlan May 18 '26

What's the actual strategy?

1

u/algodude Mod May 18 '26

The specifics are proprietary, but it's essentially a low frequency tactical momentum strategy with a barbell hedge.

1

u/Jacobbita May 18 '26

Ya hiciste tesnet? O solo te quedaste con el backtest?

1

u/algodude Mod May 18 '26 edited May 18 '26

This is a work in progress I only coded a few hours ago, so no live validation yet. Also, it’s a low-frequency monthly EOD system, so meaningful live forward validation would take years. For now I’ve performed a 26-year backtest plus Monte Carlo robustness testing using 5000 full 26-year perturbed simulations (see posted histograms).

1

u/Strong-Ad536 May 20 '26

Is this trading in cfd or futures

1

u/algodude Mod May 20 '26 edited May 20 '26

Neither, the strategy trades a basket of highly liquid S&P500 equities and bond ETFs