By Anora Mahmudova and Carla Mozee, MarketWatch

NEW YORK (MarketWatch) -- After a choppy but mostly positive morning, U.S. stocks turned south Wednesday afternoon, erasing gains to trade lower on the day.

Defensive plays, such as utilities and consumer staples were still attracting buyers amid broader market decline, suggesting consolidation after sharp gains in the previous few sessions, that had sent the S&P 500 to its best gain this year.

News of shots fired at the Canadian Parliament building in Ottawa may be contributing to jittery markets.

The S&P 500 (SPX) slipped 7 points, or 0.4% to 1,934. The Dow Jones Industrial Average (DJI) lost 90 points, or 0.5%, to 16,524, dragged down by big declines in Boeing Co. The Nasdaq Composite (RIXF) slipped 18 points, or 0.4% to 4,401.66.

Colin Cieszynski, chief markets strategist at CMC Markets, in an interview with MarketWatch said that shootings have created uncertainty and are not helping markets that ran up over the past three days and were looking for consolidation.

Cieszynski expects more volatility in the next few months. "I am not convinced that the correction is over, we will probably retest October lows, especially around the next Fed meeting and midterm elections," he added.

In economic news, U.S. consumer prices rose slightly in September owing to higher costs for food and housing, but inflationary pressures continue to be held in check by falling energy expenses. The uptick was in line with expectations.

Several heavyweights, including Boeing Co., Dow Chemical and Biogen Idec Inc., reported before the opening bell.

Boeing (BA) shares fell 3.5% despite beating profit expectations. RBC Capital Markets analyst Robert Stallard said that while profit and revenue were better than expected, the aerospace giant has encouraged investors to look at cash over EPS for the best growth in the next few years. "..The lack of cash in 3Q, and only a modest change to the operating cash guidance for the year are likely to disappoint," he wrote in a note."

Dow Chemical (DOW) shares climbed 0.4% after the company's adjusted third-quarter earnings of 72 cents a share came in above the FactSet consensus estimate of 67 cents. Revenue also exceeded analyst forecasts of $14.32 billion.

Biotech firm Biogen Idec (BIIB) reported better-than-expected third-quarter results and lifted its full-year earnings outlook. Shares had been up in premarket trade after the report, but later dropped 7.3%.

Yahoo Inc. (YHOO) shares rose 5%, after the online search provider posted better-than-expected third-quarter results late Tuesday.

Stocks to watch: Tekmira Pharmaceuticals Corp. (TKMR) shares popped up 11%, with the company saying it has started to limit manufacturing of a new therapeutic drug targeting the Ebola virus. Supply of the product will be available in early December 2014 "for potential use by various collaborators," said Tekmira.

Tesla Motors Inc. (TSLA) fell 1.3% after Daimler AG on Tuesday said it has sold its 4% stake in the electric car maker. (Read more about the day's notable stocks in Movers & Shakers column: http://www.marketwatch.com/story/tesla-boeing-yahoo-likely-to-see-action-wednesday-2014-10-22.)

Other markets: In Asia, Japanese stocks pushed higher, putting the Nikkei Average up by 2.6%. European stocks and the euro (EURUSD) retreated after a Spanish news report that 11 banks will fail the European Central Bank's stress tests. The results are due Sunday.

Gold futures (GCZ4) fell $6.4 an ounce and oil futures (CLZ4) edged up. The dollar (USDJPY) traded slightly lower against the yen.

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

Tesla (NASDAQ:TSLA)
Historical Stock Chart
From Feb 2024 to Mar 2024 Click Here for more Tesla Charts.
Tesla (NASDAQ:TSLA)
Historical Stock Chart
From Mar 2023 to Mar 2024 Click Here for more Tesla Charts.