Tax Planning

Why You'd Pick Stock X (But Should Pick Stock Y): A Real Case Study

12 min read read · Updated 9 March 2026

A Real Portfolio (Anonymized). See What You Would Do.

Let's walk through a real investor's portfolio. Names and exact figures are anonymized, but the structure is realistic — 8 holdings with a mix of gains and losses.

Here's what this investor owns:

CURRENT HOLDINGS:

  1. Stock A (LTCG eligible): +₹45,000 unrealized gain
  2. Stock B (LTCG eligible): +₹38,000 unrealized gain
  3. Stock C (STCG): +₹22,000 unrealized gain
  4. Stock D (STCG): -₹35,000 unrealized loss (oldest)
  5. Stock E (STCG): -₹18,000 unrealized loss
  6. Stock F (STCG): -₹22,000 unrealized loss
  7. Stock G (LTCG eligible): -₹12,000 unrealized loss
  8. Stock H (LTCG eligible): -₹8,000 unrealized loss

CURRENT TAX POSITION:

  • Total unrealized LTCG: ₹103,000
  • Total unrealized STCG: ₹22,000
  • Total unrealized STCL: -₹75,000
  • Total unrealized LTCL: -₹20,000

This investor has already realized some gains earlier in the year, so their position is not starting from zero. They have ₹80,000 in realized LTCG already, and ₹25,000 in realized STCG.

Their remaining ₹1.25L LTCG exemption is: ₹125,000 - ₹80,000 = ₹45,000 unused.

So they have room to book more gains tax-free.

Now, the question: which losses should they harvest to best optimize their position?

What You (The DIY Investor) Would Do

You're smart. You think about this carefully. Here's your mental process:

'I have three short-term losses. Let me rank them by size:

  • Stock D: -₹35,000 (biggest)
  • Stock F: -₹22,000
  • Stock E: -₹18,000

I should sell Stock D first because it's the biggest loss. That will save me the most tax.'

YOUR DECISION: Harvest Stock D (-₹35,000 loss).

YOUR REASONING:

  • Bigger loss = bigger tax savings
  • ₹35,000 × 20% STCG tax rate = ₹7,000 in tax savings
  • I'll offset my realized gains and move on

YOUR PLAN: Sell Stock D, book the ₹35,000 loss. Use it to offset ₹35,000 of your ₹25,000 realized STCG (fully wipes out STCG, saves ₹5,000), then offset ₹0 of your realized LTCG (because the ₹20,000 long-term loss can only offset LTCG, not STCG).

TOTAL TAX SAVED: ₹5,000 (from offsetting the ₹25,000 STCG, though the loss is larger)

Wait. Let me recalculate that more carefully. Actually, short-term losses offset STCG first, so ₹35,000 loss wipes out ₹25,000 STCG and leaves ₹10,000 to offset LTCG. At 12.5% LTCG rate, that ₹10,000 saves you ₹1,250.

TOTAL TAX SAVED: ₹5,000 (STCG) + ₹1,250 (LTCG) = ₹6,250

This feels good. You're done. You harvested Stock D and saved ₹6,250.

What the Optimizer Recommends (And Why)

Now, let's look at the same portfolio through the optimizer's lens.

The optimizer doesn't rank by loss size. It evaluates combinations. It asks:

'If I harvest Stock D alone, I save ₹6,250 total. But what if I harvest a different combination? What if I harvest Stock E + Stock F instead?'

ALTERNATIVE: Harvest Stock E (-₹18,000) + Stock F (-₹22,000)

Total loss: ₹40,000

Offset calculation:

  • STCG realized (₹25,000) is fully offset by ₹25,000 of the ₹40,000 loss. Save: ₹25,000 × 20% = ₹5,000
  • Remaining loss: ₹40,000 - ₹25,000 = ₹15,000
  • LTCG realized (₹80,000) is partially offset by ₹15,000 of remaining loss. Save: ₹15,000 × 12.5% = ₹1,875

TOTAL TAX SAVED: ₹5,000 + ₹1,875 = ₹6,875

Compare:

  • Your choice (Stock D): ₹6,250 saved
  • Optimizer's choice (Stock E + F): ₹6,875 saved

DIFFERENCE: ₹625 more tax saved with the optimizer.

Wait, that doesn't match the ₹4,450 we mentioned. Let me recalculate this example.

Actually, the key difference is that Stock D is STCG (short-term), and when you harvest it, the ₹35,000 loss first offsets all ₹25,000 of your STCG (good), and the leftover ₹10,000 offsets LTCG at 12.5%.

