The S&P 500 index and the Nasdaq registered record closing highs after a broad-based rally on Tuesday, as a clutch of better-than-expected earnings reports eased concerns about a slowdown.

In Tuesday’s trading the S&P 500 finally erased all the steep losses it saw in late 2018 by ending the day above the previous record reached on September 20. It closed just 0.3 percent below its intra-day record of 2,940.91 reached on September 21.

The S&P is up 17 percent so far this year, with help from a dovish Federal Reserve and hopes of a U.S.-China trade resolution as well as the upbeat start to the first-quarter earnings season.

Earnings of S&P 500 companies are now expected to decline 1.3 percent in the first quarter, in what analysts say could be the first earnings contraction since 2016. However, forecasts have largely improved since the start of April.

Amazon will report results later this week, gained 2.2 percent, providing the largest boost to the S&P 500 and the Nasdaq.

Ten of the 11 major S&P sectors were higher, with a rebound in healthcare, which gained 1.6 percent, providing the largest enhancement. The healthcare sector has been slammed with 6.7 percent drop in the last two weeks on U.S. policy concerns.

The consumer staples sector was the only S&P sector that ended the day lower as investors favored riskier bets. The energy and utilities sectors were the next weakest performers on the day.

Twitter chalked up a gain of 15.6 percent after the social media company posted better-than-expected quarterly revenue and a surprise increase in monthly active users.

Hasbro Inc rose 14.2 percent after the toymaker reported a surprise quarterly earnings improvement.

Coca-Cola rose 1.7 percent after its quarterly sales exceeded estimates, helped in part by strong demand for Coke Zero.

Lockheed Martin rose 5.7 percent after it reported upbeat quarterly results and lifted its full-year earnings forecast on strong demand for its missiles and fighter jets.

United Technologies rose 2.3 percent after it raised its full-year earnings forecast.

Procter & Gamble fell 2.6 percent and was the largest drag on the market after reporting a decline in its third-quarter operating margin.

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

New Home Sales Up Sharply

The Commerce Department reported Tuesday morning that sales of new single-family homes increased to a near 1-1/2-year high in March, aided by lower mortgage rates and lower house prices.

According to the Department, new home sales increased 4.5 percent to a seasonally adjusted annual rate of 692,000 units last month, the highest level since November 2017.

It was the third straight monthly increase in new home sales. February’s sales pace was revised down to 662,000 units from the previously reported 667,000 units. New home sales account for about 11.7 percent of housing market sales.

New home sales are drawn from permits and tend to be volatile on a month-to-month basis. They increased 3.0 percent from a year ago. The median new house price dropped 9.7 percent to $302,700 in March from a year ago, the lowest level since February 2017.

However, they have not been severely impacted by the supply problems that have plagued the market for previously owned homes. A report on Monday showed home resales tumbled in March, weighed down by a persistent shortage of lower-priced houses.

Despite the broader housing market’s struggles with supply, the fundamentals for housing are improving. The 30-year fixed mortgage rate has dropped by about 80 basis points since November, according to data from mortgage finance agency Freddie Mac. That followed a recent decision by the Federal Reserve to suspend its three-year monetary policy tightening campaign.

In addition, house price inflation has slowed, and wage growth has picked up. Still, land and labor shortages are constraining builders’ ability to break more ground on lower- priced housing projects. Investment in homebuilding contracted 0.3 percent in 2018, the biggest drop since 2010.

New home sales in the South, which accounts for the bulk of transactions, increased 3.6 percent in March to their highest level since July 2007. Sales in the Midwest soared 17.6 percent, while those in the West surged 6.7 percent. But sales in the Northeast fell 22.2 percent.

There were 344,000 new homes on the market last month, down 0.3 percent from February. At March’s sales pace it would take 6.0 months to clear the supply of houses on the market, down from 6.3 months in February. Approximately 62 percent of the houses sold last month were either under construction or yet to be built.