Stocks snapped their losing streak Friday as Donald Trump took the oath of office for President of the United States.

The Dow Jones industrial average Friday closed up 95 points, or 0.5%, to 19,827 preventing what would have been the sixth-straight down day in a row. The gains pushed the Dow back into the plus column for the year.

The Trump rally had been losing its gusto ahead of the inauguration as investors worried actual policy changes when the administration begins might be less stimulative than hoped. All three major market measures, the Dow, the Standard & Poor's 500 index and the Nasdaq Composite, are down 0.3%, 0.2%, and 0.4%, for the week, respectively.

That's why the strength Friday came as a relief. The Standard & Poor’s 500 index was up 0.3% to 2271, just shy of its record closing high of 2276.98 notched Jan. 6. The Nasdaq composite index was up 0.3% to 5,555 as it moved back closer to its record close of 5574.12.

Despite Friday's gains, it was overall a negative week for stocks as investors fretted over what Trump might say in his inauguration speech regarding trade and government spending. Investors have been trying to price in the positives of lower tax rates and fiscal stimulation in the form of government infrastructure projects, but also the negatives of trade restrictions and tariffs.

Such uncertainty is a reminder to investors trying to time this kind of change is perilous.

"This bull market has room to run for a few months, I think most investors should stay focused on what comes after, when it may become much more of a two-way street," says Jurrien Timmer, director of global macro at Fidelity Investments. "Unless you have strong convictions about near-term moves, the best bet is to stick with your long-term investment plan."

An expected improvement in quarterly results for corporate earnings as well as optimism over the Trump inauguration is lifting stocks, said Sam Stovall, chief investment strategist at CFRA Research. Analysts now expect corporate profits to rise 4.4% in the fourth quarter, which would be the second-straight quarterly increase, S&P Global Market Intelligence says. History bodes for a bit of a rally, too, given the inauguration. Going back to 1953 when President Dwight D. Eisenhower’s was inaugurated, the S&P 500 rose an average of 1.6% in the first 100 days of a president’s first term in office, Stovall noted.

The yield on the 10-year Treasury note was stable at 2.47%. The recent rise in Treasury yields has moderated lately. Treasury rates hit their highest point over the past 12 months on Dec. 27 at 2.56%. Yet, Treasury yields have been generally rising since July 2016 as investors expect inflation to increase. The yield on the 10-year has intensified as investors prepare for President Trump's government spending plans, which are expected to increase the country's level of debt.