The S&P 500 and Nasdaq hit record highs on Wednesday after reassuring comments from Texas Instruments about global chip demand blunted the impact of weak earnings reports from Boeing and Caterpillar.

Texas Instruments closed out the trading day with a gain of 7.4% after the company indicated that a global slowdown in microchip demand would not be as bad as previously thought, sending the Philadelphia chip index up 3.1% to a record high.

Caterpillar fell 4.5% following disappointing earnings on weak sales in China and higher production and restructuring costs.

Boeing was down 3.1% after the company posted its largest-ever quarterly loss on the back of this year’s grounding of its best-selling 737 MAX. Those two companies’ bleak reports left the Dow Jones Industrial Average in negative territory.

Two weeks into an earnings season with less than ecstatic investor expectations, about 77% of the 138 S&P 500 companies that have reported so far have topped earnings estimates, according to Refinitiv data.

Overall earnings per share, however, are now expected to fall 0.1%, compared with a prior estimate of a rise of about 1%.

Wall Street has hit record levels in July on bets the Federal Reserve will lower rates next week to counter the impact of a protracted U.S.-China trade war on economic growth. The S&P 500 and Nasdaq each closed at their highest levels ever. For the year, the S&P 500 is now up 20%, while the Nasdaq has gained 25%.

In after hours trading, Facebook rose 4.3% after the company posted quarterly revenue numbers that exceeded consensus estimates.

United Parcel Service was up 8.7% and among the largest gainers on the S&P 500 index, after the company reported a better-than-expected quarterly earnings number.

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

Day’s Economic News

Sales of new single-family homes recovered in June, but sales for the prior three months were revised downward, indicating that the housing market continued to tread water despite lower mortgage rates and a strong labor market.

Other data on Wednesday indicated manufacturing activity slowing to a near 10-year low in early July, with production volumes and purchases falling. Weak housing and manufacturing are offsetting strong consumer spending, holding back the economy and posing a threat to the longest expansion in history.

Worries about slowing growth, especially tied to trade tensions between the United States and China, and weakness overseas are likely to encourage the Federal Reserve to cut interest rates next Wednesday for the first time in a decade.

The Commerce Department reported on Wednesday that new home sales rebounded 7.0% to a seasonally adjusted annual rate of 646,000 units last month. May’s sales pace was revised down to 604,000 units from the previously reported 626,000 units.

Data for March and April was also revised downward. New home sales are drawn from permits and tend to be volatile on a month-to-month basis. Sales increased 4.5% from a year ago.

The 30-year fixed mortgage rate has dropped to an average of 3.81% from a more than seven-year peak of 4.94% in November, according to data from mortgage finance agency Freddie Mac.

New home sales in the South, which accounts for the bulk of transactions, rose 0.3% in June to a 13-month high. Sales in the Midwest dropped 26.3% to their lowest level since September 2015. Sales in the West rebounded 50.4%, the largest gain since August 2010, more than recouping May’s 38.5% decline. In the Northeast, sales dropped for the second straight month, hitting their lowest level in eight months.

While cheaper mortgage rates and the lowest unemployment rate in nearly 50 years are supporting demand for housing, expensive materials and land and labor shortages are constraining builders’ ability to produce sought after lower-priced homes. The median new house price was unchanged at $310,400 in June from a year ago. There were 338,000 new homes on the market last month, up 0.6% from May.

The housing market hit a soft patch last year and has since struggled to gain traction, with residential investment contracting for five straight quarters. A report on Tuesday showed home resales fell in June as tight supply pushed previously owned house prices to a record high.

While single-family homebuilding rebounded in June, permits increased moderately and continued to lag housing starts. June’s largely weak housing data means that residential investment contracted again in the second quarter, contributing to an expected slowdown in economic growth last quarter.

The government will publish its snapshot of second-quarter GDP on Friday.

The earnings reports from Caterpillar and Boeing underscore the manufacturing sector’s struggles. In a separate report on Wednesday, data firm IHS Markit said its Flash manufacturing PMI slipped to a reading of 50.0 in July, the lowest since September 2009, from 50.6 in June.

The reading is in line with the neutral 50.0 threshold, which IHS Markit said signaled stagnant manufacturing business conditions. 

Manufacturing, which accounts for about 12% of our economy, is being hobbled by an inventory overhang, especially in the automobile sector. The U.S.-China trade tensions and weak global demand are also undercutting the sector.

IHS Markit said while production levels dropped slightly early this month, the rate of decline was the largest since August 2009. It also noted that a decrease in factory employment had ended a six-year period of sustained job creation across the manufacturing sector.

The data firm said a downturn in the automotive sector and heightened global economic uncertainty were factors behind the loss of momentum in manufacturing early this month.