The stock indexes ended a strong week quietly on Friday, as the Dow Jones Industrial Average (DJINDICES:^DJI) and the S&P 500 (SNPINDEX:^GSPC) closed with small losses.

Today's stock market

Index Percentage Change Point Change
Dow (0.01%) (1.72)
S&P 500 (0.11%) (2.74)

Data source: Yahoo! Finance.

Energy stocks were hit as the price of crude oil fell below $50; the SPDR S&P Oil & Gas Exploration & Production ETF (NYSEMKT:XOP) dropped 2.2%. Consumer shares were also weak, with the Consumer Staples Select Sector SPDR ETF (NYSEMKT:XLP) losing 0.1%.

As for individual stocks, the initial public offering of Switch, Inc. (NYSE:SWCH) was a roaring success, and Costco Wholesale (NASDAQ:COST) fell despite reporting a good quarter.

Flags on the stock exchange on Wall Street.

Image source: Getty Images.

Switch IPO gets a big market reaction

Data center infrastructure company Switch became the second IPO in two days to see its shares bid up strongly on the first day of public trading, closing with a 22.6% gain over the offering price. The company priced 31,250,000 shares at $17, raising $531 million in the offering, and making it one of the biggest tech IPOs of the year.

Switch operates huge data centers powered by 100% renewable energy and rents out cloud service infrastructure on a contractual basis. Its 800-plus customers include major cloud users such as Amazon Web Services, PayPal, and Activision Blizzard

According to the registration filing with the SEC, the company earned net income of $31.4 million on revenue of $318 million in 2016, which represented 19.7% top-line growth from the year before. Because the shares offered to the public only amount to a 12.6% slice of shares outstanding, last year's earnings per share would amount to $0.05 on a pro forma basis. Considering the total shares outstanding, the market today valued the company at a whopping $5.1 billion.

The IPO was no doubt intriguing to investors for two main reasons. First, cloud computing is booming, and a company that provides big customers with scalable physical infrastructure and that comes with a strong environmental sustainability message is simply a business in the right place at the right time. Second, the other stocks in the space are structured as REITs, which are required to distribute 90% of profits as dividends. A different corporate structure allows Switch to retain more profits to fuel future expansion, thus giving the stock a potentially attractive growth component, which appeared to justify the expensive valuation in the minds of investors today.

A good quarter wasn't good enough for Costco investors

Warehouse retailer Costco reported strong revenue and profit growth, but the results weren't enough to quell market fears of competition, and the stock plunged 6%. Sales for the quarter (which had an extra week compared with last year) were up 15.8% to $41.4 billion and earnings per share jumped 17.5% to $2.08. Analysts were expecting sales of $41.5 billion and EPS of $2.01. 

The closely watched metric of comparable-store sales came in strong with growth of 5.7%, excluding excluding the impacts from changes in gasoline prices and foreign exchange. Membership fees had a healthy increase, too, growing 13.3% from the year-ago period. E-commerce sales were up 21%.

Given such strong numbers, today's drop in the stock price may seem puzzling. On the conference call, analysts asked about a slowing in renewal rates and a drop in gross margin of 15 basis points (9 if gas is excluded). Company officials seemed unconcerned about these issues and offered explanations for why they were affected by temporary factors. But in an environment where investors are focused on the impact that Amazon could have on the nation's grocery retailers, it doesn't take much to spook the market.

Jim Crumly owns shares of ATVI, AMZN, Costco Wholesale, and PYPL. The Motley Fool owns shares of and recommends ATVI, AMZN, and PYPL. The Motley Fool recommends Costco Wholesale. The Motley Fool has a disclosure policy.