Stocks rose for the third straight session on Wednesday, helped along by rising oil prices and a weakening U.S. dollar.

The Dow Jones Industrial Average (DJINDICES:^DJI) gained 67 points, or 0.4%, to close above 18,000 points for just the third time this year. The S&P 500 (SNPINDEX:^GSPC) added 7 points for a 0.3% uptick, leaving it less than 1% from its all-time high set last May:

^DJI Chart

^DJI data by YCharts.

As for individual stocks, VeriFone (NYSE:PAY) and A.K. Steel (NYSE:AKS) posted notable stock price swings after announcing their quarterly earnings figures ahead of the opening bell. 

VeriFone's shifting fortunes

VeriFone fell 23% after the point-of-sale system specialist posted weak fiscal second-quarter results and slashed its outlook for the rest of the year. Sales rose 7%, but net income plunged by over 80% to $3 million. That translates into just $0.03 per share compared to $0.15 per share in the prior-year period.

Image source: Getty Images.

Management wasn't happy with that performance and announced a major restructuring plan aimed at getting ahead of unfavorable shifts in the payments industry. "We are aggressively executing mitigating actions including a headcount restructuring and a review of underperforming businesses," CEO Paul Galant said in a press release. VeriFone says it will continue developing and launching its new devices and services but isn't nearly as optimistic about the coming quarters as it had been.

In fact, Galant and his team lowered their full-year sales outlook to $2.1 billion from $2.16 billion. Earnings are now expected to weigh in at $1.85 per share compared to the $2.23 per share executives had forecast three months ago. Considering the magnitude of that earnings slowdown, investors understandably pushed the stock lower on Wednesday. 

Rising optimism for AK Steel

AK Steel jumped 20% to reach a new one-year high after the stock received a head-turning Wall Street upgrade. An analyst at Credit Suisse boosted shares to the equivalent of a "buy" rating and doubled his price target to $7 per share -- representing a whopping 50% increase from the most recent closing price. 

Image source: Getty Images.

In support of the upgrade, the analyst argued that investors are "underestimating structural changes" in the steel market that are likely to push prices higher and raise AK Steel's profitability in the process. "We remain very bullish on the U.S. steel industry," the analyst wrote as he upgraded several stocks in that sector.

AK Steel last posted a 5% drop in quarterly steel shipments that was driven by a mix of falling prices and management's decision to reduce its exposure to lower-margin products such as hot rolled carbon steel while expanding in more profitable areas, such as coated products for the automotive industry. Overall volumes and average selling prices declined, but the company's financial performance improved: Operating profit rose by a solid 40%. 

There's no question a recovery in steel prices would send earnings even higher. However, investors have no way to predict when such a rebound will happen. Instead, shareholders should focus on the company's progress in building a portfolio that's not as susceptible to large swings in commodity prices. That's the initiative that will have a real impact on investors' returns over the long run.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.