US stocks stumbled through the week on a mix of dull earnings and weak forecasts before encouraging data from both Beijing and Washington edged the indices to fresh multi-year highs on Friday.
The catalyst for Friday's jump was a sharply narrowed US trade deficit in December -- driven by both lower oil imports and rising oil exports -- that pointed to a better economy in the 2012 fourth quarter than data has suggested.
The government's first estimate for the quarter was an 0.1 percent contraction, a surprise figure that took the wind out of markets after it came out on January 30.
The smaller trade deficit "implies positive GDP growth for the fourth quarter," said economist Harm Bandholz of UniCredit.
China's January trade and inflation data also boosted markets: its trade surplus gained and inflation was down, adding to evidence the world's number two economy is emerging from a drawn-out slowdown.
"These data suggest that external and domestic demand are both strong, which supports our view that the economy is on track for a cyclical recovery in the first half," said Zhang Zhiwei, a Hong Kong-based economist with Nomura International.
Friday's gains took the S&P 500 to its highest level since November 2007, hitting 1,517.93, though up a mere 0.3 percent for the week. It was still well shy of the all-time closing high of 1,564.15, reached on October 9, 2007 before the crash.
The Dow Jones Industrial Average closed at 13,992.97, down 0.1 percent for the week, but only after powering past the 14,022 level during trade Friday, its highest level in five years as well.
And the Nasdaq picked up 0.5 percent in the week, ending at 3,193.87. The tech-dominated exchange last saw Friday's level in 2000 as markets plunged into the dot-com crash.
"The two factors pushing the market higher are funds flows and the Fed," said Peter Cecchini of Cantor Fitzgerald.
The Federal Reserve is holding to its ultra-low interest rate, easy money policy, leaving savers with little place otherwise to put their money.
"So clearly the stock market has some pretty impressive tailwinds generated by the Fed. But we might expect a little bit of a pullback, to take a breather," Cecchini said.
Other analysts also saw a pause ahead, with earnings season winding up and little clear direction in the economies of both the United States and Europe.
"As the broad markets attempt to break free of this recent congestion, the volatility in Europe and retail sales could steal the headlines next week," said Joe Bell of Schaeffer's Investment Research.
Also looming was the massive snowstorm blasting through the US Northeast, which could tame some trading activity in the coming week after a blizzard halted air traffic in New York.
The markets face US political headwinds through the rest of February: the fight between Democrats and Republicans over whether to implement $85 billion in budget cuts, the sequester, programmed to come into effect at the end of the month.
If allowed to go ahead, the sequester would crunch economic growth, even as the improved the country's fiscal deficit.
President Barack Obama wants more tax increases included in a compromise plan, but Republicans are balking.
"It seems likely that the sequester will take effect on 1 March," said Nomura in a research note.
"The initial effect on economic activity should be modest, but it will grow if the cuts remain in effect for more than a few weeks."
Key data releases covering January in the coming week include retail sales (Wednesday), industrial production (Friday) and consumer sentiment (Friday).