Stock indexes closed with small gains Wednesday after some companies reported profits that were stronger than expected, if not strong. Technology stocks led the way following an encouraging report from Microsoft, which helped offset weakness in the energy and raw-materials sectors.

ON WALL STREET: At the close, the Standard & Poor’s 500 index was up 9.4 points, about 0.4 percent, to 2,173. The Dow Jones industrial average rose 36 points, about 0.2 percent, to 18,595. The Nasdaq composite added 53.6, about 1.1 percent, to nearly 5,090.

advertisement | advertise on newsday

OIL PRICES: About the same time, the price of benchmark U.S. crude had gained 20 cents to $44.85 a barrel. In London, however, Brent crude was up 44 cents to $47.10 a barrel. Most energy stocks fell; Murphy Oil was off 54 cents, about 1.8 percent, to $30.46.

ECONOMIC NEWS: Several reports on the U.S. economy have also come in better than expected in recent weeks, which has helped stock indexes reach record highs. The S&P 500 has jumped just over 8 percent since hitting a bottom on June 27 after the United Kingdom voted to leave the European Union. The Dow has risen for eight straight days, its longest streak in three years.

NO FEAR: Calm in the markets meant less demand for gold and Treasurys, traditional go-to investments during periods of fear. The price of gold fell $17.40, or 1.3 percent, to $1,314.90 per ounce. The yield on the 10-year Treasury note, which moves in the opposite direction of its price, rose to 1.59 percent from 1.56 percent late Tuesday.

The VIX, an index that measures investors’ expectations of future volatility in the stock market, fell 2.8 percent and is close to its lowest level since 2014.