By Anora Mahmudova, MarketWatch

NEW YORK (MarketWatch) -- The U.S. stock market struggled to maintain earlier gains Wednesday following the Dow Jones Industrial Average and S&P 500's largest four-consecutive-day rise in more than a year.

Earlier stocks were boosted by an upbeat economic outlook from St. Louis Federal Reserve President James Bullard and positive data from overseas.

The S&P 500 (SPX) was less than a point higher at 1,819.39, which leaves the benchmark index 1.5% below its all-time high reached last month.

The Dow Jones Industrial Average (DJI) fell below the 16,000 mark, after dropping 31 points, or 0.2% to 15,964.88.

The Nasdaq Composite (RIXF) was 8 points, or 0.2%, higher at 4,199.62. After the previous day's rally, the tech-heavy index turned positive for 2014 and is now 0.6% higher for the year.

Follow our stock market live blog.

Recent weak economic data have not deterred Bullard's optimism about the U.S. economy: "I'm still optimistic about the prospects for this year. I think we can get 3% [growth] or better," he said in a panel discussion sponsored by the European-American Chamber of Commerce in New York.

"We have a combination of good news, which is underpinning improvement in sentiment. Two big areas of uncertainty were removed on Tuesday after Yellen's first congressional testimony and debt ceiling agreement," said Paul Magnus, head of equity strategy at Wells Fargo Private Bank.

"Earnings have been better than expected with certain sectors showing potential operational growth," he added.

The Bank of England's encouraging outlook for the U.K. economy and stronger-than-expected Chinese trade data have aided sentiment.

Stocks rallied during the previous session after Federal Reserve Chairwoman Janet Yellen pledged to keep interest rates low and said the Fed would continue to taper the pace of bond purchases if the economy keeps improving.

In earnings news, TripAdvisor (TRIP) shares rallied 7% after the online travel site reported a rise in profits in the fourth quarter.

Shares of DaVita HealthCare Partners Inc.(DVA) rose 6.3% after late Tuesday reporting better-than-expected fourth-quarter results and posting an update profit outlook for 2014.

Shares of Fossil Group Inc. (FOSL) rose 6.1% after the retailer's fourth-quarter profit, beat Wall Street expectations.

Dr Pepper Snapple Group Inc. (DPS) shares added 3.3% after the soft drink maker on Wednesday reported estimate-beating fourth-quarter earnings.

Amazon.com Inc. (AMZN) fell 4% after the stock's rating was cut to neutral from buy while its price target was lowered at UBS.

Deere(DE) shares initially rose after the farm-equipment maker reported first-quarter earnings, which beat forecasts. But shares fell 0.7% shortly after the market open.

Cisco (CSCO) will report after the market closes and analysts expect second-quarter earnings of 46 cents a share. Shares were slightly higher on Wednesday.

In other markets, European stocks rose for a sixth-straight session, while the British pound rose against the dollar after the Bank of England raised its forecast for U.K. economic growth in 2014 to 3.4%, from a prior forecast of 2.8%. The central bank also signalled it won't hike rates until 2015 because there is too much spare capacity in the labor market.

The Chinese data triggered losses for the Aussie dollar against the U.S. dollar (AUDUSD), while gold (GCH4) continued its upward march building on a 7% rise so far this year. Oil(CLH4) recaptured the $100 mark after a below-expectations rise in crude supplies in data released Tuesday.

More stories from MarketWatch:

Is the correction over (and that scary 1929 chart too)?

Does Janet Yellen believe in deflation?

Next crisis won't come from the emerging markets

Subscribe to WSJ: http://online.wsj.com?mod=djnwires

Keurig Dr Pepper (NYSE:KDP)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more Keurig Dr Pepper Charts.
Keurig Dr Pepper (NYSE:KDP)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more Keurig Dr Pepper Charts.