TSE.
MathematicsFinanceHealthPhysicsEngineeringBrowse all

Finance & Economics · Quantitative Trading & Crypto · Position Sizing

Dollar Cost Averaging Calculator

Calculate the average cost per share and total portfolio value when investing a fixed amount at regular intervals.

Calculator

Advertisement

Formula

\bar{P} is the average cost per share, N is the number of investment periods, A is the fixed investment amount per period, and P_i is the asset price in period i. The harmonic mean of prices naturally results from investing a fixed dollar amount.

Source: Standard financial mathematics; Malkiel, B.G. — A Random Walk Down Wall Street.

How it works

Each period you invest a fixed amount A. Because the number of shares you receive equals A divided by the current price, you automatically acquire more shares during price dips. The resulting average cost per share is the harmonic mean of the prices paid — which is always less than or equal to the arithmetic mean, giving DCA its structural advantage in volatile markets.

This calculator simulates a linearly drifting price path driven by your chosen annual drift rate, compounds the price monthly across N periods, and computes total shares, portfolio value, and how the outcome compares to investing the entire sum on day one.

Worked example

Suppose you invest $500 per month for 12 months. The asset starts at $100 and drifts upward at 8% per year (≈ 0.667% per month), finishing near $108.30.

Total invested = $500 × 12 = $6,000. The harmonic-mean average cost works out to roughly $103.97 per share, so you accumulate about 57.71 shares. At a final price of $130, portfolio value ≈ $7,502 — a gain of ~$1,502 (25.03%). A lump-sum investor who put $6,000 in at $100 would hold 60 shares worth $7,800 in this rising-price scenario, illustrating that DCA can lag a lump sum in a steadily rising market while protecting against a sharp early drawdown.

Limitations & notes

The price path modelled here is a smooth geometric drift — real markets are far more volatile. In a consistently rising market, lump-sum investing historically outperforms DCA roughly two-thirds of the time (Vanguard, 2012). DCA does not guarantee profit or protect against loss in a prolonged bear market. Transaction costs and taxes on each purchase are not included and can materially affect net returns.

Frequently asked questions

Why is the DCA average cost always lower than the arithmetic average price?

Because you buy more shares when prices are low and fewer when they are high, the harmonic mean of prices — which weights low prices more heavily — always equals or undercuts the arithmetic mean.

Does DCA outperform lump-sum investing?

In hindsight, lump-sum investing beats DCA about two-thirds of the time in rising markets because capital is deployed immediately. DCA shines when markets are volatile or declining at the start of your investment horizon.

What counts as a 'period' in DCA?

A period can be any regular interval — weekly, monthly, or quarterly — as long as the investment amount stays fixed. Monthly contributions are the most common practical choice.

Does DCA work for crypto?

Yes, and high crypto volatility often amplifies the mathematical benefit of DCA since wider price swings let you accumulate more shares during dips. However, the same volatility means significant losses remain possible.

How does the annual drift affect results?

A positive drift simulates a steadily appreciating asset; a negative drift simulates a bear market. Setting drift to 0% models a flat, oscillating market where DCA's harmonic-mean benefit is most visible in isolation.

Last updated: 2025-01-15 · Formula verified against primary sources.