Today a friend opened a stock portfolio, asked me this and I started thinking about it instead of studying:
Let’s say you earn so much that you can save up $100$ € each day. If you invest the money in stocks you get $10$% plus each year on your investment, but investing an additional amount of money costs $25$ € in transaction fees. How often should you invest? It would of course not be reasonable to invest $100$ € each day because you’d loose $25$ € every time, on the other hand, waiting $10$ years is also stupid, because you’d be missing out on the exponential growth and you would only get a linear one. So what is the optimal strategy?
I think investing continuously would generate
$$ \int_0^t 100\cdot \exp\left[\ln(1.1){\frac{t-x}{365}}\right]dx $$
in the time $t$, but is there a function to maximise if we now take the $25$ € into account, or is this a strictly discrete problem? Also I would assume that a periodic investment would be optimal, is that true? I‘ve never done any discrete optimisation, so I‘d be interested in what you all think:)
It seems clear that you should invest periodically, because whatever is the right time to wait for the first investment after you make it you are starting in the same place except you have this account that is growing. We want to compare waiting $k$ days with waiting $k-1$ days and find where the crossover occurs. We will look at the balance at the end of $n=k(k-1)$ days. Define $i=1+\frac {0.1}{365}$ to be the daily interest factor
If we invest every $k$ days at the end of $k(k-1)$ days we have $$(100k-25)\left(i^{n-k}+i^{n-2k}+i^{n-3k}\ldots+1\right)$$ where there are $k-1$ terms in the sum, one for each investment. The first investment is made after $k$ days, so it compounds for $n-k$ days and so on. We can sum the geometric series to get $$(100k-25)\frac {i^n-1}{i^k-1}$$ Similarly, if we invest every $k-1$ days there are $k$ investments and $k$ terms in the sum. We then have $$(100(k-1)-25)\left(i^{n-k+1}+i^{n-2k+2}+i^{n-3k+3}\ldots+1\right)=(100(k-1)-25)\frac {i^n-1}{i^{k-1}-1}$$
I made a spreadsheet to compare these and the breakeven came at $43$ days.