October has generally been a tough month for stocks over the past century. Big crashes like the Panic of 1907, the Crash of 1929, and Black Monday in 1987 all occurred in October. In 1990, 1998, and 2011, big declines in August preceded further declines in October.

A single cause for those declines hasn't been identified, but many investors are still wary of the so-called "October effect". Yet this October was a fairly quiet one, with the S&P 500 falling less than 1% for the month as of Oct. 25 and still hovering near historic highs.

Image source: Getty Images.

Unfortunately, not all companies escaped October unscathed. In the tech sector, Twilio (TWLO 2.94%) and Imperva (NYSE: IMPV) fared the worst. Let's discuss how far these laggards fell, and whether they should be considered contrarian plays.

Twilio

Twilio's cloud-based platform connects individual apps to users' phone numbers. Uber, Airbnb, WhatsApp, Facebook Messenger, and other apps all use Twilio to let users add each other with their phone numbers or send text messages within the apps. Twilio's subscription-based solution is popular with developers, who would otherwise need to develop their own carrier-linked platforms from scratch.

Twilio's growth figures are impressive. Revenue soared 70% annually to $64.5 million last quarter, its active accounts grew 45%, and it expects its full-year revenue to rise 52% to 54%. But Twilio isn't profitable, and the company doesn't expect to turn a profit anytime soon.

Between June and September, Twilio stock soared from its IPO price of $15 to nearly $70. That rally boosted its price-to-sales ratio to the high 20s, and that inflated valuation attracted short-sellers, who are betting on the stock's fall. By the last week of September, 36% of Twilio's shares were being sold short.

In mid-October, Twilio announced a new secondary offering, with the company selling 641,000 shares at $40, and existing shareholders selling another 6.4 million shares. That move would let insiders sell their shares before the lockup expiration in late December. Investors got spooked, more short-sellers swarmed in, and the stock plummeted over 40% in October. On the bright side, that decline has reduced Twilio's P/S ratio to a more reasonable (albeit still pricey) 15.

Imperva

Imperva is a cybersecurity company that produces web application firewalls (WAFs) that protect individual apps from specialized attacks. The company is the market leader in this niche market, which Sandler Research estimates could grow at a compound annual growth rate of 17.3% between 2014 and 2019.

Image source: Getty Images.

In the past, Imperva was generally known for posting double-digit annual sales growth every quarter. But that growth abruptly ground to a halt last quarter, with sales rising just 8%, compared to 42% growth in the previous quarter and 39% growth in the prior-year quarter. Imperva blamed that slowdown on extended sales cycles and the smaller size of its larger purchases.

As a result, analysts now expect Imperva's sales to rise less than 7% this year. The company is also expected to post a net loss of $0.80 per share this year, compared to a profit of $0.11 last year. Those ugly numbers caused Imperva stock to plunge 31% in October, at the time of writing.

Imperva is now trying to sell itself and has reportedly attracted interest from Cisco and IBM. The fact that Imperva now trades at just 5 times sales, as opposed to about 10 times sales a year ago, increases the likelihood of a takeover.

But are Twilio and Imperva contrarian buys?

I like Twilio's business model, but I think the stock's high valuation and overwhelming short interest (47% as of Oct. 11) indicate that it still has room to fall before rebounding on a short-squeeze.

Imperva has more near-term upside potential, but only because it's trying to sell itself. Investors shouldn't buy a stock based on takeover buzz alone, however, since it could fall quickly if those talks fall apart. I believe that investors should keep an eye on these October underperformers, but they shouldn't consider them bargains just yet.