Investing Tips

Long vs. Short-Term Gains: Tax Tips for Trades

By Alex Pierrefeu11 min read
Long vs. Short-Term Gains: Tax Tips for Trades

Two trades can produce the same profit and very different tax bills. The variable is time: a gain on an asset held more than one year is long-term and taxed at the reduced capital gains rates, while a gain on an asset held one year or less is short-term and taxed as ordinary income. This guide follows the IRS's own explanations, in Tax Topic 409, Publication 550 and Tax Topic 429, through how the holding period is counted, what the rates are, how gains and losses offset each other, how the wash sale rule limits loss harvesting, when an active trader is a trader rather than an investor, and which accounts shelter frequent trading. It closes with how the Journal in Quant Charts shows a position's age before you decide to close it. It describes federal rules only and is not tax advice.

Counting the Holding Period

Publication 550 gives the rule and an example. If you hold investment property more than one year, any gain or loss is long-term; one year or less is short-term. Counting begins on the day after you acquired the property, and the day you disposed of it counts as part of the holding period. The IRS example: property bought on January 31, 2024 and sold on January 29, 2025 was held not more than one year, so the result is short-term; sold on February 6, 2025, it was held more than one year and the result is long-term. Selling on the anniversary date itself is still one year or less.

Two adjustments change the count. A loss disallowed under the wash sale rule, described below, carries the old holding period into the replacement shares. And for dividends rather than sales, Publication 550 applies a separate test: a dividend is qualified, and taxed at the capital gains rates, only if you held the stock more than 60 days during the 121-day window that begins 60 days before the ex-dividend date.

The Rates

Tax Topic 409 states that net short-term capital gains are taxed as ordinary income at the graduated rates, while net long-term gains are taxed at 0%, 15% or 20% depending on taxable income. The thresholds for tax years beginning in 2025 were:

Filing status0% rate up to15% rate up to20% rate above
Single$48,350$533,400$533,400
Married filing jointly$96,700$600,050$600,050
Married filing separately$48,350$300,000$300,000
Head of household$64,750$566,700$566,700

The thresholds are indexed each year, so check the current topic page before planning around them. The same topic lists the exceptions: gains on collectibles and the taxable part of section 1202 small business stock are taxed at a maximum 28%, and unrecaptured section 1250 gain on depreciated real property at a maximum 25%. Tax Topic 559 adds the 3.8% net investment income tax for taxpayers whose modified adjusted gross income exceeds $200,000 for single filers, $250,000 for joint filers or $125,000 for married filing separately; it applies to short-term and long-term gains alike.

The rate difference is the whole argument for patience. A taxpayer in the middle of the ordinary brackets who sells a winning position after eleven months pays the ordinary rate on the gain; the same sale a few weeks later, past the one-year mark, may be taxed at 15% instead. Whether waiting is worth it depends on the market risk of holding, which no tax rule can answer, but the arithmetic of the two rates should be part of the exit decision rather than a surprise the following April.

How Gains and Losses Net

Topic 409 defines the terms. Net long-term capital gain is long-term gains minus long-term losses, including any long-term loss carried over from earlier years. Net short-term capital loss is short-term losses, including carryovers, minus short-term gains. Net capital gain, the amount that qualifies for the lower rates, is the excess of net long-term gain over net short-term loss. In practice each category nets within itself first, then the two are combined, and the character of the final figure depends on which side is larger.

If losses exceed gains overall, Topic 409 allows the lesser of $3,000 ($1,500 if married filing separately) or the total net loss to be deducted against other income on Form 1040, with the remainder carried forward to later years. Sales are reported on Form 8949 and summarized on Schedule D, and a large taxable gain may require estimated tax payments during the year.

The Wash Sale Rule

Harvesting a loss to offset gains works only if the loss is allowed. Publication 550 states that you cannot deduct a loss on a sale of stock or securities if, within 30 days before or after the sale, you buy substantially identical stock or securities, acquire them in a fully taxable trade, acquire a contract or option to buy them, or acquire them for your IRA or Roth IRA. A purchase by your spouse or a corporation you control also triggers the rule. The disallowed loss is not lost: it is added to the basis of the replacement shares, and the holding period of the shares sold is added to the holding period of the replacement, so the loss is deferred until the replacement is sold. The publication's example is a $250 loss on 100 shares repurchased within 30 days, which becomes a $250 increase in the new shares' basis.

For an active trader the practical consequences are three. Selling a losing position and re-entering it within the 61-day window defers the loss. Buying the same security in an IRA during the window disallows the loss permanently, because the basis adjustment does not carry into the IRA. And because the replacement shares inherit the old holding period, a wash sale can turn what looked like a fresh short-term position into a long-term one.

Investor or Trader?

Tax Topic 429 draws the line that decides which rules apply. Investors buy and sell securities for personal investment and report capital gains and losses on Form 8949 and Schedule D, subject to the capital loss limit and the wash sale rule; their commissions are not deductible but are included in basis. A trader in securities is in the business of buying and selling for their own account and must meet all three tests: seeking to profit from daily market movements rather than from dividends, interest or appreciation; substantial activity; and continuity and regularity. The topic lists the facts considered, including typical holding periods, the frequency and dollar amount of trades, the extent to which the activity produces a livelihood, and the time devoted to it, and states that calling yourself a day trader does not make you one for tax purposes.

A trader reports business expenses on Schedule C but, without a further election, still reports gains and losses as capital gains and losses with the loss limit and wash sale rule intact. The further step is the mark-to-market election under section 475(f). With a timely and valid election, gains and losses on trading securities become ordinary gains and losses reported on Form 4797, and the capital loss limit and the wash sale rule no longer apply to them. The price is that the lower long-term rates are given up on trading positions, securities held for investment must be identified in the trader's records on the day they are acquired, and the election must be made by the due date of the prior year's return; the topic notes that late elections generally are not allowed and a missed deadline means waiting a year. Gains from trading are not subject to self-employment tax in either case.

