Strategists at Bank of America Merrill Lynch on Monday raised their 2018 and 2019 S&P 500 earnings forecasts, joining market observers who remain optimistic even as the drumbeat of a trade war echoes in the distance.

Equity and quant strategist Jill Carey Hall and her colleagues now expect S&P 500 earnings per share at $159 this year, a 4% rise from their previous forecast of $153. The projection stands 20% higher than 2017 EPS for the index and comes on the back of stronger oil prices and robust economic growth, including upbeat jobs data. The team lifted its 2019 EPS view by 6% to $170 from $161.

“Higher oil prices are a benefit to S&P 500 EPS, where much of the index either produces commodities or supplies commodity producers,” said Hall in a report.

Bank of America’s commodity strategists project WTI crude oil

CLQ8, +0.15%

the U.S. benchmark, and Brent oil

LCOU8, +1.39%

the international marker, to average $65 to $70 a barrel in 2018, roughly 25% higher than initially forecast earlier this year.

“Nearly 40% of the boost to our earnings forecasts both this year and next year comes from energy,” said Hall.

The U.S. economy is also expanding at a faster pace than expected, with Bank of America economists projecting 2018 gross domestic product gaining at a clip of 3%, 0.1 percentage point higher than the previous forecast. A one percentage point increase in GDP boosts EPS growth by around 3 percentage points, according to the strategists.

For now, Bank of America economists believe the impact of Trump administration tariffs implemented so far is likely to be limited. But if tensions escalate and the situation worsens, earnings are likely to be adversely affected, they said.

Read: Washington’s ‘political climate’ seen as the biggest risk to stocks, survey says

“We’ve estimated that a 10% rise in import costs—assuming a small drop in foreign sales—would reduce S&P 500 EPS by 3-4%. But a larger risk is if global growth suffers,” Hall wrote.

In late June, Bank of America projected second-quarter EPS to rise more than 20% year on year to $39.75, while sales were expected to increase 8% year on year.

Higher earnings will be a boon for the stock market, which has comparatively underperformed this year compared to 2017. Still, strategists on Wall Street have largely remained upbeat with both JPMorgan Chase & Co. and Citigroup recently issuing commentaries that support further buying of equities.