Back to Blog

Average Cost Method Explained: How to Track Your Real Portfolio Returns

6 min readBy Networthy

You buy a stock three times at different prices, hold it for two years, then sell half your position. What is your actual return? Most investors assume their app handles this correctly. Many apps do not — and the error only becomes visible when you start selling.

The average cost method is the foundational approach that makes portfolio tracking honest across multiple purchases and partial sales. Understanding how it works — and where it can go wrong — is essential for anyone who invests regularly, whether into ETFs, individual stocks, or a mix of both.

What Is the Average Cost Method?

The average cost method calculates your cost basis by dividing the total amount you paid for all shares of a given asset by the total number of shares you currently hold. That single number — the average cost per share — becomes the reference point against which your current price is compared to calculate gain or loss.

For investors who make periodic contributions — a strategy widely known as dollar-cost averaging (DCA) — this method is the natural fit. Each new purchase is folded into a rolling weighted average, reflecting exactly what the portfolio actually cost over time.

A concrete example

Suppose you buy a European ETF in three tranches over twelve months:

  • January: 10 shares at €50 each → €500 invested
  • June: 10 shares at €60 each → €600 invested
  • November: 5 shares at €40 each → €200 invested

You now hold 25 shares and have committed €1,300 in total. Your average cost per share is €1,300 ÷ 25 = €52. If the ETF currently trades at €58, your unrealised gain per share is €6, and your total unrealised gain is €150 — a return of 11.5% on your €1,300 invested.

Simple enough. The complication arises as soon as you sell.

Why Selling Creates a P&L Calculation Problem

When you sell shares, your cost basis decreases — but by how much, and measured against what baseline? This is where most portfolio trackers introduce a silent distortion.

Imagine you hold 20 shares of a stock with an average cost of €80 per share — €1,600 total invested. The stock drops to €60. You decide to cut your losses and sell all 20 shares, realising a loss of €400. Your portfolio now has €0 in that position.

A tracker that uses your current open-position cost as the denominator for your total return percentage would now show: open cost = €0, so that position no longer drags on the overall percentage. Your portfolio return percentage improves — even though you just locked in a real loss. This is not performance improvement. It is a measurement illusion.

Selling a losing position does not improve your returns. It crystallises your loss. Any system that shows otherwise is using the wrong denominator.

The Correct Approach: Separating totalCost from totalInvested

Accurately tracking returns across a portfolio with multiple buys and sells requires distinguishing between two fundamentally different concepts that are often conflated:

  • totalCost — the cost of positions you currently hold (this number decreases when you sell)
  • totalInvested — the total capital you have ever deployed into the market (this number never decreases)

A third concept completes the picture: totalRealizedPnl — the profit or loss you locked in when you sold, plus any cash dividends received. This is money you have already "taken off the table", and it must be added back into your total return calculation or it disappears from the ledger entirely.

The formula that gives you an honest answer

With these three components, total P&L across a portfolio can be expressed cleanly:

  • totalPnl = (currentValue − totalCost) + totalRealizedPnl
  • totalPnlPercent = totalPnl ÷ totalInvested × 100

The key insight is in the denominator: totalInvested, not totalCost. Because totalInvested only ever increases — it is the historical sum of every euro you committed to buying assets — it provides a stable, honest baseline. Selling a loser reduces totalCost, but it does not reduce totalInvested. Your true return percentage cannot be inflated by exiting positions.

Walking through the numbers

You invest €2,000 across two positions. Position A (ETF): €1,200 invested, currently worth €1,500. Position B (single stock): €800 invested. The stock falls to €500 and you sell, crystallising a €300 loss.

  • totalInvested: €2,000 (unchanged — you committed this capital)
  • totalCost (after sale): €1,200 (only Position A remains open)
  • currentValue (after sale): €1,500 (only Position A)
  • totalRealizedPnl: −€300 (the locked-in loss from the sale)
  • totalPnl: (€1,500 − €1,200) + (−€300) = €300 − €300 = €0
  • totalPnlPercent: €0 ÷ €2,000 × 100 = 0.0%

The return is flat — which is correct. Position A gained €300, Position B lost €300. A tracker using totalCost as denominator would instead show: (€1,500 − €1,200) ÷ €1,200 × 100 = +25%. That is a fabricated result.

How Networthy Implements This

Networthy was built from the ground up with this distinction at the core of its calculation engine. Every transaction you record passes through a pipeline that tracks all five components simultaneously:

  • totalCost — recalculated on every buy and sell, reflecting only open positions
  • totalInvested — a monotonically increasing sum of all BUY transactions, never reduced
  • totalRealizedPnl — accumulated each time you close a position or receive a cash dividend
  • totalPnl — derived from current market value, open cost, and realised gains combined
  • totalPnlPercent — always divided by totalInvested, immune to the "sell-a-loser" distortion

This means the portfolio return percentage you see in the app reflects the true performance of your capital — not an artifact of which positions you happen to still hold. Whether you are a buy-and-hold investor or an active trader who regularly rebalances, the number remains mathematically honest.

The same logic applies to partial sales. If you sell half of a position, Networthy allocates the realised gain or loss proportionally to the shares sold, and reduces totalCost by the average cost of those shares. The remaining position continues accumulating unrealised P&L from the correct adjusted baseline.

Comparing Cost Basis Methods: Average Cost, FIFO, and LIFO

For European investors, it is worth knowing that cost basis methods are not all equal — legally or practically. LIFO (Last In, First Out) is prohibited under IFRS accounting standards, which apply across the European Union. FIFO (First In, First Out) is permitted and sometimes mandated for tax reporting, but it produces different cost-basis results from the average cost method because it assumes the earliest shares are sold first.

  • FIFO: sells the oldest (usually cheapest) shares first — can produce higher taxable gains in a rising market
  • Average cost: pools all purchases into a single weighted average — simpler, and aligned with the economic reality of DCA investing
  • LIFO: sells the newest shares first — illegal under IFRS/EU rules for financial instruments

For portfolio performance tracking — as distinct from tax reporting — the average cost method is the most meaningful approach for long-term, periodic investors. It reflects what you actually paid on average for your exposure to an asset, rather than arbitrarily privileging older or newer lots.

What This Means for Your Portfolio Management

Understanding your true cost basis has practical consequences beyond just seeing a correct number on screen.

  • Rebalancing decisions: knowing your real average cost per position helps you evaluate whether trimming a winner or cutting a loser makes sense relative to your original thesis, not relative to a distorted baseline.
  • Tax efficiency: in jurisdictions where average cost is an accepted method for CGT calculations, having an accurate running average reduces the work of tax reporting significantly.
  • Benchmarking: comparing your portfolio return against an index (e.g., MSCI World or S&P 500) is only meaningful if both figures use the same honest return calculation.
  • Psychological anchoring: seeing a number that cannot be gamed by selective selling keeps you focused on the right question — has my capital grown relative to what I put in?

Networthy displays all five components (unrealised gain, realised gain, total P&L, percentage return, and total invested) in your portfolio dashboard, so you always have the full picture — not just the number that looks best.

Start Tracking Your Real Returns

If your current tracker shows a return percentage that improves when you sell a losing position, it is using the wrong formula. Your returns should reflect your decisions and the market's performance — not the mechanics of how the denominator shrinks.

Networthy is free to get started. Add your transactions, import from your broker, or enter positions manually — and see your portfolio performance calculated the way it should be: with every euro you ever committed to the market counted in the denominator.

Accurate numbers lead to better decisions. That is the whole point.

Ready to professionalize your investments?

Track every position, understand your true P&L, and get a daily AI briefing at market close. Starting free.