Stock Average / DCA Calculator
Two-mode tool. Average Cost: enter multiple buy lots (qty + price) and the calculator returns weighted average cost per share, total invested, current value at any sell price, and unrealized P&L. DCA Simulator: enter a fixed periodic investment, stress-test scenarios, and see final shares + total return.
Inputs Explained
- Buy Lots (Average mode): Each lot = quantity + price + (optional) date and fee.
- Sell / Current Price: Used to compute unrealized P&L.
- DCA Amount: Fixed amount invested every period.
- DCA Frequency: Monthly is the standard default.
- Period: How many years (or months) to run the DCA simulation.
- Starting Price & Annual Drift / Volatility: Inputs to a simple geometric Brownian price path used in the simulator.
How it Works
Average mode: avg_cost = Σ(qty × price + fee) / Σ qty. P&L = (sell_price − avg_cost) × total_shares − total_fees.
DCA simulator: shares_t = DCA_amount / price_t; total_shares = Σ shares_t; final_value = total_shares × end_price. The price path uses a deterministic CAGR by default (set volatility to 0); set volatility > 0 to randomize.
The Formula
Avg_Cost = Σ(qty_i × price_i + fee_i) / Σ qty_i Total_Value = Σ qty_i × current_price P&L = Total_Value − Total_Invested DCA_Shares = Σ_t [ DCA_amount / price_t ] DCA_AvgCost = Total_Invested / DCA_Shares (≤ simple average price; this is the DCA advantage)
Last reviewed: May 2026
Stock Average / DCA Calculator
Weighted-avg cost basis · DCA simulator · P&L
Frequently Asked Questions
Average price = Total amount invested / Total shares purchased. Example: bought 100 shares at $50 ($5,000), then 200 at $40 ($8,000), then 150 at $30 ($4,500). Total invested = $17,500. Total shares = 450. Average = $17,500/450 = $38.89. This is your cost basis per share — the breakeven price. Selling above this is profit; below is loss. Average price changes with every new buy. Useful for tracking dollar-cost averaging, averaging down, or calculating tax cost basis. The calculator updates average automatically with each transaction.
Dollar Cost Averaging (DCA) means investing a fixed amount at regular intervals regardless of market level. Example: $1,000 monthly into a stock or fund — buys more shares when prices are low, fewer when high, smoothing out average cost. Over time, this often produces a better average price than trying to time the market. DCA reduces emotional decisions and timing risk. SIPs in India are DCA. Best for long-term investors who don't want to monitor markets daily. Lump sum can outperform DCA in rising markets but loses to DCA in volatile or declining markets. The calculator simulates DCA outcomes.
Cost basis = Total cost of all shares purchased (including fees and commissions) divided by total shares. Each lot has its own cost basis if tracked separately. Two methods: Average cost (mutual funds typical) or Specific identification (used for stocks). Example: bought 100 shares at $50 + $5 commission = $5,005 cost basis ($50.05/share). Then 100 more at $60 + $5 = $6,005. Total cost basis = $11,010 for 200 shares = $55.05/share. For tax purposes in the US, FIFO is default unless you specify lots. The calculator tracks cumulative cost basis across multiple buys.
Averaging down means buying more shares of a stock you already own at a lower price, reducing your average cost. Example: bought 100 shares at $50 ($5,000), stock drops to $30. Buy 200 more at $30 ($6,000). New average: ($5,000+$6,000)/300 = $36.67. Now you only need the stock to recover to $36.67 (not $50) to break even. Risk: if the company is fundamentally deteriorating, you're throwing good money after bad. Average down only when you have strong conviction in the underlying business. Don't average down on speculative or weakening stocks. The calculator shows new break-even prices.
Statistically, lump sum investing outperforms DCA about 65-70% of the time over long periods, because markets generally rise. If you have $100,000 and invest it all on day one in an 8% growing market, it grows faster than spreading it over 12 months. However, DCA reduces regret and timing risk. If markets drop right after a lump sum, you feel terrible. DCA also forces discipline. For most retail investors, DCA's emotional benefits outweigh statistical inefficiency. For windfalls, a hybrid approach (50% lump sum, 50% DCA over 6-12 months) balances both.
Brokerage fees, transaction costs, and bid-ask spreads all increase your effective average price. Example: buying $5,000 of stock with $20 commission means you've effectively paid $5,020 — your average cost is slightly higher than the quoted share price. Over many transactions, this compounds. STT (in India), STCG/LTCG tax, GST on brokerage all matter. Discount brokers reduce this drag significantly. For active traders, fees can eat 1-3% of returns annually. Always include fees in cost basis for accurate average and ROI calculations. The calculator includes optional fee inputs.
When selling part of a position, calculate proceeds minus cost basis of those specific shares. In the US, default is FIFO (first in, first out). Example: bought 100 at $50, then 100 at $60, then sold 50 shares at $80. Under FIFO, those 50 came from the first lot at $50 — profit = ($80-$50) × 50 = $1,500. Remaining holdings: 50 shares at $50 + 100 shares at $60 = 150 shares, total cost $8,500, average $56.67. You can specify lots (specific ID) to manage tax. The calculator handles partial sales and remaining cost basis.
Understanding the Stock Average / DCA Calculator
Worked Example
Diego bought AAPL three times: 50 sh @$150, 25 sh @$175, 40 sh @$195. Now trading at $180.
- Total shares: 115 · Total invested: $19,925 (excluding fees)
- Weighted average cost: $19,925 / 115 = $173.26
- Current value: 115 × $180 = $20,700
- Unrealized P&L: +$775 (+3.9% ROI)
- Although his most recent buy is underwater, the earlier $150 lot drags average cost below $180 — so the position is overall in profit.
Comparison Table
| $500/mo DCA | 20 yrs | 30 yrs | 40 yrs |
|---|---|---|---|
| 5% CAGR | $206k | $418k | $764k |
| 7% CAGR | $260k | $610k | $1,310k |
| 9% CAGR | $334k | $916k | $2,341k |
| 11% CAGR | $432k | $1,403k | $4,343k |
Monthly contributions, end-of-month compounding, deterministic CAGR. Real-world returns vary.
Use Cases
- Cost-basis tracking: compute your weighted average to know when to take profits.
- Stock-based comp planning: RSU vests at multiple prices — find your blended cost.
- Long-term DCA: 401(k)/IRA/SIP scenarios over decades.
- Crash recovery analysis: see how DCA accelerates buying during a drawdown.
Glossary
- DCA
- Dollar-Cost Averaging — investing a fixed amount on a fixed schedule, regardless of price.
- Weighted Average Cost
- Total invested ÷ total shares; the basis used for unrealized P&L and tax.
- Lot
- A discrete purchase of shares at a specific price/date; brokers track lots for tax reporting.
- CAGR
- Compound Annual Growth Rate — the constant annual rate that links start and end values.
- FIFO
- First In, First Out — default lot-selection method when selling.
Sources & References
- SEC Investor.gov DCA — US regulator's plain-language description of dollar-cost averaging.
- IRS Publication 550 — Investment income and expense rules — including cost-basis methods.
- Bogleheads Wiki — Community-driven analysis of DCA vs lump-sum across historical data.