US stocks finished mostly higher on Wednesday after a shaky start, as technology and industrial companies rose.
Banks fell with interest rates, as the market came off its biggest loss in five months.
Stocks started lower, then rallied around midday and wandered between gains and losses for several hours before a late-afternoon push.
Technology companies led the market, as they have done throughout this year.
Gains for shipping company FedEx helped take industrial companies upwards.
Nike took its biggest one-day loss in five years as investors were disappointed by its quarterly sales and outlook, and 130-year-old retailer Sears plunged after it said it may not be able to stay in business.
A day ago stocks dropped as Wall Street wondered if key aspects of President Donald Trump's agenda, such as tax cuts and increased infrastructure spending will be delayed.
The Republican-backed American Health Care Act appeared to be in trouble ahead of a House of Representatives vote on Thursday.
Terry Simpson, a multi-asset strategist for BlackRock, says it is noteworthy that even though the bill's fate is unclear, stocks did not fall any further on Wednesday.
"The market really wants to believe in the new administration," he said.
But if the bill falters in the House on Thursday or the Senate later on, investors will have "increased doubt in the ability to pass the pro-growth agenda".
The Standard & Poor's 500 index picked up 4.43 points, or 0.2%, to 2,348.45.
Nike dragged down the Dow Jones industrial average, which fell 6.71 points to 20,661.30.
The Nasdaq composite rose 27.82 points, or 0.5%, to 5,821.64. The Russell 2000 index of smaller companies sank 0.95 points, or 0.1%, to 1,345.60.
Apple gained 1.58 dollars, or 1.1%, to 141.42 dollars and Microsoft rose 82 cents, or 1.3%, to 65.03 dollars while chipmaker Nvidia added 2.16 dollars, or 2%, to 108.07 dollars.
The S&P 500's technology index is up 11% in 2017, more than double the gain for the broader S&P 500.
Bond prices rose. The yield on the 10-year Treasury note fell to 2.40% from 2.42%. Lower bond yields mean lower interest rates, and those reduce the profits banks can make from lending.
Investors snapped up high-dividend utilities and real estate investment trusts as bond yields fell.
Exelon picked up 34 cents to 36.30 dollars and Consolidated Edison gained 77 cents, or 1%, to 78.11 dollars. Utilities are the best-performing part of the S&P 500 over the last month.
Sears said in a regulatory filing that there is "substantial doubt" it will be able to remain in business.
In recent years the parent company of Sears and Kmart has closed more than 2,000 stores and slashed spending and jobs, and it has sold brands and split off its real estate assets to raise cash.
The company continues to lose billions a year as its sales fall further. It said pension agreements may prevent it from spinning off other businesses.
The stock has already been trading near all-time lows and lost 1.12 dollars, or 12.3%, to 7.98 dollars on Wednesday. The company's real estate investment trust, Seritage, lost 92 cents, or 2.1%, to 42.63 dollars.
Nike reported slightly disappointing third-quarter sales, and its forecasts for the current period displeased investors as well.
Nike's stock fell 4.09 dollars, or 7.1%, to 53.92 dollars, its biggest loss since June 2012. Nike is up this year but has not recovered from a 19% tumble in 2016.
Investors have worried about Nike's intense competition with rivals Under Armour and Adidas.
While shipping company FedEx did not have a great holiday season, its revenue was a bit better than expected and analysts said they think its business is going to improve. Its stock rose 4.08 dollars, or 2.1%, to 195.92 dollars.
Railway and aeroplane companies also climbed.