Wall Street returned from the long holiday weekend with enough energy to push stocks to new records for their second session in a row.

The Dow Jones Industrial Average increased 0.58% to close at 20,743, capping off its eighth straight day of gains following a better-than-expected quarter from Walmart (WMT - Get Report) .

A rally in the energy sector pushed the rest of the markets higher with the S&P 500 rising 0.60% to 2,365, a new record, and the Nasdaq climbing 0.47% to 5,865, also a fresh high. The latter's recent gains are the one to watch, said Helene Meisler of Real Money, our premium site for active investors, who pointed out that the tech-heavy index has not had consecutive down days in 2017. 

Stocks closed at fresh records for their second session in a row following Friday's slight gains. Wall Street was closed on Monday in observance of Presidents' Day. 

The energy sector gave markets a boost as crude oil prices rallied to nearly three-week highs. Organization of Petroleum Exporting Countries' Secretary General Mohammad Barkindo said on Tuesday that a rise in U.S. shale production had not threatened the group's output cut agreement. Barkindo also said OPEC would reach out the U.S. as a "strategic partner in the rebalancing process." Barkindo said adherence to a production cut limit had been above 90% in January. 

West Texas Intermediate crude was up 1.1% to $54.33 a barrel on Tuesday. The energy sector was the best performer on markets with the Energy Select Sector SPDR ETF (XLE - Get Report) rising 0.74%.

"Towards the end of 2016, an agreement by members of [OPEC] with some non-OPEC producers to cut oil output sent prices decisively higher," explained Fawad Razaqzada, technical analyst at FOREX.com in a note. "Since then, oil prices haven't really gone anywhere but crucially the pullbacks have been very shallow. This suggests that despite renewed worries about supply surplus in the U.S., market participants are anticipating oil prices to push further higher."

Walmart, the world's largest retailer, climbed 3% after topping fourth-quarter earnings estimates, raising its dividend and guiding for an in-line first quarter. Adjusted fourth-quarter earnings of $1.30 a share came in 2 cents above estimates while same-store sales in the U.S. jumped 1.8%, beating consensus of 1.3%. At its Sam's Club chain, same-store sales rose by 2.4%, double expectations.

For its first quarter, Walmart said it anticipates earnings in the range of 90 cents to $1 a share; Wall Street expects 96 cents. Walmart also raised its dividend by 2% to $2.04 a share. 

Walmart wasn't the only retailer to top estimates. Home Depot (HD - Get Report)  reported a solid quarter which benefited from a healthy housing market. The DIY home-improvement retailer reported 5.8% sales growth at locations open at least a year, higher than estimates of 3.5%. Profit of $1.44 a share was higher than $1.17 a year earlier and exceeded estimates of $1.34. Home Depot also increased its dividend to 89 cents from 69 cents and authorized a fresh $15 billion share buyback program. 

Macy's (M - Get Report)  beat analysts' quarterly estimates on its bottom line. The department store chain earned an adjusted $2.02 a share, 7 cents above estimates. Revenue came in weaker than expected, falling 4% to $8.52 billion and missing expectations of $8.61 billion. Fourth-quarter same-store sales fell 2.1%. The company said it anticipates fiscal 2017 sales to fall by 3.2% to 4.3% and for adjusted earnings to come in between $2.90 and $3.15 a share, wrapping around consensus of $3.05. 

Better-than-expected earnings from retailers came as a relief to investors who were wary heading into the industry's portion of the earnings season. Expectations have been relatively low for the majority with several retailers, including Macy's and Target (TGT - Get Report) , already having warned of weaker sales over the Christmas season. Slower traffic at malls and cautious consumer spending are expected to have contributed to retail weakness. Retail earnings are expected to increase by 5.2% over the fourth quarter, according to Thomson Reuters estimates.

Also in retail earnings this week, L Brands (LB - Get Report) and TJX Cos. (TJX - Get Report)  will report on Wednesday; Gap (GPS - Get Report) , Kate Spade (KATE) , Kohl's (KSS - Get Report) and Nordstrom (JWN - Get Report) on Thursday; and Foot Locker (FL - Get Report) and J.C.Penney (JCP - Get Report) on Friday.

Manufacturing activity in the U.S. softened in February, though remained in expansion territory. The Markit U.S. flash manufacturing PMI declined to 54.3 in February, down from 55 in January. Analysts expected the measure to increase to 55.2. The services gauge fell to 53.9 this month from 55.6 in January.

Yahoo! (YHOO)  moved 0.89% higher following a Wall Street Journal report that Verizon (VZ - Get Report) agreed to go forward with its acquisition of the Internet company. Verizon will reportedly shave off as much as $350 million from the original $4.83 billion offer. The deal had been in jeopardy after news broke last year of a hack that had compromised more than 1 billion accounts.

Wells Fargo (WFC - Get Report) announced Tuesday afternoon that it had terminated four senior managers in community banking as part of its investigation into its sales practices. The board unanimously voted to fire the employees. The bank's investigation is expected to conclude before its annual meeting in April. 

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

Apple (AAPL - Get Report)  rose 0.72% to close at an all-time high of $136.62 on Tuesday after Morgan Stanley hiked its price target on the tech giant to $154 from $150. The firm said it saw increased sales optimism in China, representing "outsized growth" in fiscal 2018. Morgan Stanley has increased its fiscal 2018 iPhone estimates by 3%. 

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.

Popeyes Louisiana Kitchen (PLKI)  surged 19% after agreeing to be acquired by Restaurant Brands International (QSR - Get Report)  in a deal worth $1.8 billion. Restaurant Brands will pay $79 a share, a 27% premium over Popeyes' 30-day volume weighted average price as of Feb. 10, the last day before reports surfaced that Restaurant Brands was mulling a bid. Restaurant Brands said in a statement that Popeyes will be managed independently in the United States "while benefitting from the global scale and resources of RBI." 

Kraft Heinz (KHC - Get Report) slumped 1.8% after scrapping its pursuit of Unilever (UL) . Kraft had offered a $143 billion takeover deal to Unilever last week, an offer Unilever said undervalued the company. The two said on Sunday that Kraft had "amicably agreed" to withdraw its proposal. Kraft said it had wanted to pursue friendly negotiations, but backed off when Unilever expressed no interest. 

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