New York CNN Business  — 

US stocks finished off the year – and the decade – on a high note.

2019 was the second best year of the decade for stocks, thanks to favorable Federal Reserve policy and company valuations that kept on climbing. Even as the trade war with China and other US trade partners injected plenty of volatility into the market, stocks ended up on top.

The S&P 500 (SPX) gained 28.9%, and the Nasdaq Composite (COMP) rose 35.2%. It was the second-best year of the decade for both indexes. Only 2013 was stronger.

2019 was the third best year of the past ten years for the Dow (INDU), which gained 22.3%.

All three indexes were sluggish in the final trading days of the year as investors took profit and unwound their positions. On New Year’s Eve, they each finished up 0.3%.

Trade tensions dragged stocks at times during the year, but they rallied as signs pointed toward a resolution. President Donald Trump announced Tuesday that a “phase one” US-China trade deal will be signed on January 15. That didn’t jolt stocks much, as the preliminary agreement was already priced in.

Stocks also rebounded in 2019 because the Federal Reserve cut interest rates three times this year to stimulate economic growth. The dramatic gains this year “speak to the wonders of cheap money,” wrote Societe Generale Strategist Kit Juckes.

Advanced Micro Devices (AMD) is set to take the crown as best-performing S&P 500 stock of 2019. Shares of the chipmaker rose 146.6% this year.

The top three best-performing stocks are part of the semiconductor industry: In addition to AMD, Lam Research (LRCX) rose 114.8% and KLA Corporation (KLAC)’s stock climbed 99.3%.