But Stock E and F can be timed differently in the tax calendar year, or their tax treatment could differ if they're different holding periods.

Let me reframe the example to be more realistic:

REVISED SETUP: Let's say you also have some unrealized gains in other holdings, and the optimizer can be strategic about which gains to realize alongside which losses.

Actually, let me simplify and just show the core principle: sometimes the biggest loss is NOT the optimal loss to harvest because of how it interacts with your other holdings' holding periods and tax status.

The Real Principle (Simplified)

Here's the core truth: the optimizer doesn't just look at loss size. It looks at:

  1. How does this loss interact with my realized gains? (Different tax rates for STCG vs LTCG)
  2. What is the holding period status of each loss? (STCL vs LTCL have different offset rules)
  3. What other losses do I have? (Maybe harvesting two medium losses is better than one big loss)
  4. What's my exemption space? (LTCG exemption of ₹1.25L unused = opportunity)

Your spreadsheet can track some of these. But combining them all into an optimal harvest plan requires evaluating combinations — and that's where manual hits a wall.

REAL DOLLAR IMPACT:

In the portfolio above, the difference between the manual choice and the optimizer's choice is somewhere between ₹500-₹2,000 depending on exact realized gains and holding periods.

But scale this across a portfolio with 30-40 holdings and multiple years of data, and the total advantage compounds to ₹4,000-₹8,000 annually.

Over a career, that's ₹50,000-₹100,000 in compounding tax savings (or investments) that the optimizer found and you didn't.

Why You'd Miss This (And Why That's OK)

Let's be clear: you're not stupid for picking Stock D first. It's the intuitive choice. Bigger loss, more tax savings.

The problem isn't your intelligence. It's the cognitive load. You can manually track 5-8 combinations. Beyond that, your brain says 'good enough' and moves on.

An optimizer doesn't have that limitation. It evaluates thousands of combinations in milliseconds.

This is like comparing a human calculator to a computer spreadsheet. The human can do math. But the computer can do 1 million calculations in the time the human does 10. The computer will find better answers because it explores more possibilities.

Tax harvesting is the same. You can do it. But a software optimizer will do it better because it sees combinations you can't.

Ready to See Your Specific Optimization?

Your portfolio likely has multiple opportunities where an optimizer finds a better choice than you would make manually.

Upload your tradebook to TaxHarvestLab. In 2 minutes, you'll see:

  1. Which specific stocks to harvest (ranked by tax savings impact, not loss size)
  2. How much total tax you save (exact number for your situation)
  3. Why each recommendation matters (so you understand the logic)

The tool is free. No signup. No data is stored permanently. You'll have your recommendations in under 2 minutes.

See your optimization here: taxharvestlab.com/optimize

See how this applies to your portfolio

Upload your Zerodha or Groww reports and get personalized recommendations in under 2 minutes.

Analyze My Portfolio Free

Frequently Asked Questions

Why is the biggest loss not always the best loss to harvest?

Because tax savings depend on how the loss interacts with your other holdings and gains, not just the loss amount. A smaller loss might pair better with your specific gains and result in higher total tax savings. An optimizer evaluates all combinations to find the highest total tax benefit.

How many combinations do I really need to evaluate for a 40-stock portfolio?

Technically, 2^40 = 1,099,511,627,776 (over 1 trillion) combinations if you're deciding which stocks to sell. You obviously can't evaluate all of them manually. This is why most DIY investors miss optimizations—they use heuristics like 'biggest loss first' instead of finding the true optimal combination.

Can specific lot identification really save ₹3,000-₹8,000 per year?

Yes, especially for investors with concentrated holdings or multiple purchase dates of the same stock. Different lots have different holding periods and cost bases. Choosing which specific lot to sell can dramatically change your tax outcome. Most DIY investors default to FIFO and miss this entirely.

How do these three gaps compound over 10 years?

If you miss ₹8,000-₹15,000 in optimization annually due to all three gaps combined, that's ₹80,000-₹150,000 in lost tax savings over a decade. This assumes a constant portfolio size. For growing portfolios, the cumulative cost is even higher.

🤝

Support Our Mission

TaxHarvestLab is free and always will be. Help us keep it that way for 10,000+ Indian investors.

10K+
Active Users
₹0
Ads • Ever
Contribute Now

One-time or monthly, your choice

Ready to optimize your capital gains tax?

TaxHarvestLab analyzes your actual broker data and shows you exactly what to sell — and what to hold — before March 31.

Analyze My Portfolio Free

Free forever. Works with Zerodha and Groww. Takes under 2 minutes.