Unrealized P&L in Trading Accounts: Calculation, Margin, and Taxes

Unrealized profit and loss in a trading account is the paper gain or loss on positions you still hold: the difference between your cost basis and the current market price, multiplied by the size of the position. It updates continuously while the market is open, it moves your account equity in real time, and it does not become a taxable event until you close the trade. That last point has important exceptions, and the number can still cost you money before you ever sell.

How the Number Is Calculated

Subtract your entry price from the current market price, then multiply by the number of shares or contracts. Buy 100 shares at $50 and watch them rise to $60, and you have a $1,000 unrealized gain. If the price falls to $42, you have an $800 unrealized loss. Your brokerage runs this in the background and displays it in your positions screen, usually color-coded.

The entry price is your cost basis, not just the sticker price of the trade. Cost basis includes fees paid to open the position. Options trades at most major brokerages carry a $0.65 per-contract fee that rolls into basis. Stock commissions at large online brokers are zero for standard trades, but small regulatory and exchange fees still apply. Your trade confirmation shows the exact basis for each lot.

Corporate Actions Adjust the Inputs

A stock split does not create a gain or loss, but it changes the per-share numbers the calculation uses. Own 100 shares at $15 basis, go through a 2-for-1 split, and you now hold 200 shares at $7.50. Total basis stays at $1,500.1Internal Revenue Service. Stocks, Options, Splits, Traders Most platforms make this adjustment automatically.

Dividends can make unrealized P&L look worse than it is. On the ex-dividend date, the stock price typically drops by roughly the dividend amount. A $50 stock paying a $0.50 dividend opens near $49.50, and your unrealized P&L shrinks by that amount even though you received the cash separately. Basis does not change, and the dividend is taxable income on its own.

Multiple Lots of the Same Security

If you bought the same stock at different prices, your unrealized P&L depends on which lot you are measuring. Some brokerages show each lot separately; others blend them using average cost. Most default to first-in, first-out when you sell, but you can usually switch to specific lot identification, which lets you pick which shares to close. That choice does not move your unrealized P&L while you hold, but it changes the realized gain when you sell part of the position.

How Unrealized P&L Moves Your Account Equity and Margin

Your brokerage does not treat unrealized P&L as imaginary. It flows straight into your account equity, which is cash plus the current market value of open positions. A $5,000 unrealized gain increases your buying power. A $5,000 unrealized loss reduces it, and on a margin account the consequences escalate quickly.

Federal Reserve Regulation T requires at least 50% of the purchase price up front when buying stock on margin. After the position is open, FINRA Rule 4210 sets an ongoing maintenance requirement: equity must stay at least 25% of the market value of margin positions.2FINRA. FINRA Rule 4210 – Margin Requirements Many firms set a higher house requirement, often 30% or 35%. When unrealized losses push equity below that line, you get a margin call.

A margin call means depositing cash or liquidating positions to restore equity. Under FINRA rules, the deficiency must be resolved within 15 business days, though brokerages typically give you far less. They also reserve the right to liquidate without waiting if they judge the risk too high. Concentrated positions, especially in thinly traded stocks, can carry higher maintenance requirements than the standard 25%.2FINRA. FINRA Rule 4210 – Margin Requirements An involuntary liquidation triggered by an unrealized loss turns that loss into a permanent one at the worst possible moment.

When Unrealized P&L Becomes Taxable

The general rule is simple. Under federal tax law, a gain or loss exists for tax purposes only when you sell or otherwise dispose of the asset.3Office of the Law Revision Counsel. 26 USC 1001 – Determination of Amount of and Recognition of Gain or Loss A stock can double while you hold it and you owe nothing until you sell. You control the timing.

Closing the position moves the number from unrealized to realized. For a long stock position, that means selling. For a short position, buying to cover. Most securities now settle on T+1, so cash from your sale reaches your account the next business day.4FINRA. Understanding Settlement Cycles – What Does T Plus 1 Mean for You

