A Strat a Day Episode 1 - Momentum
The time has finally come! Episode 1 of "A strat a Day" is here! Today we are starting off with a simple Momentum Strategy.
Loading Data
We will run this strategy on 4 different asset classes:
Stocks (SPY)
Bonds (TLT)
Real Estate (VNQ)
Commodities (GSG)
We use weekly data starting 2007-05-28 and ending 2023-05-29.
Baseline Strategy
We need some very simple baseline strategy that we can improve on.
The rules are gonna be: Hold an equally weighted portfolio of all assets with a positive 24 week return.
Let’s see how this performs In-Sample (First 400 weeks):
Not bad at all! We can get an even better understanding of our PNL by looking at the performance of each asset separately:
Looks like the baseline strategy performed the best on SPY which makes sense since SPY itself performed the best out of all 4 assets.
Analysis
Just going long on positive 24 week returns is pretty arbitrary and not very quant-like. Let’s get a better understanding of our data.
One way momentum can show itself is through positive autocorrelation of returns so let’s look at those:
Nothing really sticks out to me here… does this mean we don’t actually have any momentum in our assets?
Not so quick!
Imagine the following scenario:
If our last weeks return was positive then we have a 60% chance of having a negative week. Our Autocorrelation is gonna be negative BUT our negative weeks are on average -0.1% while our positive weeks are on average 0.4%.
So while a negative week is more likely we still have momentum in the form of positive *average* returns, let’s look at those:
That looks a lot better! Instead of using the maximums let’s use some “nice” numbers:
SPY: 24 weeks
TLT: 12 weeks
VNQ: 24 weeks
GSG: 12 weeks
Notice something interesting with GSG? The more weeks we wait the more negative returns seem to become so let’s include one more condition:
GSG (short): 52 weeks
Using those new rules here is our new in sample performance:
We can again look at the pnl for each asset separately but let’s look at GSG only since it’s the most interesting:
That’s what I like to see! Now this is still just In-Sample, the true test will be Out-Of-Sample performance, let’s now backtest our Strategies on all of our available data:
I’d call that quite a success for such a simple strategy, our improved strategy continues to outperform our baseline strategy and both greatly outperform buy and hold.
Exercise
Now here is an exercise for you guys:
Is an equally weighted portfolio optimal? If not what weights should you use?
(Hint: better performing assets should have a higher weight and good weeks should have a higher weight as well)
Could we short the assets as well?
Final Remarks
Hope you guys enjoyed episode 1!
I’m gonna be opening up a discord for this substack tomorrow. There you will be able to give me feedback, suggestions on what you guys want to see and discuss stuff like the exercises.
Until tomorrow which will be titled:
“A Strat a Day Episode 2 - Statistical Arbitrage using Crypto ETFs”
Files
Available tomorrow on Discord