I was thinking yesterday about what would happen if I followed the following investment strategy:
- Let A, B, and C be the stock price two months ago, last month, and today, respectively.
- If A > B < C, purchase as much of the stock as you can, as the price just started rising.
- If A < B > C, sell all of the stock, as the price just started falling.
- Repeat ad infinitum
Basically, the idea is being a day late on when an Oracle would choose to buy/sell a stock. I downloaded historical data of the S&P 500 since 1871 and wrote a Python script to test out my idea. The data only has a resolution of a month, so I ended up breaking it down into 10-year intervals, to see whether the strategy above would be better or worse than just buying and holding for the entire period.
The result was that, over a total of 1647 10-year periods, the strategy above won 1172 times, and lost the other 475 times, meaning it was a better choice slightly more than 70% of the time for any given 10-year stretch.
I am fairly sure my code is accurate, but if my conclusion seems wildly off, let me know. My main question though is as follows: Did I (re-)discover a strategy that is risky but, on average, better than passively investing, at least with regards to historical S&P 500 data? There are two large periods of losing when starting between 1942 and 1960 and when starting between 1970 and 1992, which drives the success rate to about even when looking at the last 100 years. Is there some assumption I am making that explains why this strategy would not work as well as it seems to? I highly doubt I came up with a brilliant market-shattering investment strategy.