BLOG.CSHARPHELPER.COM: Examine different investment strategies with Dow Jones Industrial Average data in C#
Examine different investment strategies with Dow Jones Industrial Average data in C#
Important Note: I am not a tax or investment professional. I don't even pretend to understand this stuff. This is a very simple tool for playing with numbers (it doesn't even compound continuously) and I don't vouch for its correctness. It should in no way be taken for investment advice. What, are you crazy???
That said...
This example explores different investment strategies. For each strategy, it assumes that you start with $4,000 and then follow the strategy for moving the money into the stock market. It uses Dow Jones Industrial Average data to model your stocks' performance. It also assumes that you get a small amount of interest (1% in this example) on any money not yet invested. You can tweak this and other values in the code to study other effects.)
The strategies examined here are:
All In (296.92%) - All $4,000 goes into the market at the beginning. This strategy follows the market exactly.
5% interest (178.60%) - All $4,000 goes into CDs or some other interest-bearing account and stays there earning 5% annually. This is the gray stair-stepped curve on the bottom. This is the only strategy that is clearly worse than the others. Except for a brief period in 2009, it under-performs every other strategy.
$100 per period (321.30%) - Every investment period (each weekday in this example), you move $100 into the market. This is a popular strategy with personal finance managers. The idea is that you don't dump everything in at the start so you don't get penalized if the market moves down right after you enter the market. Conversely you don't reap the benefits if the market jumps right after you enter. This evens out the bumps. Try experimenting with the amount you move in each period. If you use a small value like $1, the money move in too slowly so you don't get the full benefit of being in the market for a long time. If you move too fast, the method doesn't even out the bumps so, for this example data, you get hit a bit in the beginning.
$100 per 3 down periods (315.92%) - You move $100 if the market is down 3 times in a row. The idea is that if the market is down, you should put more money in so you get the benefit when it recovers.
$10 when down by 0.1% (274.01%) - You move $100 if the market drops 0.1% in one period. The idea is that if the market is down, you should put more money in so you get the benefit when it recovers. Larger values for the percentage don't occur very often so you don't get the money in fast enough.
$100 when down by $10 (312.05%) - You move $100 if the market is down by $10 in one period. The idea is that if the market is down, you should put more money in so you get the benefit when it recovers. Large values for the amount that the market should be down don't too often so you don't get the money in fast enough. Very small values (i.e. you move money whenever the market is down) work fairly well.
$100 per 3 up periods (308.42%) - You move $100 if the market is up 3 periods in a row. The idea is that the upward trend will hopefully continue.
$100 if increase > 1% (325.16%) - This is a "perfect guess" strategy where you know ahead of time what the market will do. If the market will be up by more than the base interest rate (1% in this example), you move $100 into the market. This provides a reasonable upper bound for performance, although if you were really omniscient and could buy and sell without paying commissions you could do even better by moving all of the money in and out of the market at will.
The results of all of these strategies is very similar (except for the flat interest rate strategy, which clearly loses).
The "perfect guess" strategy is only slightly better than the other strategies. In particular, investing a fixed amount per period as favored by personal finance managers works pretty well. Who would have thought?
Keep in mind that this example is just for playing with the numbers. Many of the strategies are sensitive to the particular behavior of the market so the results may vary widely depending on what the market is doing when you run the simulation. The only conclusions that really seem to make sense are:
Staying out of the market and only collecting interest is a losing strategy in the long run. Unless you can guess extremely well what the market will do, you'll earn more in the market.
Some people panic and get out of the market right after a big drop. This is a mistake. Even in the volatile years near the end of this data, the market recovered most of its lost value over the next couple years after a big drop. Unless you need the money immediately, you're better off waiting a bit before you get out.
Strategies such as "it's been up 3 days in a row so it must continue up" and "it's been down 3 days in a row so it must go back up" don't really work very well. Unless you can guess specific ups and downs, this strategy is too simplistic.
Comments