Realized and unrealized gains
Your portfolio tracks two kinds of profit. Unrealized gains are paper gains on holdings you still own, and they move with prices. Realized gains are profit you locked in by selling, and they are fixed once the sale is recorded. This page explains both figures, the holding period attached to each sale, and how the calculations work. Realized and unrealized gains are available on the Free, Pro Lite, and Pro plans.
Before you begin
- Sign in on a plan that allows portfolios. These figures are available on Free, Pro Lite, and Pro.
- Build a portfolio and record at least one buy. For the steps, see Build your first portfolio.
- Record a sell to generate realized-gain rows. Until you sell, only unrealized gains appear.
Quickstart
Open the Holdings tab
Go to the Holdings tab and select your portfolio to read the unrealized gain on each position.
Open the Realized tab
Go to the Realized tab to read each sale lot, with shares sold, cost basis, sale price, realized gain, and holding-period days.
Read the realized totals
Review lifetime realized gains and year-to-date realized gains at the top of the Realized tab.
What it shows
- Holdings tab: the unrealized gain on each position and in total.
- Realized tab: each sale lot with shares sold, cost basis, sale price, realized gain, and holding-period days.
- Realized totals: lifetime realized gains and year-to-date realized gains.
Inputs
There are no direct inputs. Both figures derive from your buys and sells. Recording a sell creates the realized-gain rows for that sale.
Outputs and how to read them
- Unrealized gain: profit on shares you still hold. It changes daily with prices.
- Realized gain: profit you actually locked in by selling. It is fixed once the sale is recorded.
- Holding-period days: how long the sold shares were held, useful context for short-term versus long-term gains.
- Realized year-to-date: realized profit booked so far this calendar year.
How it is calculated
Four figures appear here: unrealized gain on current holdings, realized gain on each sale, the holding period for each sale, and the year-to-date realized total.
Unrealized gain
Unrealized gain is the paper profit on holdings you still own: today's market value minus what you paid for the shares you still hold.
unrealized gain = (shares × current price) − (shares × average cost)
In this formula, shares is the units you currently hold, current price is the latest end-of-day close in US dollars, and average cost is your buy-weighted cost per share in US dollars, as described in Manual portfolios. For example, 120 shares at a price of 20 with an average cost of 12 give 2,400 minus 1,440, which is 960. This figure moves with end-of-day prices and becomes realized only when you sell.
Realized gain per sale
When you sell, the oldest shares you bought are matched first, and the profit is the sale proceeds minus what those specific shares cost. This is a first-in, first-out match by transaction date.
gain = (shares from lot × sale price) − (shares from lot × buy price)
In this formula, shares from lot is the number of shares matched from a given purchase lot, sale price is the per-share sale price in US dollars, and buy price is that lot's purchase price per share in US dollars. Lots are consumed oldest first by transaction date. For example, selling 30 shares at 20 that came from a lot bought at 12 gives 30 times (20 minus 12), which is 240. Matching is strictly first-in, first-out by transaction date, so it can differ from a specific-lot tax method your brokerage uses.
Holding-period days
The holding period is the calendar day count between purchase and sale for the matched shares.
days = whole days between purchase date and sale date
Here purchase date and sale date are the transaction dates of the matched buy and the sell. For example, shares bought on 2024-01-10 and sold on 2024-07-10 give 182 days. This is the day count between the two dates and is informational, not a tax determination.
Realized year-to-date
The year-to-date total sums the realized gains on every sale dated on or after January 1 of the current year.
realized year-to-date = sum of realized gain for sales dated on or after January 1
In this formula, realized gain is the per-sale figure above. For example, if lifetime realized gains total 2,215,596.35 and 2,043,791.98 of that comes from sales dated this year, the year-to-date figure is 2,043,791.98. It uses the calendar year, not a trailing 365 days. These figures recompute when you change the ledger.
Data and timing
Realized gains are derived from your transaction ledger and are created when a sell is recorded. Unrealized gains also use end-of-day prices from AlphaVantage (Nasdaq quotes delivered through AlphaVantage). Both recompute when you change the ledger and on the daily data refresh.
Use cases
- Track tax-relevant realized gains over the year.
- See which current holdings carry the biggest paper profit.
- Review holding periods on positions you have sold.
Limitations and disclosures
This is not tax advice. Realized-gain matching is first-in, first-out and may not match your brokerage's cost-basis method, so reconcile with official statements. Unrealized gains use end-of-day prices and move once per trading day.
GNG Research provides equity research and educational tools, not investment advice. Nothing on the platform is a recommendation to buy or sell any security. Do your own research and consider your circumstances before making any investment decision.
