The S&P 500 index rose to a three-week high on Tuesday, led by Apple, Amazon, Facebook and industrial shares on the hope that the U.S. and China will end their trade war.

The three-day rally, that began on Friday following the jobs data and dovish comments from Federal Reserve head Jerome Powell, has the S&P 500 index up by over 9 percent from 20-month lows touched around Christmas.

The United States and China will extend trade talks in Beijing for an unscheduled third day, a member of the U.S. delegation said, as the world’s two largest economies looked to resolve their bitter trade dispute. So far, officials from both sides have sounded optimistic, with President Donald Trump saying talks were going well.

The trade-sensitive S&P industrials sector rose 1.41 percent. Boeing ended the trading day with a gain of 3.79 percent, contributing heavily to the rise of the Dow Jones Industrial Average, after the company said it had delivered a record 806 aircraft in 2018.

Apple was up 1.91 percent, regaining some ground after the company last week warned of weaker-than-expected demand for its iPhones. But tech sector gains were limited by a decline in chip stocks after Samsung noted that it is estimating a 29 percent decline in quarterly earnings due to weak chip demand.

The Philadelphia Semiconductor index fell 0.49 percent. Adding to the woes, Goldman Sachs forecast a tough year for chipmakers, particularly in the first half. However, other investors remained upbeat about upcoming U.S. quarterly results.

The communication services index rose 1.58 percent, with Facebook adding 3.25 percent after JPMorgan said the social media company was among its favorite internet picks for 2019.

Amazon rose 1.66 percent, increasing its market capitalization to $810 billion and cementing its position as the most valuable domestic company. The financials index was the only S&P index not to gain, ending unchanged as the U.S. Treasury yield curve flattened.

PG&E continued to decline, falling 7.34 percent after S&P Global Ratings stripped the California power utility of its investment-grade credit rating, while Union Pacific rose 8.73 percent after the largest domestic railroad selected industry veteran Jim Vena to be its next chief operating officer.

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

Job Openings Fall

Job openings fell in November, pulled down by sharp declines in construction and other services, but did little to change views that the economy is facing a shortage of workers. A measure of labor demand, openings fell by 243,000 openings to a seasonally adjusted 6.9 million openings, the Labor Department said in its monthly Job Openings and Labor Turnover Survey, or JOLTS, on Tuesday. 

Despite November’s drop, job openings outpaced the number of unemployed people that month by 870,000. Job openings hit a record high of 7.3 million in August. The decline in job openings in November was led by a 66,000 drop in the other services category.

Construction vacancies fell 45,000. The decrease in job openings in November was concentrated in the West region. However, there were increases in vacancies in the transportation, warehousing, and utilities sector as well as finance and insurance, and education and health services.

The job openings rate slipped to 4.4 percent from 4.5 percent in October. Hiring declined 218,000 to 5.7 million in November. The hiring rate fell to 3.8 percent from 4.0 percent in October.

Anecdotal evidence has been growing of companies experiencing difficulties finding workers, a phenomenon that economists expect will slow down job growth this year. A survey from the National Federation of Independent Business (NFIB) on Tuesday indicated the share of small business owners reporting job openings they could not fill surged five points to a record high of 39 percent in December. Most of these vacancies were in manufacturing.

The JOLTS report indicated that the number of workers voluntarily quitting their jobs fell by 112,000 workers to 3.4 million in November. The quits rate, which policymakers and economists view as a measure of job market confidence, was unchanged at 2.3 percent.

Some economists said the steady quits rate suggested moderate wage inflation, which could make the Federal Reserve cautious about raising interest rates too high this year.

Layoffs were little changed at 1.8 million in November, holding the layoffs rate at 1.2 percent for a second straight month.