Fund managers have to decide the amount of a fund's assets that should be kept in cash, considering the trade-off between being able to meet shareholder redemptions and minimizing the opportunity cost from lost investment opportunities. In addition, they have to consider redemptions by individuals as well as institutional investors, the current performance of the stock market and interest rates, and the pattern of investments and redemptions that are correlated with market performance. We formulate the problem as a dynamic program, but this encounters the classic curse of dimensionality. To overcome this problem, we propose a provably convergent approximate dynamic programming algorithm. We also adapt the algorithm to an online environment, requiring no knowledge of the probability distributions for rates of return and interest rates. We use actual data for market performance and interest rates, and demonstrate the quality of the solution (compared to the optimal) for the top 10 mutual funds in each of nine fund categories. We show that our results closely match the optimal solution (in considerably less time), and outperform two static (newsvendor) models. The result is a simple policy that describes when money should be moved into and out of cash based on market performance.mutual fund cash balance, approximate dynamic programming