Updated from 1:02 p.m. ET, Wednesday, July 19. 

Stocks held around session highs on Wednesday, July 19, as merger talks in the media sector set off gains for broadcast names.  

The S&P 500 added 0.34%, the Dow Jones Industrial Average was up 0.1%, and the Nasdaq added 0.6%. The S&P 500 and Nasdaq were trading above their record closing highs from Tuesday, July 18.

Merger talks between Discovery Communications Inc. (DISCA) - Get Report and Scripps Networks Interactive Inc. (SNI) set the S&P 500 and Nasdaq higher. A Wall Street Journal report broke earlier that the two are in talks to merge, reviving discussions of a merger that fizzled in 2013. The Journal article, which cited sources familiar with the matter, didn't report on any specifics of the deal, but noted that it's possible the deal could fall apart or that another bidder for Scripps could emerge.

Scripps shares rocketed 14.4% higher, while Discovery increased 4%. Other media and entertainment stocks rose, including AMC Networks Inc. (AMCX) - Get Report , Sinclair Broadcast Group Inc. (SBGI) - Get Report , CBS Corp. (CBS) - Get Report and Walt Disney Co. (DIS) - Get Report .

More gains in the tech sector also helped out markets on Wednesday. Major tech stocks have mostly recovered from a mid-June selloff with the Technology Select Sector SPDR ETF (XLK) - Get Report now down 0.3% from the first crash on June 9. Apple Inc. (AAPL) - Get Report shares were up 0.7% on Wednesday, looking to close out the session with gains for the ninth time in a row.

Apple is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells AAPL? Learn more now.

A divided Wall Street sent the Nasdaq and S&P 500 to new records on Tuesday, while the Dow retreated into the red. The Dow fell 0.25% on Tuesday, weighed down by a slide in Goldman Sachs Group Inc. (GS) - Get Report shares. The Nasdaq rose 0.47% to end at 6,344, surpassing the record close set on June 8. The S&P 500 inched 0.06% higher, scoring a new record of 2,460.

Even with recent highs, trading on Wall Street has been relatively muted with investors more in wait-and-see mode than a bullish mindset, said Robert Pavlik, chief market strategist at Boston Private, in a note. 

"Strange as it may sound the action in the market feels as though we're nowhere near an all-time high," said Pavlik. "Overall volume is down and most investors apparently are acting as though they're more cautious than anything else... I believe the quietness of the market is a reflection of investor's concerns with the lack of progress coming out of D.C. on everything from healthcare to taxes."

Roadblocks in Washington, D.C. have become more apparent following the Senate GOP's inability to pass healthcare reform. Senate Republicans' efforts to repeal and replace Obamacare collapsed on Tuesday after Senate Majority Leader Mitch McConnell failed to whip up enough support. The Republicans' inability to pass healthcare reform, a widely touted promise on the campaign trail, raises doubts over other agenda items, including tax reform.

Shares of Dow component International Business Machines Corp. (IBM) - Get Report  fell 4% after the tech company posted its 21st straight quarter of year-on-year sales declines. Revenue of $19.3 billion fell short of estimates of $19.5 billion. IBM's increasingly important cloud platforms segment saw its revenue slump 5.1% year over year. Revenue for its legacy systems business dropped 10.4%. Earnings did beat estimates, though, with adjusted profit of $2.97 a share topping $2.74 consensus. 

In more earnings news, Morgan Stanley (MS) - Get Report rose 2% after topping earnings and sales estimates over its second quarter. Profit of 87 cents a share grew from 75 cents in the year-ago quarter and beat consensus of 76 cents. Revenue of $9.5 billion exceeded estimates of $9.1 billion. Investment banking revenue was 27% higher than a year earlier, while sales and trading revenue dipped 3%. 

United Continental Holdings (UAL) - Get Report  fell 5% even after exceeding analysts' estimates over its recent quarter. Earnings of $2.66 a share were sharply higher than $1.78 in the year-ago quarter. Adjusted earnings of $2.75 a share topped consensus of $2.66. Revenue increased 6.4% to $10 billion, above expectations of $9.97 billion. 

CSX Corp. (CSX) - Get Report fell 5.3% despite a better-than-expected quarter. The railroad company earned an adjusted second-quarter profit of 64 cents a share, a nickel above expectations. Revenue of $2.93 billion exceeded consensus of $2.85 billion. CSX also added another $500 million to its share buyback program. 

CSX projected earnings-per-share growth for the fiscal year below Wall Street's expectations. The company predicted growth of 25% of over its 2016 numbers, translating into a rise of 45 cents over last year to $2.26 per share for 2017, below the analyst consensus of 49 cents per-share growth to $2.30 for the year.

Overall, analysts anticipate another quarter of above-average strength. CFRA Research said it anticipates 6.2% year-over-year earnings growth among S&P 500 companies, better than a 1.7% earnings decline seen in the same quarter a year earlier. The energy sector is expected to lead the pack, recovering from weakness over the previous two years.

"If during the first real week of the earnings season (this week) we see a few stocks that disappoint, folks tend to extrapolate that we're going to see more disappointment as the earnings season wears on," Helene Meisler wrote over on our premium site for investors, Real Money. Get her insights with a free trial subscription.

Just over one-tenth of S&P 500 companies have reported their second-quarter performances so far this season. Of those that have disclosed earnings, 77.8% have exceeded profit estimates and 70.4% have topped sales forecasts, according to Thomson Reuters data.

U.S. housing starts for June rose at a faster pace than analysts expected. New construction on housing increased to a seasonally adjusted rate of 1.215 million in June, higher than 1.122 million in May. Analysts expected a rate of 1.155 million. Building permits came in at 1.254 million, above estimates of 1.2 million.

Crude oil moved higher on Wednesday after a sharper decline in U.S. inventories than anticipated. Domestic crude stockpiles fell by 4.7 million barrels in the past week, according to the Energy Information Administration, a shallower drop than 7.6 million barrels in the previous week but above forecasts for a drop of 3.2 million. Gasoline and distillates stockpiles also declined. Stockpiles have declined 13 times in the past 15 weeks. 

West Texas Intermediate crude was up 1% to $46.88 a barrel on Wednesday. 

Snap Inc. (SNAP) - Get Report traded around $15 a share on Wednesday after settling below that level for the first time ever on Tuesday. Shares of the disappearing app company are down nearly 39% since making their public debut in early March. 

Vertex Pharmaceuticals Inc. (VRTX) - Get Report rocketed 23% higher after a series of analyst upgrades on positive data for its cystic-fibrosis treatment. Analysts at Raymond James, Cowen & Co., and Barclays upgraded their ratings on the stock. The drugmaker reported positive mid-stage results for its cystic-fibrosis combination treatments on Tuesday afternoon. 

Eat, Drink and Talk Money with Jim Cramer

Meet Jim Cramer at an exclusive reception at his Bar San Miguel in Brooklyn, N.Y., on Tuesday, July 25, from 6:30 p.m. To 9 p.m.

The evening will start with a screening of Jim's CNBC show Mad Money. Afterwards, Jim will join the party fresh off of the CNBC set to mingle, take photos and answer your investing questions.

Tickets include dinner, drinks and an autographed copy of Jim's book Get Rich Carefully.

Click here for more information or to buy tickets.

Where: Bar San Miguel, 307 Smith St., Brooklyn, N.Y.

When: Tuesday, July 25, 6:30 p.m. to 9 p.m.

More of What's Trending on TheStreet: