NEW YORK — The stock market closed out its best week in nearly two years on a positive note Friday, helped by strong quarterly earnings from Microsoft and other big U.S. companies.Investors were able to set aside dismal third-quarter results from Amazon. The giant online retailer’s shares took a beating, but that wasn’t enough to drag the rest of the market down.After weeks of speculation over the fate of Europe’s economy, Ebola fears and plunging oil prices, investors were able to get back to basics. Wall Street is in the midst of one of the busiest times of the year, when companies report their quarterly results. Ultimately what drives stock prices higher is the potential for that company to earn more profits, so higher profits generally mean higher stock prices. “What matters most to the market are earnings expectations and corporate fundamentals, and so far they’re looking pretty good,” said Michael Arone, chief investment strategist at State Street Global Advisors. Profits for S&P 500 companies are up 5.6 percent from a year ago so far this earnings season, according to FactSet, which is better than the 4.6 percent growth the market was looking for before the season began.