Stocks closed higher on Friday as investors shrugged off worries about a possible government shutdown. The rose 0.4 percent to close at 2,810.30, a record high, with consumer staples as the best-performing sector. The Nasdaq composite climbed 0.6 percent to finish at 7,336.38, also a record. "The prospect of a government shutdown isn't putting a lid on this boiling market—investors simply aren't fazed," said Mike Loewengart, vice president of investment strategy at E-Trade. "For traders, many are looking beyond the beltway and finding fundamentals in US companies as sound as they've been in a long time." The Dow Jones industrial average closed 53.91 points higher at 26,071.72, despite pullbacks in IBM and American Express.

Major U.S. Indexes

On Thursday, the House passed a bill to keep the government open. The bill is now in the Senate's hands, where 60 votes are needed to send it to President Donald Trump's desk. Republicans only hold 51 seats in the Senate. Historically, a government shutdown has led to a short-term pullback in the stock market. Mick Mulvaney, chief of the Office of Management and Budget, said Friday that odds of a shutdown occurring are 50-50. Meanwhile, Goldman Sachs thinks there is a 60 percent chance the government shuts down. In a note, Goldman said a shutdown "seems more likely than not because both sides appear to think they could gain from a shutdown." Equities have seen an increase in volatility this week. On Tuesday, stocks closed lower in a major reversal that knocked them off of record highs. "The noise we're hearing out of Washing doesn't sound like they're close," said Art Hogan. chief market strategist at B. Riley FBR. "If you were looking for a reason to be cautious, that might be it." Still, the major indexes posted weekly gains. The Dow rose 1 percent for the week, while the S&P 500 and Nasdaq gained 0.9 percent and 1 percent, respectively. The major averages also hit record highs as earnings season rolled on.

A man poses for a photo with the Wall Street bull sculpture between Broadway and Exchange Place in the Financial District of New York. Andrew Harrer | Bloomberg | Getty Images