U.S. stocks opened higher on Tuesday, setting major indexes up for a fourth straight day of gains as investors looked past ongoing trade uncertainty in a holiday-shortened session. The Dow Jones Industrial Average rose 0.3% to 24,386. The S&P 500 added 0.3% to 2,734. The Nasdaq Composite Index rose 0.3% to 7,593. The stock market will close at 1 p.m. Eastern Time and it will be closed Wednesday for the Fourth of July holiday, reopening on Thursday with regular hours. Contributing to the positive tone on the day was a last-minute deal on immigration in Germany, which allowed the country to step back from a crisis that could have cost Chancellor Angela Merkel her position as leader. The day's gains were broad, and energy stocks were among the biggest early gainers, rising alongside a 1.5% increase in the price of crude oil. Among specific stocks, Exxon Mobil Corp. added 1.1% and Chevron Corp. added 1.1%.