Tax-Advantaged Accounts

Frequent trading generates short-term gains by definition, and the simplest way to keep those gains from the ordinary rate is to make them inside an account where gains are not taxed as they occur. The IRS retirement pages set the contribution limits: for 2026 the 401(k) elective deferral limit is $24,500, up from $23,500 in 2025, and the IRA limit is $7,500, up from $7,000, with additional catch-up amounts for those aged 50 and over. Traditional accounts defer tax until withdrawal, when it is ordinary income; Roth accounts are funded with after-tax money and qualified withdrawals are tax-free. Inside either, the holding period of an individual trade does not matter, which makes them the natural home for a short-term strategy, subject to the accounts' own rules on margin, options and withdrawals.

Other Timing Tools

  • Harvest losses against short-term gains first. Because short-term losses net against short-term gains before anything else, a realized loss is worth most when it offsets gain that would otherwise be taxed at the ordinary rate. Observe the wash sale window when re-entering.
  • Spread large gains across years. The 0% and 15% thresholds apply to taxable income in each year, so realizing part of a gain in December and part in January can keep more of it below a threshold.
  • Donate appreciated shares rather than cash. Publication 526 explains that a contribution of capital gain property held more than one year is generally deductible at fair market value, subject to a percentage-of-income limit, and the unrealized gain is never taxed. Shares held one year or less do not qualify for this treatment.
  • Check the record before selling. The IRS record-keeping page requires records connected to property to be kept until the limitations period expires for the year of sale, and the basis and acquisition date in those records are what determine whether a sale is short-term or long-term.

Where Quant Charts Fits

Quant Charts does not prepare taxes or classify gains, and no LuxAlgo tool places orders. What it adds is visibility of the one number this article turns on, the age of each position, at the moment the decision to sell is being made. The Journal in Quant Charts is included on every plan and lives on your account rather than in a workspace.

See each position's age. The Journal stores fills and rebuilds round trips from them. A trade's detail view shows when it was opened and closed and its duration, and open positions carry their entry date, so the day a position crosses the one-year line is visible in the same place as the chart. The Breakdown page groups net results into hold-time buckets, which shows whether a strategy's profits are coming from positions that would be taxed as short-term or long-term if they were closed today.

Quant Charts Journal calendar view showing realized results by trading day
The Journal calendar shows realized results by day, which is where a sale's date, and its distance from the 30-day wash sale window, can be checked.

Track the wash sale window. Because the Journal records the date and time of every fill, a loss taken on one day and a re-entry in the following weeks are both on the calendar. The rule is 30 days on either side of the loss sale; the calendar makes the count a matter of looking rather than remembering.

Quant Charts Journal dashboard with net profit and loss, win rate, profit factor, equity curve and drawdown for a selected date range
The Journal dashboard totals results for Today, Week, Month, Year, YTD, All or a custom range, so a tax year can be reviewed on its own.

The video below shows how a watchlist is created in Quant Charts.

Creating a watchlist in Quant Charts.

Treat holding period as a design input. When you describe a rule to Quant, our coding agent, in plain language, inspect the Pine Script under Code and click Run, the Backtest Summary reports net profit, trade count, win rate, max drawdown and profit factor for hypothetical trades that create no tax events. The trade count and the test period together give the average holding period, and a rule that turns over its positions every few weeks will produce short-term results in a taxable account no matter how good the backtest looks. Comparing two versions of a rule, one with a longer minimum hold, with commission and slippage set in the strategy's Properties, is a fair way to see what the lower rate costs in strategy performance before deciding where the strategy should live.

FAQs

What is the difference between short-term and long-term capital gains?

A gain or loss on property held more than one year is long-term and may be taxed at 0%, 15% or 20% depending on taxable income. Property held one year or less produces a short-term gain or loss taxed as ordinary income. The IRS counts from the day after acquisition through the day of sale.

How exactly is one year counted?

Publication 550 starts the count on the day after you acquire the asset and includes the day you sell it. Its example: bought January 31, 2024 and sold January 29, 2025 is short-term; sold February 6, 2025 is long-term. A sale on the one-year anniversary is still short-term.

Can losses offset gains?

Yes. Short-term losses net against short-term gains and long-term against long-term, then the categories combine. If losses exceed gains, up to $3,000 a year ($1,500 married filing separately) offsets other income and the rest carries forward.

What is a wash sale?

Selling stock or securities at a loss and buying substantially identical ones within 30 days before or after the sale, including in an IRA or through an option. The loss is disallowed and added to the basis of the replacement shares, and the old holding period carries over, unless the purchase was in an IRA, where the loss is lost.

Can a day trader avoid the wash sale rule?

Only a taxpayer who qualifies as a trader in securities under Tax Topic 429 and makes a timely mark-to-market election under section 475(f). Gains and losses then become ordinary and are reported on Form 4797, the capital loss limit and wash sale rule no longer apply, and the lower long-term rates are given up on trading positions.

How does Quant Charts help with holding periods?

The Journal records every fill with its date and time, shows each round trip's duration, and groups results by hold time and by day on a calendar, so a position's age and its distance from a loss sale are visible before you act. Quant backtests are hypothetical and create no tax events.

References

LuxAlgo Resources

External Resources

Learn to trade smarter.

Market analysis and techniques that build your edge, one email a week.

Don’t worry, no spam here. See our privacy policy for more info.

Alex Pierrefeu
Alex Pierrefeu

CPO & Co-founder at LuxAlgo. 7+ years background of developing technical trading tools, Alex is one of the very few highlighted "Pine Script Wizards" on TradingView.

Read next