Hey, I've been conducting research for the past month during my free time, which mostly consists of nights and weekends due to my full-time job. I understand that many of you may not appreciate the topic of my research, as it focuses on timing the market to beat it.
However, I kindly request that you acknowledge the amount of time and effort I've dedicated to this research, and consider it as taking on the challenge of proving the claim you can't beat the market.
Upvotes would be appreciated as they serve as motivating factors for me to continue sharing my works.
The primary goal of this post is to initiate a discussion and invite criticism of my work. I won't be including most of the research that yielded poor performance, so I'll provide a TL;DR summary instead.
I took SNP500 data based on this post. TL;DR of this post: I discovered a peculiar annual return pattern of the S&P 500 from 1880 to 2022. Upon receiving a link to the dividend per year during that period, everything fell into place and started making sense.
In the paper Leverage For the Long Run, an alternative strategy to the traditional buy-and-hold approach for the S&P 500 was demonstrated. This strategy involved buying and selling based on the 200-day moving average line. The author showcased how this approach managed to reduce risk while maintaining a comparable annual return. Essentially, the strategy missed out on some upward trends but successfully avoided significant drawdowns such as those experienced in '87, during the dot-com bubble, 2008, etc.
It's important to note that this strategy's ability to dodge these major drawdowns without any logical explanation can be attributed to pure luck. In reality, it reflects the effect of overfitting the parameters, particularly the choice of using a 200-day moving average, across the entire dataset.
Actually, I conducted tests on the strategy using different moving averages such as the 100MA, 150MA, 250MA, and 300MA. However, none of these moving averages yielded satisfactory performance compared to the 200MA. It appears that the 200MA happened to be a fortuitous fit for the problem at hand.
Furthermore, the author also noted that when the S&P 500 is below the 200MA, it tends to exhibit increased volatility.
I tested and verified it, you can clearly observe that the green graph exhibits a wider spread, indicating high volatility. Volatile market periods can be extremely detrimental when holding leverage ETFs. Therefore, it would be immensely beneficial to have a probability function that helps avoid such periods.
This line of thinking led me to consider imitating this strategy but incorporating a "smoothing" effect into the buy and sell function. For instance, when the index falls below the 10-day moving average (10MA), I would sell a portion of my portfolio (e.g., 95% in and 5% cash out). If it also drops below the 20-day moving average (20MA), I would sell more (e.g., 90% in and 10% cash out), and so on.
I calculated this dynamic approach by defining the MAs to consider:
ma_to_considers = [10, 20, 50, 100, 200]
For each day, I calculated the X-day moving average by considering the previous X days. Specifically, for day number i
, I used the following days:
day_(i-10), day_(i-9), day_(i-8), day_(i-7), day_(i-6), day_(i-5), day_(i-4), day_(i-3), day_(i-2), day_(i-1)
.
Then, I compared today's open price (using day_(i)['Open']
) with this past moving average.
This approach ensures that I am not using any future information, as it solely relies on historical data. It's worth noting that this method significantly affects the performance of the strategy.
Here is an example of how the holding weight is calculated using a linear weighted average:For each day, I have a True/False flag for every moving average (MA), indicating whether the index broke that particular MA. Based on these flags, I calculate the 'holding_weight' as follows:
- When the index is above all MAs (nothing broke):
holding_weight = 1 - 0/380 = 1
(100% invested, 0% cash out). - When the index is below all MAs (broke every MA):
holding_weight = 1 - 380/380 = 0
(0% invested, 100% cash out). - When the index is below the 10-day MA: holding_weight =
1 - 10/380 = 0.97
(97% invested, 3% cash out). - When the index is below both the 10-day MA and the 20-day MA:
holding_weight = 1 - (10+20)/380 = 0.92
(92% invested, 8% cash out).
This calculation of the holding weight allows for a flexible allocation strategy based on the current status of the index relative to the moving averages.
Graph showing the holding weight in each time
Here are a comparisons of SNP (holding SNP) vs strategy (dynamic allocation on SNP), comparing the rolling returns with a window size of around 12 years.
Excuse me for changing colors. In this context, blue represents the new purple, indicating that we are fully invested. As the color gets lighter, it means we are gradually moving away from the index and holding more cash.I can share every decade's plot, but you can get the point
Drawdown comparison -The strategy shows superior results over simply holding the SNP, while maintaining higher CAGR.
Metrics | SNP | strategy |
---|---|---|
CAGR | 9.03% | 13.85% |
Maximum Drawdown | -82.42% | -33.31% |
Up until now, everything seems fine. However, when calculating the annual return based on a 30/10-year period, the performance appears to decline over time: Comparison
Every point on the graph, show the average annual return u would got, if you had enter the market for X years investment.
What about leverage? I conducted a simulation of SNPx3 using a borrowing cost of 6% and a commission of 1%. As a sanity test, I compared the simulated SNPx3 with the actual SXPL ETF, considering various rolling return periods.
SPXL vs Simulation, using 1, 3, 5, and 10 years rolling return using both.
When the simulated results underperform compared to the real SPXL, it's actually a positive sign, indicating that we are considering a "worst-case" scenario. "strategy_L" refers to the application of the strategy on the leveraged S&P 500.
Please note that the holding weight is not determined by the leverage itself, but rather by the index itself.
Metrics | SNP | strategy | strategy strategy_L( x3) |
---|---|---|---|
CAGR | 9.03% | 13.85% | 37.44% |
Maximum Drawdown | -82.42% | -33.31% | -75.60% |
Additionally, you can observe the same phenomenon here, where the annual return decreases as we approach more recent times.
ConclusionAlthough I didn't manage to beat the market, the performance of my research surprised me and led me to ponder whether it's possible to hyper-tune this approach. Is it feasible to modify the moving averages to be considered or adjust the weighting method? Additionally, incorporating other widely used indicators like RSI, Bollinger Bands, and so on is worth exploring.
The concept of reducing risk and subsequently reintroducing it through leveraging is quite fascinating to me.
[link] [comments] https://www.reddit.com/r/stocks/comments/14hnvk6/dynamic_snp500_allocation_based_on_moving/
Accedi per aggiungere un commento
Altri post in questo gruppo
Please use this thread to discuss your portfolio, learn of other stock tickers, and help out users by giving constructive criticism.
Why quarterly? Public comp
When you sell a stock to buy another stock, do you prefer to set the estimated amount of the capital gains taxes aside in a money market or do you think it better to
Saving for retirement is crucial, but relying solely on a 401(k) might not be enough due to high inflation. Consider investing in growth stocks, especially in the tec
I’m think this is not a good investment as there is no chatter at all on the 52 week low. They are involved in a class action lawsuits by investors and credit card co
Sorry if this is the wrong sub. Let’s say I had $1 million in VOO but I wanted to sell half of it to buy SCHD. It would suck to pay taxes on $500k. So how would you g
Hey guys, I did a deep dive into Crocs. In this analysis, I will do a brief breakdown of the company and go over some quantitative data, qualitative data and estimate