As the bull market sets its sights on its tenth year, companies are finally starting to spend more.

Throughout this bull market, capex has remained a "missing link," said BofA/Merrill Lynch analysts in a Jan. 2 note. But now, S&P 500 capex guidance is well above its historical average and optimism abounds.

Companies are planning to spend more, analysts said. The three-month ratio of above -- versus below -- consensus capex guidance is at 1.74. While that's slightly lower than last month's 1.85 ratio reading, it remains near its highest level in more than three years.

"Capex has been a missing link during this bull market, and a pickup in demand, clarity on tax policy and signs of tighter capacity could unleash a pickup from low levels," Merrill Lynch said.

Aside from capex, firm management remains more optimistic than analysts on earnings. The three-month ratio of above -- versus below -- consensus earnings guidance is near a seven-year high at 1.22, up from 1.15 and double its historical average of 0.64, analysts wrote.

More of What's Trending on TheStreet:

More from Stocks

UnitedHealth Could Strike Deal for Tenet's Conifer Subsidiary: Reports

UnitedHealth Could Strike Deal for Tenet's Conifer Subsidiary: Reports

One Chart Will Make You Even More Pumped Up to Buy Tech Stocks

One Chart Will Make You Even More Pumped Up to Buy Tech Stocks

Google Shares Shrug Off $5 Billion EU Fine Against Alphabet

Google Shares Shrug Off $5 Billion EU Fine Against Alphabet

Jim Cramer's Biggest Moments From Delivering Alpha

Jim Cramer's Biggest Moments From Delivering Alpha

The Recent Pullback in the Defense Sector Provides a Buying Opportunity

The Recent Pullback in the Defense Sector Provides a Buying Opportunity