In mean–variance (M–V) analysis, an investor with a holding period [0,T] operates in a two-dimensional space–one is the mean and the other is the variance. At time 0, he/she evaluates alternative portfolios based on their means and variances, and holds a combination of the market portfolio (e.g., an index fund) and the risk-free asset to maximize his/her expected utility at time T. In our continuous-time model, we operate in a three-dimensional space–the first is the spot rate, the second is the expected return on the risky asset (e.g., an index fund), and the third is time. At various times over [0,T], we determine, for each combination of the spot rate and expected return, the optimum fractions invested in the risky and risk-free assets to maximize our expected utility at time T. Hence, unlike those static M–V models, our dynamic model allows investors to trade at any time in response to changes in the market conditions and the length of their holding period. Our results show that (1) the optimum fraction y*(t) in the risky asset increases as the expected return increases but decreases as the spot rate increases; (2) y*(t) decreases as the holding period shortens; and (3) y*(t) decreases as the risk aversion parameter-γ is larger.