U.S. stock indexes rallied on Tuesday on broad-based gains while Netflix and UnitedHealth earnings impressed investors and boosted optimism about the U.S. corporate reporting season.

Shares in Netflix (NFLX.O), the first of Wall Street's leading momentum stocks to report earnings, rose 9 per cent to close at a record high after the video-streaming pioneer smashed analysts' quarterly subscriber estimates.

Amazon.com was the S&P's biggest boost with a 4 per cent jump, helped by Netflix results but also by signs the U.S. Supreme Court is hesitant to let states force out-of-state online retailers to collect sales taxes on purchases.

Analysts expect S&P 500 company profits to rise 18.6 per cent in the first quarter, the biggest increase in seven years, according to Thomson Reuters data.

Strategists said strong earnings expectations as well as economic data from earlier in the day boosted equities.

"The overall picture is a positive one when it comes to earnings across sectors. There's a nice little turbo boost being given by the tax reform legislation," said Kristina Hooper, chief global market strategist at Invesco, in New York.

"Investors seem to be ignoring that which is not positive," Hooper said after White House Economic Adviser Larry Kudlow said the United States was not convinced of the merits of joining the TPP. The market had gained the previous week when it appeared that U.S. President Donald Trump was keen on TPP.

"It's easier for markets to focus on that which is positive and tangible rather than try to assess the potential outcome of protectionism," she said.

The Dow Jones Industrial Average rose 213.59 points, or 0.87 per cent, to 24,786.63, the S&P 500 gained 28.55 points, or 1.07 per cent, to 2,706.39 and the Nasdaq Composite added 124.81 points, or 1.74 per cent, to 7,281.10.

Data showed U.S. homebuilding increased more than expected in March amid a rebound in the construction of multi-family housing units. The PHLX housing index rose 1.12 per cent.

Along with the housing data, Invesco's Hooper said industrial production data was good sign for the economy. Industrial production registered a solid increase in last month as cold weather boosted utilities output and production at mines surged.

Ten of the 11 major S&P sectors rose, with the biggest boost coming from the technology index's 2.2 per cent gain. The consumer discretionary index rose 1.9 per cent, boosted by Netflix and Amazon, which hit its highest level since March 27.

The financial index was the sole S&P sector in the red, ending the day down 0.07 per cent as bank stocks fell.

Goldman Sachs (GS.N) fell 1.6 per cent as investors reacted to a pause in share buybacks and rising expenses, as well as indications it might be open to an acquisition. Goldman's profit, however, beat Wall Street's expectations.

UnitedHealth (UNH.N) jumped 3.6 per cent after the largest U.S. health insurer raised its earnings forecast and posted results that beat Wall Street estimates.

Advancing issues outnumbered declining ones on the NYSE by a 2.77-to-1 ratio; on Nasdaq, a 2.14-to-1 ratio favored advancers.

The S&P 500 posted 30 new 52-week highs and no new lows; the Nasdaq Composite recorded 126 new highs and 42 new lows.

On U.S. exchanges 6.15 billion shares changed hands, below the 6.98 billion average for the last 20 trading days but higher than the last two sessions.

CANADIAN STOCKS

Canada's main stock index rose to a 12-day high on Tuesday as technology and energy shares climbed and domestic data showed a stronger-than-expected gain for manufacturing sales.

The Toronto Stock Exchange's S&P/TSX composite index ended up 52.92 points, or 0.35 per cent, at 15,353.30, its highest close since April 5.

It was the fourth straight day of gains for the TSX.

The TSX's technology group rallied 2.7 per cent, led by a 7.7 per cent gain for Shopify Inc (SHOP.TO) to $158.04.

Also helping was Open Text's (OTEX.TO) 3.5 per cent rise after activist hedge fund Blue Harbour Group LP CEO said the business information management software company could be acquired.

Energy advanced 0.7 per cent, helped by higher oil prices.

Canadian manufacturing sales rose more than expected in February after two months of declines as the vehicle sector bounced back from plant shutdowns at the beginning of the year, data from Statistics Canada showed.

The Bank of Canada is due to make an interest rate decision on Wednesday.

Six of the TSX's 10 main groups rose on Tuesday. The index posted 11 new 52-week highs and three new lows.

The materials group, which includes precious and base metals miners and fertilizer companies, added 0.8 per cent.

The largest per centage gainer on the TSX was Alaris Royalty (AD.TO), which rose 9.7 per cent, while the largest decliner was Aphria Inc (APH.TO), down 7.4 per cent.