NEW YORK (TheStreet) -- Market moves may have been small on Wednesday but they were enough to push the Dow Jones Industrial Average to close at a new record high. Those moves didn't extend to the S&P 500, though, which closed slightly lower as tech giants Apple (AAPL) - Get Apple Inc. (AAPL) Report and Hewlett-Packard (HPQ) - Get HP Inc. (HPQ) Report  sold off. 

The S&P 500 closed 0.08% lower, but was still within a six-point range of all-time trading highs. The Dowwas up 0.08% to a record 18,244. The Nasdaq finished flat.

HP fell 9.9% after guiding for earnings below analysts' forecasts, citing a stronger U.S. dollar. The tech company reported a 4.7% drop in revenue over its recent quarter, with sales in its key enterprise services unit tumbling 11%.

Apple dropped more than 2% after a federal jury in Texas ordered the tech giant to pay nearly $533 million to settle a patent infringement suit brought against it by Smartflash.

Markets were higher earlier in Wednesday's session after Federal Reserve Chair Janet Yellen reiterated flexibility and data-dependence as key factors in determining when to raise interest rates.

Addressing the House of Representatives in day two of her semi-annual congressional testimony, Yellen restated on Wednesday that the central bank would hike rates back to normal levels once it was confident inflation was on track to hit its target 2%.

TheStreet Recommends

"Yellen is a dove, she has been a dove, I think she's going to continue to be a dove," said Wells Fargo senior equity strategist, Scot Wren, in a call. "All [her remarks] did was confirm for me that the Fed is going to be very careful here ... I fully believe, particularly after the testimony, that we are going to move very slowly and really they don't sound like they're in a hurry to start things up."

Crude oil recovered from a brief selloff. The commodity had been lower after U.S. inventories added 8.4 million barrels over the week ended Feb. 20, more than double market consensus and above the 7.7 million barrels added a week earlier. Major oilers have been cutting capex investments and shuttering non-profitable rigs but those moves have yet to filter through to a cut in production. By midday, West Texas Intermediate was up 3% to $50.77 a barrel.

Mid-cap energy stocks were among the best performers including SM Energy (SM) - Get SM Energy Company Report , Newfield Exploration (NFX) , and Range Resources (RRC) - Get Range Resources Corporation Report . The Energy Select Sector SPDR ETF (XLE) - Get Energy Select Sector SPDR Fund Report added 0.55%.

Retailers were looking strong after across-the-board earnings beats. Target (TGT) - Get Target Corporation Report shares were slightly higher after reporting earnings of $1.50 a share, 4 cents better than expected, and quarterly sales 4% higher.

Lowe's (LOW) - Get Lowe's Companies, Inc. (LOW) Report was modestly lower, despite a spike of 7.4% in fourth-quarter comparable-store sales. The home-improvement chain guided for full-year sales growth as high as 5%. Discount retailer Dollar Tree (DLTR) - Get Dollar Tree, Inc. Report  rose 2.3% after narrowly beating quarterly profit forecasts, while total sales surged more than 11%. Same-store sales climbed 5.6% in the fourth quarter.

Brazilian oiler Petrobras (PBR) - Get Petroleo Brasileiro SA Sponsored ADR Report tumbled 5.4% after Moody's cut its rating to "junk," citing concerns over corruption investigations and liquidity pressures. Lumber Liquidators (LL) - Get Lumber Liquidators Holdings, Inc. Report plummeted 26.4% after missing quarterly forecasts on its top- and bottom-line. The hardwood flooring retailer also indicated in a public filing that the Department of Justice is considering criminal charges against the company under conservation laws.

Cloud software developer Benfitfocus (BNFT) - Get Benefitfocus, Inc. Report surged more than 48% after beating fourth-quarter estimates and guiding for first-quarter sales as high as $41.5 million, above consensus of $39.3 million.

-- Written by Keris Alison Lahiff in New York.