▲ 63 r/algotrading+1 crossposts

Where did I go wrong? A failed strategy after 3 months of Constant Work

Hey all, in this post I will be outlining the approach I've taken to my current infrastructure, data, and strategy, along with how I tested and how I've verified there's no alpha, for two reasons:

  1. To help other algo quant devs to avoid my mistakes

  2. Look into insight from smarter people than me.

So first things first, The Data Approach:

I started off downloading 1 minute data over all 13,000 tickers in the US stock market over the last 20 years, including some other macros such as Oil, Gold, Silver, some international ETFs, US ETFs, and VIX. This is effectively (2005 - 2026). This is my data I am training everything on.

From there I built parquet files, and caches for the 1 minute and 1 day time frames. Incorporated company splits, M&A, ticker renames, point in universe (keeping track of dropped and newly added tickers) in the S&P 500 for example. Validated data is clean.

Next, The BackTesting Approach:

I used both Combinatorial Purged Cross Validation, as well as Walk Forward Optimization (all built in house), to test my strategy. I would then also track deflated sharpe ratio, sharpe ratio, Max Drawdown, Cum Return, CAGR, amongst other metrics. I then developed a triple barrier labelling (which is based on the AFML book, and takes into account 3 barriers (profit taking and stop loss barriers, which are daily computed based on ticker volatility), and a third barrier ~ time (which I arbitrarily chose as 10 days) for a daily based trading strategy.

I also ran 4 models as baselines (S&P 500 Buy and Hold, Mom_12 (monthly rotating of highest momentum ticker per sector), and two others). S&P 500 proved to be the highest sharpe ratio and cumulative return, so that effectively is my baseline I need to beat, with a sharpe ratio of about ~0.5.

Next, Feature Set:

With the backtesting framework setup complete, I developed a set of 60 features, most of them technical or statistical indicators including (price, volatility, volume, return vs. stock's own return in a given period, return vs. s&p 500, return vs. sector average, and multiple other cross-asset correlation features).

Next, Models:

I only built two models to test up until this phase of the project. I used a LightGBM model in a supervised learning capacity, attempting to classify the daily labels across every 150 selected tickers, across my 20 year dataset. Keep in mind the triple barrier labels were computed pre-hand. CPCV would take care of look ahead bias.

I also built a linear regression model to attempt to estimate the time at which one of the 3 barriers would touch.

Next, The Dissappointment:

I ran my model with default hyperarameters, just to see how well it would be able to classify my labels. In all honesty, I anticipated it would be somwhere in the 60-70% accuracy and recall range, then with Optuna hyperparam tuning I could maybe get it up to 70-85%. These numbers are very humble comared to my grad school work where training on classification problems such as image classification, etc. would easily grant me 90%+ accuracy scores.

To my surprise, my model was only able to achieve around 50.5% accuracy, essentially a coinflip ~ zero alpha. In-sample validation showed 70% accuracy, and to further investigate, I tested which epoch gave me the best generalization accuracy ~ turned out to be epoch 2. Anything after that was overfitting heavily.

The linear regression model wasn't much better, effectively too much error to reliably generalize.

Of course there was a lot more future work to do in my algorithm, outlined in the next section, but I wanted to see even SOME promise from my classifier to be able to continue. Right now I feel completely devastated by these results.

Future Phases of my Project (On Hold for now until I decide next pivot):

  1. Meta-labeling (based on AFML), a second layer on top of the models classification results

  2. Optuna based hyper tuning of parameters

  3. SHAP for interoperability of feature importance and model performance

  4. Other interesting models (Transformers, Hidden Markov Models, Random Forests, etc.)

  5. Risk Management Models

  6. Execution Models (L2 based execution and fills)

FINALLY, Where I think I went wrong, What could be done better, And Opening the floor for discussion

  1. AFML strictly talks about how time-based data such as (minute, hour, daily) etc. carries no significant alpha, and instead we should be looking at event driven information, which carries more information entropy.

  2. I've seen a few people talk about tick-level data as where they've found success, rather than minute or hourly or daily time based data

  3. Is my approach completely wrong? Is trying to predict triple barrier labels at 10 days out just a genuinely wrong approach given my feature set? What are typical classification predictions you try to make in your own algos? (Price, volatility, volume, imbalances, etc.)?

  4. Finally, maybe I don't really need high classification accuracy, as Citadel I believe only achieves 51.5% accuracy, but at millions of trades, they're profitable in the billions. Maybe the real alpha is in the execution and risk management side of the algorithm?

  5. I also tested across 20 years of 1 minute data across 150 tickers. Maybe sizing down my dataset could help?

I appreciate any, and all insight, PREFERABLY from smarter people than me who have ACTUALLY managed to produce profitable algorithms that trade in real markets.

(I'm not interested in how good your backtests are, I'm interested in insight from real-trading algorithms in the markets)

- Thank you for reading my long post. You are a real one if you've got this far

reddit.com
u/CuriousEngineerHere — 3 days ago
▲ 165 r/Cartier

Him and Hers - Santos x Panther

2 years ago, on my way to work on a regular Monday, my daily motorcycle commute was interrupted by a negligent SUV driver that decided performing a u turn out of a parking spot without looking into his mirrors was a valid start to the day. At 40-ish mph I tried evading to the best of my ability, but there was only so much I can do within 50ft. Upon impact I was (literally) 2 inches away from diving head first into the A frame of the SUV, and logging off of life forever. I was fortunate enough to miss the steel frame by a few inches, but still ended up breaking 5 of my bones (both wrists, and one leg).

The following months were by far the hardest of my entire life, losing my job, my mental health, and putting on 20lbs, but I just kept holding onto the light at the end of the tunnel.

Fast forward 2 years later, I’m engaged to the beautiful girl that stood by me through it all, I’m back on my feet, and pursuing things that are actually important to me, and finally, alas, some peace.

This piece was to celebrate a second chance at life. To be grateful to God whenever I look at it; that nothing is granted, everything is temporary and can change in a split second. What a better timepiece than the elegant Santos. Absolutely in love with it.

Also had to get my fiance’ a matching panther. The combo imo is a powerhouse.

u/CuriousEngineerHere — 5 days ago
▲ 106 r/rolex

Blue or Slate YachtMaster?

On the road to first Rolex from an AD, with patience, funds sitting in VUSXX awaiting a callback, and through the great abyss of gorgeous Rolex color combinations, one stands feet deep in decision paralysis. The slate yacht-master vs. the blue.

I have put forth the slate as my current champion. Alongside its brethren, the elusive batgirl, and the mint green date-just.

As it stands, my chances of obtaining any of these pieces lay as strong as inflation withering below 3%, but I remain alive with optimism, against all odds.

Bless me with your esteemed opinions on blue versus slate, and alleviate me my fellow brethren.

u/CuriousEngineerHere — 8 days ago

Bluesy Friday - TGIF (Ft. Jerome)

Got this stunning RGF from Jerome (Delivered within 1 day). My experience with Jerome has been phenomenal. QC within a day -> money sent same day -> delivered next day. That compared with my experience with Andiot (1msg/days), and overall process thats taken over 5 weeks for a Bruce Wayne, and still has not even delivered.

Watch Review: RGF dial is breathtaking, super close to Gen, although inside has a very slight purple tint. Gold plating looks great, and heavy tungsten is a very nice touch as well. With that said, my only criticism with RGF is the movement. Compared to my VSF sub it definitely lacks in quality. The movement is not nearly as smooth, the date window feels finicky and doesn’t have refined stops. However the date has been successfully incrementing as it hits 12 o”clock.

Overall Ratings:
Jerome’s Service: 10/10
RGF Bluesy aesthetics: 10/10
RGF movement: 5/10

u/CuriousEngineerHere — 9 days ago