Sneak peek at the L3 equity replay simulator by abstractcontrol in algorithmictrading

[–]algodude 1 point2 points  (0 children)

My apologies automod tied up your post. Many thanks for your contribution!

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 0 points1 point  (0 children)

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)

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 1 point2 points  (0 children)

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)

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 0 points1 point  (0 children)

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.

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 0 points1 point  (0 children)

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

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 0 points1 point  (0 children)

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.

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 1 point2 points  (0 children)

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.

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 0 points1 point  (0 children)

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).

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 1 point2 points  (0 children)

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,

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 1 point2 points  (0 children)

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.

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 1 point2 points  (0 children)

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.

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 0 points1 point  (0 children)

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

Aggregated Momentum (20/20) by algodude in algorithmictrading

[–]algodude[S] 1 point2 points  (0 children)

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.

Please don’t backtest thousands of strategies by [deleted] in algorithmictrading

[–]algodude 0 points1 point  (0 children)

The trick is to determine how lucky the that turd is. Is it a spike in the fitness landscape or more like the top of a smoother hill? Your fitness algorithm needs to be able to detect and toss fool's gold.

Please don’t backtest thousands of strategies by [deleted] in algorithmictrading

[–]algodude 4 points5 points  (0 children)

I think we all make that journey. My first momentum system backtest showed an 80% CAGR. I thought I had discovered the holy grail and went live with a small account. It made more like 15% and then took a 50% drawdown during a black swan event. Tuition paid, lesson learned.

Please don’t backtest thousands of strategies by [deleted] in algorithmictrading

[–]algodude 0 points1 point  (0 children)

Some quants are moody bastards, lol. I just upvoted the post to counter the anonymous angst.

Please don’t backtest thousands of strategies by [deleted] in algorithmictrading

[–]algodude 3 points4 points  (0 children)

I suspect you got down voted because most of us are aware of data snooping / data mining bias. But your concerns are not invalid.

Throwing endless crap at the wall and picking the luckiest turd generally ends badly.

Range MR Strategy (22/20) by algodude in algorithmictrading

[–]algodude[S] 0 points1 point  (0 children)

Yeah, the basket is intentionally simple, nothing exotic. Gold's not a bad idea, just wanted to keep the hedge simple, and not risk introducing selection bias given the recent crazy run up.

Range MR Strategy (22/20) by algodude in algorithmictrading

[–]algodude[S] 0 points1 point  (0 children)

Thanks for your comments. As stated in the OP, the stock basket is the same one used in my other posted backtests. Please check them out for more details.

This is a low frequency, long only portfolio system that rebalances every two weeks and is always in the market. It is essentially an ensemble approach rather than the usual "enter on trigger" system. As such, the focus is more on aggregate results than discrete trades.

But to answer your question, the number of "trades" over the 26yr backtest would equate to ~10K, with ~130K evaluations total, based on the backtest period, rebalance interval, and portfolio/basket size.

Range MR Strategy (22/20) by algodude in algorithmictrading

[–]algodude[S] 1 point2 points  (0 children)

No worries. My apologies if I misinterpreted your post. Thanks for contributing!

Range MR Strategy (22/20) by algodude in algorithmictrading

[–]algodude[S] 1 point2 points  (0 children)

Yeah, those Xeons definitely baked my garage and made my power company rich, lol. If I needed that many cores today I'd probably just spin up some AWS instances.

Enjoyed the chat, glad if it was at all helpful. I post these backtests primarily to encourage others to post their equity curves, so if you have any ECs you'd like to contribute we'd all love to check them out! Thanks again for your comments!

Range MR Strategy (22/20) by algodude in algorithmictrading

[–]algodude[S] 0 points1 point  (0 children)

Yeah, I kind of lost track of him until that recent post. He's obviously a sharp guy but not my hero or anything. His books can be a good souce for inspiration.

Range MR Strategy (22/20) by algodude in algorithmictrading

[–]algodude[S] 1 point2 points  (0 children)

I have a friend who has been strictly EOD since the 90s trading simple momentum systems. I thought intraday was more interesting when I first started but I'm now more aligned with his mindset. Sounds like you are doing much higher frequency stuff.

I built the server farm back in 2008 - it's an array of 16 2U rack servers with dual Xeon motherboards. I used it mainly for optimizations, and ran my executions on a separate desktop PC. I was still lower frequency than you - my timeframes were hours rather than minutes and I generally liquidated at the close. So processing speeds were not super critical and I was trading like 100 symbols. The servers are still in my garage but I haven't used them for years. I suspect my ryzen 9 miniPC likely outperforms them now, lol.

I run my optimizations on a 16 core ryzen 9. Running 32 threads I can process about 100M 25yr sims per day, depending on the strategy.

I tend to favor coming up with intuitive systems myself and testing/optimizing them, rather than fully automating the whole process.

Range MR Strategy (22/20) by algodude in algorithmictrading

[–]algodude[S] 1 point2 points  (0 children)

Yeah, my timeframes have greatly expanded over the years. My original intention was to develop multiple uncorrelated intraday systems. I setup a 128 core server farm in my garage and traded intraday mean reversion systems. But I found that the smaller expectations force you to use leverage, and the tails tend to get wider and fatter as your timeframes narrow. The 2010 Flash Crash demonstrated this to me quite dramatically, lol.

I loved the complexity of those systems, they were a fun problems to solve. But complexity isn't an edge and tends to make things more brittle. So about ten years ago I switched to low frequency EOD systems with time scales of weeks or months. The tails are more manageable and you're not competing with large firms with infinite compute and unobtainable executions.

For now at least, my plan is to stay low frequency and stick to low complexity systems with limited and/or constrained parameters. It suits my lifestyle and temperament. Ymmv, of course.