Traders work on the floor of the New York Stock Exchange on June 8, 2017 in New York.

Tax deadlines have historically helped boost one group of stocks heading into the last few months of the year, according to analysis from Bank of America Merrill Lynch.

Stocks that drop at least 10 percent in the first 10 months of any given year are candidates for what's known as "tax-loss harvesting." Mutual funds have an Oct. 31 deadline to sell, or "harvest," any beaten-down stocks in order to offset gains in other investments and reduce tax liabilities.

Since 1986, stocks that fit the "tax-loss harvesting" criteria subsequently rose by an average of 5.1 percent in the three months following that deadline, according to BofAML. The uptick is higher than the 's average return of 3.7 percent in the same period, with a hit rate of 69 percent.

"In a year characterized by volatility and reversals, the next catalyst may be tax loss harvesting," BofAML equity strategist Savita Subramanian said in a note to clients Monday. "On a monthly basis, this strategy tends to have the highest median returns in November and January, perhaps benefiting from the rebound after the October 31 deadline for tax loss selling for mutual funds and then the rebound after the December 31 deadline for regular tax filers."

From 2000 through 2012, tax loss candidates, or "TLCs" as Subramanian calls them, from November to January outperformed the market every year except for 2007.

While the strategy averages solid returns across three months, it has historically underperformed the S&P 500 in "seasonally strong" December alone, which Subramanian said is when other investors do much of their tax-loss selling.

To be sure, the strategy didn't work from 2013 through 2015, when it was "overshadowed" by year-end macro factors like a government shutdown, the end of OPEC price support and central bank policy. The TLC stocks have outperformed for the end of 2016 through 2017.

BofAML screened the S&P 500 for stocks with year-to-date price declines greater than 10 percent as of Oct. 31 and compiled a list of stocks rated as "buy." Names from all 11 sectors show up, but financials and consumer discretionary were the most common. Subramanian listed AT&T, BlackRock, 3M, Facebook, Wells Fargo and Goldman Sachs among the "buys."