President Donald Trump in the Oval Office of the White House in Washington, DC.

As stock markets steadily climbed during his first year in office, President Donald Trump cheered the rise at every turn.

But the president has stayed silent as he watched this year's gains disappear in recent days.

Good financial market and economic news greeted Trump after his inauguration in January 2017. Hopes about his push to slash regulations and chop corporate tax rates unlocking economic growth helped to drive stock market records. The president gleefully claimed rising stocks as evidence of his success.

Trump tweet

Now, he has to grapple with an unknown: a stock market that has recently slipped, partly due to the president's own policies. While gross domestic product has improved, market watchers appear disappointed with the prospects for earnings growth. Interest rate hikes from a Federal Reserve chairman the president appointed — and routinely criticizes — along with a widening trade war with China have spooked investors.

The recent stock losses may prove short-lived. The market pain has so far not hurt Trump's approval rating ahead of the critical Nov. 6 midterm elections, though booming equities last year did little to help Americans' views of the president. Still, the stock struggles at least temporarily erase one of the factors the president pointed to as evidence of success throughout his first year.

Stocks surged from Jan. 23, 2017, the first trading day after Trump's inauguration, until the end of last year. The Dow Jones industrial average, and Nasdaq Composite climbed about 25 percent, 18 percent and 24 percent, respectively, during that time, according to FactSet data.

This year has gone much differently for markets. The Dow and S&P have dipped 0.1 percent and 0.6 percent, respectively, this year. Only the Nasdaq has stayed positive, rising 3.8 percent.

As of Friday's close, the Dow, S&P and Nasdaq had dropped 6.7 percent, 8.8 percent and 10.9 percent in October, respectively.

In a statement Wednesday, White House spokeswoman Lindsay Walters shrugged off the stock market troubles, saying "the fundamentals and future of the U.S. economy remain incredibly strong." She added that "we remain focused on the long-term outlook of the U.S. economy."