US markets this week maintained their buoyant 2013 form, with the S&P 500 and the Dow Industrial index edging ever higher in a week marked by solid earnings results.
With the exception of high-tech giant Apple, which surprised the market with a gloomy outlook for 2013, top companies in a range of sectors released reports that either met or exceeded expectations.
Market watchers were also heartened by a move by the House of Representatives to agree to raise the US debt ceiling, removing a major source of uncertainty, at least for the medium term.
"The earnings have been very good and it appears that things are fine in Washington," said Hugh Johnson, chief investment officer of Hugh Johnson Advisors, flagging Apple as a glaring exception to the mainly positive trend.
The uptick of the major indices underscored growing optimism in the US economy, despite concerns until now about less than stellar job growth.
The Dow Jones Industrial Average finished the week at 13,895.98, up 1.8 percent from last week's close, and just 1.9 percent below its all-time high recorded in October 2007.
The broad-based S&P 500 breached 1,500 for the first time in five years, closing the week at 1,502.96, up 1.1 percent. That places the index about four percent below its all-time peak, which also came in October 2007.
Among the most optimistic of the companies reporting earnings this week was health and beauty goods manufacturer Procter and Gamble, which beat analyst expectations by a wide margin and increased its guidance for 2013 earnings.
"Global market share trends improved," said chief executive Bob McDonald as P&G pointed to organic sales growth in all five of its business segments.
Fast food giant McDonald's, which bested earnings forecasts by a modest margin, however offered a somewhat more restrained outlook for the new year.
"2013 is still going to be a tough economic environment around the world," said chief executive Don Thompson.
"In the US, we're seeing some signs of maybe a slight recovery. However, having said that, we also know that we have commodity pressures and some labor pressures."
The biggest question mark surrounded Apple, which reported large increases in the number of iPhones and iPads sold in the closing months of 2012, but offered a gloomy forecast for sales in the second quarter of 2013.
Apple forecast that Q2 revenue would range from $41-43 billion, well below the $54.5 billion reported in the first quarter. It also said it would have a gross margin of 37.5 to 39.5 percent, compared with a margin of 44.7 percent in the year-ago quarter.
"Apple's profit did go up; it just didn't go up that much," said analyst Rob Enderle of Enderle Group in Silicon Valley.
"They had a really high increase in sales, but their high margin is coming apart at the edges... They are making less per gadget."
The results spawned a sell-off in Apple shares that saw the company by week's end cede its status as the biggest company by market capitalization to oil giant ExxonMobil.
While Apple's struggles were noteworthy, the company-specific nature of its problems spared the market as a whole.
Patrick O'Hare at Briefing.com said the effect of Apple's problems was a "great rotation" not out of stocks in general, but out of Apple to other equities.
"Several months ago, one would have shuddered at the thought of what Apple losing 12 percent in a day would have meant for the broader market," O'Hare said. "Now, it is looked at as a stock with company-specific issues."
With many technology and banking equities having already reported earnings, the coming week will see results from a smattering of major companies including ExxonMobil, Caterpillar, Pfizer and Boeing, which will no doubt face many questions about the prospects of its troubled 787 Dreamliner.
The aircraft has been grounded worldwide following several operational problems.
The coming week will also see its share of important economic indicators, including Wednesday's release of gross domestic product data and Friday's much-watched accounting of non-farm payroll data and the unemployment rate.