How long you held the position sets the rate. Gains on assets held one year or less are short-term and taxed at ordinary income rates, which for 2026 run from 10% to 37%.5Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 Gains on assets held more than one year qualify for long-term capital gains rates of 0%, 15%, or 20%, depending on taxable income and filing status.6Internal Revenue Service. Topic No 409 – Capital Gains and Losses Selling one day before you hit the year mark can cost several percentage points on the whole gain.

Higher earners owe an extra 3.8% Net Investment Income Tax on top of the capital gains rate once modified adjusted gross income exceeds $200,000 for single filers or $250,000 for joint filers.7Internal Revenue Service. Topic No 559 – Net Investment Income Tax Those thresholds are not indexed to inflation.

Realized gains and losses are reported on Schedule D of Form 1040, with per-transaction detail on Form 8949.8Internal Revenue Service. Instructions for Schedule D Form 1040 If realized losses exceed realized gains for the year, you can deduct up to $3,000 of the excess against ordinary income ($1,500 if married filing separately), and the rest carries forward indefinitely.9Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses

Exceptions Where Unrealized P&L Is Taxed Anyway

Several carve-outs override the general rule and treat still-open positions as if you had closed them.

Section 1256 Contracts

Regulated futures, broad-based index options, and certain foreign currency contracts are marked to market at year-end. The IRS treats any gain or loss on these Section 1256 contracts as if you sold them on the last business day of the year, and splits it 60% long-term and 40% short-term regardless of actual holding period.10Office of the Law Revision Counsel. 26 USC 1256 – Section 1256 Contracts Marked to Market If you hold S&P 500 futures or SPX options into year-end, your unrealized gain is taxable that year.

Mark-to-Market Election Under Section 475(f)

Traders who qualify as running a securities trading business can elect mark-to-market accounting. The election treats all open positions as sold at fair market value on the last business day of the year, converting every unrealized gain and loss into a realized one.11Office of the Law Revision Counsel. 26 USC 475 – Mark to Market Accounting Method for Dealers in Securities Losses become ordinary losses with no $3,000 cap; gains become ordinary income and lose access to long-term capital gains rates.

Qualifying is not automatic. The IRS looks at whether you trade with substantial frequency and regularity, seek to profit from daily price movements rather than long-term appreciation, and devote significant time to the activity.12Internal Revenue Service. Topic No 429 – Traders in Securities The election must be filed by the due date of the return for the year before it takes effect, which routinely catches traders who decide in April that they should have elected the prior year.

Constructive Sales

Certain hedging trades can trigger a tax on a position you never actually sold. If you hold an appreciated stock and then short the same stock, enter a forward contract to deliver it, or execute an offsetting swap, the IRS treats that as a constructive sale, and you owe tax on the gain as if you sold at fair market value on the date of the hedge.3Office of the Law Revision Counsel. 26 USC 1001 – Determination of Amount of and Recognition of Gain or Loss A narrow exception applies if you close the hedge within 30 days after year-end and then hold the original position unhedged for 60 days afterward.

The Wash Sale Rule When Harvesting Unrealized Losses

One of the most useful things to do with an unrealized loss is realize it deliberately to offset gains elsewhere. The wash sale rule blocks the deduction if you buy back the same or a substantially identical security within 30 days before or after the sale.13Office of the Law Revision Counsel. 26 USC 1091 – Losses From Wash Sales of Stock or Securities

The disallowed loss is not lost forever. It gets added to the basis of the replacement shares, and the original holding period carries over, so a wash sale defers the deduction rather than eliminating it. If you were counting on the loss to offset gains this year, the deferral still hurts.

The rule catches more people than expected. Automatic dividend reinvestment can trigger a wash sale by buying shares of the security you just sold at a loss. So can buying call options or convertible bonds on the same underlying during the 61-day window. When harvesting a loss, turn off automatic reinvestment for that security and stay out of anything substantially identical for the full 30 days on each side of the sale.