Query: Frequency of investments to maximise returns (and minimise fees)

Relevant passages:
 <=SEP=> Okay, I think I managed to find the precise answer to this problem! It involves solving a non-linear exponential equation, but I also found a good approximate solution using the truncated Taylor series. See below for a spreadsheet you can use. Let's start by defining the growth factors per period, for money in the bank and money invested:   Now, let S be the amount ready to be invested after n+1 periods; so the first of that money has earned interest for n periods. That is,  The key step to solve the problem was to fix the total number of periods considered. So let's introduce a new variable: t = the total number of time periods elapsed So if money is ready to invest every n+1 periods, there will be t/(n+1) separate investments, and the future value of the investments will be:  This formula is exact in the case of integer t and n, and a good approximation when t and n are not integers. Substituting S, we get the version of the formula which explicitly depends on n:  Fortunately, only a couple of terms in FV depend on n, so we can find the derivative after some effort:  Equating the derivative to zero, we can remove the denominator, and assuming t is greater than zero, we can divide by the constant ( 1-G t ):  To simplify the equation, we can define some extra constants:    Then, we can define a function f(n) and write the equation as:  Note that α, β, γ, G, and R are all constant. From here there are two options: Use Newton's method or another numerical method for finding the positive root of f(n). This can be done in a number of software packages like MATLAB, Octave, etc, or by using a graphics calculator. Solve approximately using a truncated Taylor series polynomial. I will use this method here. The Taylor series of f(n), centred around n=0, is:  Truncating the series to the first three terms, we get a quadratic polynomial (with constant coefficients):  Using R, G, α, β and γ defined above, let c0, c1 and c2 be the coefficients of the truncated Taylor series for f(n):    Then,  n should be rounded to the nearest whole number. To be certain, check the values above and below n using the formula for FV. Using the example from the question: For example, I might put aside $100 every week to invest into a stock   with an expected growth of 9% p.a., but brokerage fees are $10/trade.   For how many weeks should I accumulate the $100 before investing, if I   can put it in my high-interest bank account at 4% p.a. until then? Using Newton's method to find roots of f(n) above, we get n = 14.004. Using the closed-form approximate solution, we get n = 14.082. Checking this against the FV with t = 1680 (evenly divisible by each n + 1 tested): Therefore, you should wait for n = 14 periods, keeping that money in the bank, investing it together with the money in the next period (so you will make an investment every 14 + 1 = 15 weeks.) Here's one way to implement the above solution with a spreadsheet. StackExchange doesn't allow tables in their syntax at this time, so I'll show a screenshot of the formulae and columns you can copy and paste: Formulae:  Copy and paste column A: Copy and paste column B: Results:  Remember, n is the number of periods to accumulate money in the bank. So you will want to invest every n+1 weeks; in this case, every 15 weeks.

 <=SEP=> "Wow, this turns out to be a much more difficult problem than I thought from first looking at it. Let's recast some of the variables to simplify the equations a bit. Let rb be the growth rate of money in your bank for one period. By ""growth rate"" I mean the amount you will have after one period. So if the interest rate is 3% per year paid monthly, then the interest for one month is 3/12 of 1% = .25%, so after one month you have 1.0025 times as much money as you started with. Similarly, let si be the growth rate of the investment. Then after you make a deposit the amount you have in the bank is pb = s. After another deposit you've collected interest on the first, so you have pb = s * rb + s. That is, the first deposit with one period's growth plus the second deposit. One more deposit and you have pb = ((s * rb) + s) * rb + s = s + s * rb + s * rb^2. Etc. So after n deposits you have pb = s + s * rb + s * rb^2 + s * rb^3 + ... + s * rb^(n-1). This simplifies to pb = s * (rb^n - 1)/(rb - 1). Similarly for the amount you would get by depositing to the investment, let's call that pi, except you must also subtract the amount of the broker fee, b. So you want to make deposits when pb>pi, or s*(ri^n-1)/(ri-1) - b > s*(rb^n-1)/(rb-1) Then just solve for n and you're done! Except ... maybe someone who's better at algebra than me could solve that for n, but I don't see how to do it. Further complicating this is that banks normally pay interest monthly, while stocks go up or down every day. If a calculation said to withdraw after 3.9 months, it might really be better to wait for 4.0 months to collect one additional month's interest. But let's see if we can approximate. If the growth rates and the number of periods are relatively small, the compounding of growth should also be relatively small. So an approximate solution would be when the difference between the interest rates, times the amount of each deposit, summed over the number of deposits, is greater than the fee. That is, say the investment pays 10% per month more than your bank account (wildly optimistic but just for example), the broker fee is $10, and the amount of each deposit is $200. Then if you delay making the investment by one month you're losing  10% of $200 = $20. This is more than the broker fee, so you should invest immediately. Okay, suppose more realistically that the investment pays 1% more per month than the bank account. Then the first month you're losing 1% of $200 = $2. The second month you have $400 in the bank, so you're losing $4, total loss for two months = $6. The third month you have $600 in the bank so you lose an additional $6, total loss = $12. Etc. So you should transfer the money to the investment about the third month. Compounding would mean that losses on transferring to the investment are a little higher than this, so you'd want to bias to transferring a little earlier. Or, you could set up a spreadsheet to do the compounding calculations month by month, and then just look down the column for when the investment total minus the bank total is greater than the broker fee. Sorry I'm not giving you a definitive answer, but maybe this helps."