U.S. stocks, which began 2019 in the wake of a volatile, down-ticking 2018, roared to new heights, continuing the unprecedented 10-year run of the bull market.

That is thanks to better-than-expected corporate earnings, gushing federal spending and low interest rates.

The S&P 500 index of America's 500 largest companies rose 31% last year and 52.7% since January 2017.

"We climbed a wall of worry, from a growth slowdown and profits flat at best, trade concerns, potential impeachment, and high valuations bothering investors — including myself," Ned Davis of Ned Davis Research, told investors in a note last week.

Stocks surged in 2019 despite the ongoing U.S.-China trade war. The Federal Reserve cut rates three times as unemployment remained low and consumer sentiment remained high. Trade tensions also declined in the fourth quarter after China and the U.S. agreed to sign a tentative "phase one" trade deal about which each is making claims disputed by the other.

Huge tech companies led the 2019 rally, including Apple and Microsoft; up 86% and 55%, respectively. They alone accounted for about 15% of the S&P 500's gain.

Chipmakers Advanced Micro Devices, Lam Research and KLA Corp. were the best-performing S&P 500 stocks in 2019. AMD and Lam Research both rose more than 100% during the year. Resurgent Minneapolis-based retailer Target and fast-casual dining chain Chipotle Mexican Grill also rallied more than 90%.

The Piper Jaffray Minnesota index of 68 state companies, stocks worth at least $3 per share, didn't fare as well last year. The Piper index was up 21.6% for the year and 19.4% since 2017. Minnesota has proportionately fewer huge tech-and-finance companies that were the rage nationally. More than 50 of the 68 Minnesota stocks finished in positive territory last year.

The 2019 state list was led by Communications Systems of Minnetonka, which rose more than 209% in value. The relatively small company, with a market value of $56 million, is still trading well below its 2015 highs. After four money-losing years, CSI has bounced back to nearly a $5 million profit on revenue of $50 million during the first nine months of 2019.

The big 2019 meant that Communications shareholders have seen a three-year return of 46%.

Communications Systems was started a couple generations ago by Minnesota-telecom entrepreneur Curt Sampson of Hector. It makes and sells connectivity products for broadband and voice communications throughout North America, Europe, the Middle East and Africa.

Med-tech firm Tactile Systems, which was up 48% in 2019, has been the best Minnesota stock to own over the last three years with a total return of 310%.

CEO Jerry Mattys runs one of the country's best-performing post-initial public offerings among med-tech firms.

Tactile went public in 2016, the same year as the FDA cleared Tactile to launch its at-home treatment for lymphedema, which the company has demonstrated is as effective and a lot less costly than in-hospital treatment and stays.

Tactile is valued at about $1.3 billion.

Inspire Medical Systems, worth about $1.8 billion, has been another winner since it went public in 2018. The stock has run from $25 per share in 2018 to around $75 recently, an all-time high. Inspire rose 74% last year.

Inspire makes an implantable medical device that treats obstructive sleep apnea, or OSA. The National Institutes of Health said as many as 12 million Americans have OSA, a condition that can lead to high blood pressure, heart disease, excessive daytime sleepiness and mood disorders.

The mainline medical treatment for OSA is typically to wear a continuous positive airway pressure mask at night, but many users don't find success with that system. Inspire's system, implanted under the skin, uses a pacemaker-like device to monitor a person's breathing and administer mild electrical stimulation to the hypoglossal nerve, which controls the movement of the tongue and other muscles to keep an open airway.

Ceridian, the human resources software company and a one-time Control Data spinoff that went private 15 years ago, became one of Minnesota's largest-ever IPOs in 2018, raising $462 million. The stock has been a great performer since, rising 97% in value last year. The Bloomington-based company priced its initial stock at $22 a share. It's just under $70 lately.

Ceridian's principal product, Dayforce, provides payroll, benefits and workforce-and-talent management services to more than 3,000 customers. The cloud-based platform is designed to ease the administrative work of customers and their employees.

Ceridian went private in 2007 when it sold itself for $5.3 billion to affiliates of private-equity firms Thomas H. Lee Partners and Cannae Holdings. In subsequent years, it has remade itself around the Dayforce product that Ceridian acquired in 2012.

Digi International, the maker of things that connect machines to the internet and related software, made a long-anticipated turnaround this year, propelling the Hopkins-based company to a 79% return, No. 5, on the Piper index.

Among the worst local companies to own over the last year were BBQ Holdings, parent of Famous Dave's; Surmodics, NVE Corp., Ikonics and IntriCon, all down by at least 30% in value.

Where is the market headed in 2020?

Depending on which "highly trained, experienced Wall Street expert you ask," the answer will be stocks are going up, down, or nowhere, was the decidedly mixed consensus Friday from the commentators at Yahoo! Finance.

"Uncharted Waters!" Jim Paulsen, the veteran investment strategist at Leuthold Group, said in a Thursday note to investors.

Paulsen was optimistic early on a decade ago, as the federal government and Federal Reserve moved to stimulate the economy, and the market rewarded patient-and-new investors by hitting new highs by 2013. It's up 300%-plus over the last decade.

Paulsen noted that U.S. profits and the global economic momentum indicate improvement. He's worried about rising U.S. budget deficits and other potential drags.

"This does truly feel like a brave new world," Paulsen wrote. "And, most frighteningly, one in which tried-and-true rules of old seemingly no longer apply. So, we enter 2020 without trusted guideposts to help point us toward profitable investments.

"Undoubtedly, risks are much higher today than earlier in this recovery — both for economic expansion and for stocks and bonds.''