There was a bit of green on the trading floor on Wednesday as optimism over a series of upbeat earnings took hold but was nearly offset by jitters over rising bond yields and corporate costs.

The S&P 500 and the Dow Jones Industrial Average chalked up gains after a choppy session, with the Dow ending a five-day losing streak, but the Nasdaq posted its fifth straight loss, weighed down by technology stocks.

The 10-year Treasury yield, a benchmark for global borrowing costs, finished above 3 percent as the supply of government debt surged due to a revenue shortfall following the massive tax overhaul.

Shares of Boeing ended the regular trading day up 4.2 percent after the company posted better-than-expected earrings amid strong commercial airliner sales, leading it to raise its forecasts after a record 2017.

Twitter closed out the day down 2.4percent after the company said it expects a slowdown in revenue growth and increasing costs, putting a damper on its otherwise upbeat earnings report.

On Tuesday, Caterpillar fell 6.2 percent despite exceeding earnings expectations, due to the company’s warning of higher costs.

Facebook was up in after-market trading after reporting revenue that exceeded Street expectations.

Comcast rose 2.7 percent it confirmed its $31 billion bid for Sky on the heels of a better-than-expected earnings report.

So far, 31 percent of S&P 500 companies have reported earnings, 81.2 percent of which came in above consensus estimates. The expectation now is for first-quarter earnings growth of 22 percent over the same period a year ago, according to Thomson Reuters data.

Of the 11 major S&P 500 sector indexes, Real Estate, Technology, and Financials ended the session in negative territory.

Approximately 6.67 billion shares changed hands on the major domestic equity exchanges, as compared to the 6.75 billion share average over the past 20 trading days