Despite economic headwinds, there's reason to be hopeful that last quarter's bank earnings will be better than expected. Image source: iStock/Thinkstock.

There's reason to believe that the second quarter will turn out better for Bank of America (BAC -0.49%) than analysts expected.

Over the last few weeks, analysts have dropped their estimates for Bank of America's earnings per share by 8%. On Thursday, however, JPMorgan Chase (JPM -0.41%) beat expectations for the three months ended June 30. This bodes well for Bank of America, given the similarities between the banks' business lines.

The nation's biggest bank by assets earned $1.55 per share compared to the average analyst estimate of $1.43. JPMorgan Chase's EPS in the same quarter last year was $1.54.

The news triggered a broad rally in bank stocks. Shares of JPMorgan Chase were up 2%, while Bank of America's stock has gained 1.7% a little more than halfway through the trading day.

JPMorgan Chase's loan growth was particularly auspicious. Core loans grew by 16% over the year-ago period. This fueled a 6% increase in net interest income, which more than offset a 1% drop in the bank's noninterest income.

JPMorgan also saw trading revenue rise by 23% in the quarter. This didn't come as a surprise, given that the head of its investment bank predicted earlier in the quarter that income from trading would be up. However, given the turmoil in asset markets in the final week of June, following the United Kingdom's referendum to separate from the European Union, it was nevertheless welcome news.

The one area where JPMorgan Chase struggled was investment banking fees, which fell by 10% compared to the same period last year. This was driven by a 37% decline in equity-underwriting fees.

To be clear, Bank of America has a tough act to follow given that the second quarter of 2015 contained one of its best performances since the financial crisis. It earned $5.3 billion in the period last year, which will be hard for it to top in light of two developments.

The first is a $425 million fine announced by the Securities and Exchange Commission in June to "settle charges that [Merrill Lynch] misused customer cash to generate profits for the firm and failed to safeguard customer securities from the claims of its creditors." If the money hadn't already been set aside to cover the settlement, it will presumably hit Bank of America's bottom line.

The second is an accounting adjustment triggered by lower long-term interest rates. Because the yield on the 10-year Treasury headed down at the end of the quarter, and thanks to the way that Bank of America accounts for its net interest income, KBW expects the bank's second-quarter results to include a negative $950 million FAS 91 adjustment.

These developments aside, assuming that Bank of America's earnings come in ahead of expectations, the second quarter will mark another positive step in the bank's efforts to distance itself from the financial crisis. Most importantly, it passed this year's stress test last month and was given approval to raise its dividend and share buyback program, which it promptly did.

It could still be years before Bank of America generates the type of profitability that investors expect from a bank, but, as we will hopefully learn when the North Carolina-based bank reports its earnings next week, it's headed in the right direction.