Solid earnings from the healthcare sector and a surprise bipartisan deal to continue financing insurance subsidies sent the Dow Jones Industrial Average and S&P 500 to records for a second day in a row. 

The Dow was up 0.18%, closing at a new record for its second day in a row. The blue-chip index also exceeded its 23,000 level, a new milestone, though did not close above that mark. The Dow first topped the 22,000 mark on Aug. 2. 

The S&P 500 added 0.07%, a new record, and the Nasdaq dipped 0.01%. 

UnitedHealth Group Inc. (UNH)  beat on its bottom line but missed on the top. Earnings rose to $2.51 a share from $2.03 a share a year earlier. Adjusted earnings of $2.66 a share bested estimates of $2.56. Revenue of $50.32 billion came in below consensus of $50.37 billion. Overall revenue increased nearly 9%, driven by an 8.4% gain in its pharmacy benefit management unit.

UnitedHealth surged more than 5% and closed at a new record with its best price gain since going public in 1984.

Johnson & Johnson (JNJ) gained 3.4% after beating earnings estimates and upping its full-year profit guidance. Pharmaceuticals revenue increased 15% over its recent quarter, while medical device sales in the U.S. rose 7%.

For the full year, Johnson anticipates adjusted earnings of $7.25 to $7.30 a share, higher than previous guidance of $7.12 to $7.22. Sales guidance of $76.1 billion to $76.5 billion was raised from $75.8 billion to $76.1 billion.  

The two were the best performers on the Dow on Tuesday. Other health stocks on the rise included AbbVie Inc. (ABBV) , Celgene Corp. (CELG) , Bristol-Myers Squibb Co. (BMY) and Biogen Inc. (BIIB) . The SPDR ETF (XLV) increased 1%.

Healthcare stocks added to gains mid-afternoon Wednesday after a bipartisan deal to fund insurance subsidies, a key part of the Affordable Care Act. Senators Lamar Alexander and Patty Murray said they had a deal that would provide funding for two years. More details will be provided at a 5 p.m. briefing, according to Politico. 

The sector fell late last week after President Donald Trump cut off subsidies to insurance companies as a way to undermine Obamacare and then railed against drugmakers for "getting away with murder." Trump and congressional Republicans have worked to repeal the ACA first through legislation, a process that failed to deliver the votes, and now by executive order.

Dow component Goldman Sachs Group Inc. (GS)  was the worst performer on the index, falling 2.6%. The bank posted third-quarter earnings of $5.02 a share, topping Wall Street forecasts of $4.17. Net revenue in the quarter was $8.3 billion, up from $8.2 billion a year earlier.

However, trading revenue took a hit, falling 17% and coming in the worst among its peers. That compares with trading declines of 16% at JPMorgan Chase & Co. (JPM) , 13% at Bank of America Corp.  (BAC) and 8% at Morgan Stanley.

Morgan Stanley ( MS) posted higher earnings than analysts projected as growth in wealth management made up for the tumbling bond-trading revenue that plagued firms across Wall Street. Net income rose by 6%, while earnings of 93 cents a share beat estimates of 81 cents.

Fixed-income trading revenue slumped 20%. Comparables in that unit were not favorable this year after following sharp growth in 2016 on Britain's decision to leave the European Union and volatility surrounding the U.S. presidential election. Total investment banking revenue increased 18%.

Netflix Inc. (NFLX) reported third-quarter earnings and sales that topped Wall Street forecasts, added 5.3 million new subscribers worldwide, and said it plans to spend between $7 billion and $8 billion on content in 2018, up from the $6 billion it will spend this year. Netflix said it already has committed to spend $17 billion over the next several years on content, and noted that its original content budget continues to swell each year.

"Our future largely lies in exclusive original content that drives both excitement around Netflix and enormous viewing satisfaction for our global membership and its wide variety of tastes," the company wrote in its third-quarter letter to shareholders released on Monday. "Our investment in Netflix originals is over a quarter of our total P&L content budget in 2017 and will continue to grow."

What you need to know off the Netflix numbers:

Less than 10% of S&P 500 companies have reported earnings so far, the majority of which have bested profit and sales estimates. Analysts anticipate blended earnings growth of 4.1% in the third quarter, or 2% excluding energy, according to Thomson Reuters estimates. Revenue is expected to rise by 4.3%.

"U.S. corporate earnings are forecasted to decelerate from earlier this year as the third-quarter reporting season gets underway," Omar Aguilar, chief investment officer of equities at Charles Schwab Investment Management, wrote in a note. "Homebuilder and insurance company results are likely to reflect the aftereffects of hurricanes Harvey and Irma, while large-cap multinational companies with significant overseas operations may have benefited from U.S. dollar weakness during the quarter."

A busy earnings calendar helped markets overlook troubling comments out of North Korea. North Korea's deputy U.N. ambassador, Kim In Ryong, reportedly said at the U.N. General Assembly committee that "nuclear war may break out at any moment." Increasingly bellicose language from President Donald Trump and North Korean leader Kim Jong-un has raised geopolitical tensions between the two countries since April. 

Import prices in the U.S. rose at a faster pace than anticipated in September. The measure increased by 0.7% in September, according to the Bureau of Labor Statistics, above consensus of 0.5%. Excluding fuel, import prices increased 0.3%. Over the past year, prices have risen 2.7%, or 1.3% excluding fuel. 

Industrial production for September rose at a slightly faster pace than expected, partially recovering from a drop in August. Production increased by 0.3% to 104.6, according to the Federal Reserve. Analysts expected an increase of 0.2% after a decline of 0.7% a month earlier. Capacity utilization dipped to 75.6% from 76.1%. 

Homebuilder sentiment reached a five-month high in October, according to the National Association of Home Builders. The measure increased by four points to 68 in October, its highest level since May. Economists had expected a flat reading of 64. 

Join us in New York City on Nov. 30 for The Deal Economy Conference, where leading industry experts and other influential members of the deal community will gather to discuss key issues that will confront dealmakers in 2018.

Join Jim Cramer, CNBC's Jon Najarian and Other Experts Oct. 28 in New York

Jim Cramer will host CNBC's Jon Najarian, TD Ameritrade's JJ Kinahan, famed analytics expert Marc Chaikin and other market mavens on Oct. 28 in New York City to share successful strategies for active investors.

You can join them as they discuss how smart investors can make the most of options trading, futures contracts, fundamental and quantitative analysis and great ETFs to buy right now. Participants will also get a chance to meet Jim and other panelists and take photos.

When: Saturday, Oct. 28, 8 a.m.-3 p.m.

Where: The Harvard Club of New York, 35 West 44th St., New York, N.Y.

Cost: $250 per person.

Click here for the full conference agenda or to reserve your seat now.

More of What's Trending on TheStreet:

More from Futures

Market of the Week

Market of the Week

Why China's Currency Will Bounce Back

Why China's Currency Will Bounce Back

Brent Oil May Make One Last Move Higher, but a Drop Is Coming

Brent Oil May Make One Last Move Higher, but a Drop Is Coming

Market Movers: September Grain Stocks Report

Market Movers: September Grain Stocks Report

Jeb Bush: Mid-Terms Could Be Another Wave Election

Jeb Bush: Mid-Terms Could Be Another Wave Election