Stocks broke higher Tuesday after struggling for direction for much of the earlier session. 

The S&P 500 was up 0.26%, the Dow Jones Industrial Average rose 0.34%, and the Nasdaq added 0.11%. Stocks have traded in an out of positive territory Tuesday.

Financials crept higher on Tuesday after a days-long retreat. Banks such as JPMorgan (JPM) - Get Report , Citigroup (C) - Get Report , RoyalBank of Canada (RY) - Get Report and Westpac (WBK) - Get Report saw slight gains. Goldman Sachs (GS) - Get Report and JPMorgan led the Dow. 

The Dow attempted to snap its longest losing streak since 2011. The Dow ended Monday in the red, its eighth day of losses in a row and its longest losing streak since August 2011. Stocks were under pressure for much of the day as Wall Street contemplated the way forward for the Trump White House after its defeat on health care reform.

The GOP's failure to repeal and replace Obamacare, a major campaign commitment, was viewed as a litmus test for Donald Trump's ability to achieve major change in Washington. The Dow hasn't finished higher since March 15 when the sheen of the Trump presidency began to fade.

Trump had promised major tax reform and regulatory rollbacks, both which look like tougher sells after the clumsy handling of health care reform -- the bill appeared to be rushed through and was pushed toward a vote even without a healthy margin of support in Congress. The bill was pulled late Friday afternoon after two days of voting delays. 

"The burden of proof for U.S. equities just got a little higher," said David Joy, chief market strategist at Ameriprise Financial. "The failure of health care reform means that the job of tax reform has now been made more difficult. And that is what the market cares more about ... If there is to be a rethinking of equity valuations, it should be limited on the downside by these improving fundamentals. But, there is still room for disappointment if tax reform fails to impress."

Consumer confidence numbers gave markets a boost earlier in the session after a surge in March, continuing upward trends seen in the past few months. Confidence rose to a reading of 125.6 in March, according to the Conference Board, its highest level since December 2000. The index sat at 116.1 in February. Analysts had anticipated a small dip in March after the index reached a post-recession high last month. 

Crude oil prices moved higher ahead of weekly inventories data from the American Petroleum Institute Tuesday and official data from the Energy Information Administration on Wednesday. Expanding stockpiles and increasing production in the U.S. have hit crude oil prices in recent weeks. 

West Texas Intermediate crude was up 1.1% to $48.27 a barrel on Tuesday.

TheStreet Recommends

Energy stocks were the best performers in a muted market Tuesday. Major oil companies Royal Dutch Shell (RDS.A) , Chevron (CVX) - Get Report , Schlumberger (SLB) - Get Report , Enbridge (ENB) - Get Report  and ConocoPhillips (COP) - Get Report saw modest gains, while the Energy Select Sector SPDR ETF (XLE) - Get Report added 1%. 

Ford (F) - Get Report rose more than 2% on Tuesday after announcing plans to "create or retain" 130 jobs at its plant in Michigan. The jobs are part of the automaker's plans to increase capacity at its Romeo Engine factory, one of the ways in which Ford will invest $1.2 billion in three of its plants in the state. 

Competitor General Motors (GM) - Get Report was also higher after investor David Einhorn pushed for the company to generate two classes of stock to divide its dividends from earnings, such as stock repurchases. GM reportedly has reportedly rejected Einhorn's suggestion. 

The advanced trade deficit in the U.S. declined by 5.9% in February to $64.8 billion. Wholesale inventories increased by 0.4%, while retail inventories rose 0.4%. 

Home prices rose in January, according to the S&P Corelogic Case-Shiller home price index. The measure increased 0.9%, reaching a 31-month high. Analysts anticipated the index to rise 0.7%. 

American Airlines (AAL) - Get Report   took a $200 million stake in China Southern Airlines (ZNH) - Get Report in the second move by a U.S. carrier into the world's fastest-growing commercial aviation market. American will own about 2.68% of China Southern's outstanding shares after paying $1.55 billion Hong Kong dollars ($200 million) for a special issue of 270.6 million shares sold Tuesday by China Southern, which is Asia's biggest commercial airline by traffic.

Amazon (AMZN) - Get Report  purchased for an undisclosed amount, making a significant step into the growing Middle Eastern e-commerce space. had originally been offered $800 million from Dubai-based Emaar Malls, according to reports. The deal is expected to close this year.  

Red Hat (RHT) - Get Report  exceeded quarterly estimates. The software developer earned an adjusted 61 cents a share, meeting consensus, while revenue of $629 million came in higher than $618.6 million. For the full year, Red Hat anticipates adjusted earnings of $2.60 to $2.64 a share, above consensus of $2.59.  

Tesla (TSLA) - Get Report increased more than 2% after a disclosure showed Tencent acquired a 5% stake in March. Hong Kong-based Tencent purchased around 8.2 million shares this month for roughly $1.8 billion.  

Carnival (CCL) - Get Report climbed 1.4% after topping quarterly earnings estimates and guiding for in-line second-quarter profit. The cruiseline operator earned an adjusted 38 cents a share, 3 cents above estimates. Onboard revenue of $978 million came in above estimates of $961.9 million. Ticket revenue climbed to $2.8 billion from $2.72 billion. For the second quarter, Carnival anticipates 43 cents to 47 cents a share in profit compared to 46 cents consensus. 

FactSet (FDS) - Get Report fell 4% following a mixed second quarter. The database company earned $1.81 a share over the quarter, edging past consensus by a penny, while revenue of $294.35 a share fell short of estimates by just $1.7 million. For the third quarter, FactSet anticipates adjusted earnings of $1.80 to $1.86 a share, in-line with a target of $1.84.