The major domestic equity indexes gained some positive ground on Tuesday, as Apple led a rise in technology shares and a gain of more than 2 percent in oil prices drove up energy shares.

Apple chalked up a gain of 2.5 percent, aiding the three major indexes, a day ahead of its expected unveiling of new iPhone models.

The S&P technology sector was up 0.8 percent, its largest percentage increase in two weeks, due in part to Microsoft, up 1.7 percent, and Facebook, up 1.1 percent.

The technology sector is up close about 18 percent for the year so far, leading sector gains in the S&P 500, along with consumer discretionary, also up roughly 18 percent since Dec. 31.

The energy index, up 1 percent, helped to lift the S&P 500, with shares of Exxon Mobil up 1.4 percent and Chevron up 0.5 percent. Oil prices rose after sanctions squeezed Iranian crude exports and tightened global supply.

Also gaining were shares of companies that could see a rise in sales in the aftermath of Hurricane Florence, which was upgraded to Category 4 and was expected to make landfall in the Carolinas later this week.

Home improvement retailer Home Depot was up 1.5 percent and Lowe’s Companies was up 1.6 percent, while shares of construction material companies also rose.

The gains came despite lingering trade tensions. China told the World Trade Organization it wanted to impose sanctions on the United States for its non-compliance with a ruling in a dispute over U.S. dumping duties.

Western Digital fell 3.6 percent after RBC echoed other brokerages in warning that falling NAND chip prices would hit the company.

Activision Blizzard rose 7.1 percent and Take-Two Interactive Software gained 3.7 percent after brokerage Stifel forecast a strong reception for their videogames in the holiday period.

Approximately 6.3 billion shares changed hands on the major domestic equity exchanges, as compared to the 6.1 billion share daily average for the past 20 trading days, according to Thomson Reuters data.