Imagine the following: You, the investor, believe you have an uncanny skill at picking stocks. You set up an online trading account and begin to buy and sell.

As it turns out, you are quite good. You pour more money into your brokerage account and up your trading. After the first year, you look at your results: You have trounced the indexes. You snicker at your friends who invest passively in low-cost, low-turnover indexes.

You keep at it, year after year trouncing the Standard & Poor’s 500-stock index. Over the long haul, you beat that benchmark substantially — in some years, you gain 30, 40, even 50 percent more than the SPX gains. You track your returns in a spreadsheet to see just how well you have done.

Over 24 years, you tally up gains and losses. The markets are up, on average, about 9.3 percent annually. You, the World’s Greatest Trader, do much better — 40 percent better. That’s better than most of today’s hedge funds. It is certainly better than most average mom-and-pop investors.

How did you do vs. your friends the passive indexers?

About the same.

Wait, how on Earth is that possible? You trounced the indexes, you crushed the benchmarks, you are the greatest! How could this possibly happen?

In a word, taxes. Traders pay a healthy tax of 30 percent or more on short-term capital gains. (See spreadsheet at right). Effectively, you lose the benefits of compounding on one-third of those gains. Over time, this has a tremendous impact on your net returns.

Imagine that 24 years ago, your best friend invested $10,000 in the S&P 500 and held on through last year. He would have amassed $76,266. That number includes taxes paid annually on whatever dividends came his way at the highest taxable bracket.

Compare that with you, the World’s Greatest Trader. Had you put that $10,000 into a trading account that same year and annually crushed the S&P 500 by 400 basis points, you would have amassed an after-tax return of only $69,197.

In other words, your passive-index buddy would have beaten you, the World’s Greatest Trader, by about 10 percent. (Note that I am ignoring all of your trading costs.)

Now imagine the same sort of trading account; only this time, add in a retail stockbroker’s commission. The outcome is utterly absurd. (How are any of these folks still in business?)

The number-crunching for this analysis comes from Michael Batnick, whose blog is (humbly) called the Irrelevant Investor. He is also, not coincidentally, my firm’s director of research. When he first ran the numbers, he spent a few hours scratching his head in astonishment. We tried hard to pick holes in it. Sure, it’s well established that passive beats active most of the time before taxes. Once we added in the big slice of the pie to Uncle Sam, active trading began to look downright silly. Makes you wonder why anyone would engage in such a ridiculous hobby!

How can the big boys do this? Mutual firms and hedge funds have a huge advantage that you, the individual investor, do not. They are a business. As such, they pay taxes on their total net gains. Losing trades offset winning trades dollar for dollar. Their investors also pay taxes on their net returns (not on each winning trade). This is why they can get away with this sort of active trading. Their tax bite is much, much smaller.

As an individual investor, you get to carry forward a grand total of $3,000 a year in losses to offset those gains. Sizable portfolios in the 2008-2009 crash lost millions of dollars. Folks who sold at the bottom in 2009 lost anywhere from 40 to 60 percent. They’d better watch their blood pressure and cholesterol if they want to carry those financial crisis losses forward for the next 150 years or so.

Long-term investors who use an asset-allocation model have another advantage over active traders: tax-loss harvesting. It’s a product of the latest software innovations.

Even when it was being done previously (which it often wasn’t), it was an inefficient act of guesswork, as well as a commission-generating sales tool. Today, it’s a precise process to efficiently capture tax losses at the touch of a button.

How it works: Any asset-allocation portfolio will see various asset classes gain and lose relative to their model weighting (e.g., 60/40 stocks and bonds). It’s a good idea to rebalance quarterly. Rebalancing back to your original weightings has been shown to add 75 to 150 basis points of additional returns over the long term, at no additional cost or risk. It is the closest thing to a free lunch that Wall Street has to offer.

Thanks to new software, investors can harvest some of their tax losses to offset capital gains during the rebalancing process. I like the program iRebal, which was bought by TD Ameritrade in 2006. It is both powerful and flexible. But there are lots of others on the market, and if you use an online broker, you probably have access to one for little or no cost.

What about the World’s Greatest Trader? He has two choices: He can quit his job to open a hedge fund, or he can invest in an asset-allocation model using broad indexes or ETFs, rebalancing regularly.

The choice is his.

Next time: the World’s Greatest Market-Timer.

Ritholtz is chief investment officer of Ritholtz Wealth Management. He is the author of “Bailout Nation” and runs a finance blog, the Big Picture. Twitter: @Ritholtz.