The odds were against Wall Street on Thursday after another decline in crude oil sparked an energy selloff and Apple (AAPL) - Get Report reported a so-so quarter.

The S&P 500 was down 0.17%, and the Nasdaq slid 0.63%. The Dow Jones Industrial Average was above to clinch gains of 0.17%, thanks to an earnings-driven rally in Boeing (BA) - Get Report shares. 

Crude oil prices fell Wednesday as worries over international oversupply overshadowed an unexpected decline in weekly domestic inventories. Hopes of a production freeze agreement among Organization of the Petroleum Exporting Countries has faded after Iraq, the second largest producer in the bloc, expressed reluctance to join in on a deal. OPEC members are set to meet in Vienna at the end of November.

The Energy Information Administration reported a drop of 600,000 in domestic crude barrels in the week ended Oct. 21. Analysts had expected an increase of 400,000 barrels. Prices have been under pressure on worries over domestic and international oversupply, particularly as major oil producers show reluctance to cede market share by cutting production.

West Texas Intermediate crude closed 1.66% lower at $49.13 a barrel on Wednesday, settling at a three-week low.

The energy sector was the worst performer on markets Wednesday. Major oil producers including Royal Dutch Shell (RDS.A) , Chevron (CVX) - Get Report , PetroChina (PTR) - Get Report , Total (TOT) - Get Report and BP (BP) - Get Report moved lower. The Energy Select Sector SPDR ETF (XLE) - Get Report  rose slightly by 0.11%.

Apple (AAPL) - Get Report fell 2.2% after nudging past earnings and sales estimates in its fiscal fourth quarter. The world's largest company earned $1.67 a share, 2 cents above estimates, while revenue of $46.9 billion came in roughly in line. Revenue fell 9% from a year earlier, though, as sales of iPhones dropped. Profit and sales declined for the first time in 15 years.

The number of iPhones sold over the recent quarter came in above projections with 45.5 million units sold over the quarter. Analysts predicted 44.8 million units to have been sold. The number of iPhones sold fell 5% from a year earlier, their third straight quarter in decline. Services revenue, largely seen as a growth driver for Apple, climbed 24% over the quarter.

First-quarter sales guidance between $76 billion and $78 billion came in above estimates of $75 billion. The company also expects a drop in gross margins to 38% to 38.5% in the first quarter, down from 40.1% a year earlier.

TST Recommends

TheStreet's Jim Cramer, whose Action Alerts PLUS Charitable Trust Portfolio includes Apple, said he and co-manager Jack Mohr are taking "a longer view on the company's growth evolution, which is why we were encouraged by the company's Services business. The segment continued to deliver explosive growth on an accelerating basis, increasing 24% year over year to $6.3 billion."

Boeingclimbed 5% to lead the Dow after a tax benefit boosted profit in its recent quarter. Profit rose to $3.60 a share from $2.47 a year ago. Adjusted earnings of $3.51 a share came in above estimates thanks to a tax benefit of 70 cents a share. Revenue fell 7.5% to $23.9 billion, but exceeded estimates of $23.64 billion.

In other earnings news, Chipotle (CMG) - Get Report reported a major decline in quarterly sales as the bleeding from a food-safety scandal late last year continued. The burrito chain reported a 21.9% decline in same-restaurant sales over the third quarter, while revenue slumped 14.8% to $1.04 billion. Adjusted earnings of 56 cents a share fell well short of consensus of $1.56 a share. Chipotle also said sales in October so far have dropped 21% largely tied to Hurricane Matthew.

Comcast (CMCSA) - Get Report moved 3% lower despite a strong earnings report. The cable company added 32,000 video customers over the recent quarter, rebounding from a loss in the year-ago quarter, while NBCUniversal reported a 28% jump in revenue driven by Rio Olympics coverage.

Mondelez (MDLZ) - Get Report increased 3% after topping downbeat projections for its third quarter. Net income fell to 35 cents a share from $4.46 a share in the year-ago quarter tied to declines in its coffee business. Adjusted earnings of 52 cents a share beat estimates of 43 cents. The packaged foods company anticipates full-year sales growth of 1.6%, above projections.

Coca-Cola (KO) - Get Report  was down slightly after a smaller-than-expected drop in quarterly profit and sales. Net income of 24 cents a share fell from 33 cents a share as a strong U.S. dollar and weakness in overseas markets dragged on results. Adjusted income of 49 cents a share edged past consensus by a penny. Revenue fell nearly 7% to $10.63 billion with foreign exchange weakness taking a 2% hit to the topline.

Southwest Airlines (LUV) - Get Report moved lower after a tech outage in July hit its quarterly results. The days-long tech troubles pulled unit revenue 4.1% lower in its recent quarter, more than a guided-for 3% to 4% decline. Unit revenue measures the amount of money generated per seat per mile. The airline's July troubles reduced overall revenue by $55 million. Sales fell 3.4% to $5.14 billion, below estimates of $5.17 billion.

Biogen (BIIB) - Get Report rose on Wednesday as sales of its multiple sclerosis drug Tecifidera boosted its quarterly earnings and sales. Adjusted earnings of $5.19 a share came in above consensus of $4.70 a share, while revenue of $2.96 billion exceeded estimates by $60 million. Sales of Tecifidera increased 10%, while Tysabri, another multiple sclerosis drug, rose 7%.

New home sales moved higher in September, though a number of previous months were downwardly revised, pointing to a slow recovery despite red-hot demand. The number of sales in September rose 3.1% from a month earlier to a seasonally-adjusted annual rate of 593,000, according to the Commerce Department. September's figures were the second-highest since the recession after revisions reduced previous months' totals by 85,000.

The U.S. trade balance fell in September, according to the Census Bureau. The trade deficit narrowed by 5.2% to $56.1 billion, far better than an expected widening to $60.5 billion. Advanced wholesale inventories climbed 0.2%.