NEW YORK (AP) — U.S. stock indexes edged higher in midday trading Monday, holding at record levels, as investors looked past a failed military coup in Turkey. Technology stocks led the way.

KEEPING SCORE: The Standard & Poor’s 500 index was up 5 points, or 0.2 percent, to 2,167 as of 11:23 a.m. Eastern time. The Dow Jones industrial average rose 31 points, or 0.2 percent, to 18,548. The Nasdaq composite climbed 32, or 0.6 percent, to 5,062. Six of the 10 sectors that make up the S&P 500 were up.

CARRY ON: This past weekend’s attempted coup in Turkey, which began after most stock markets closed for trading Friday, initially triggered a jolt in the currency markets. But when stock markets around the world got their first opportunity for trading since the attempt, they largely held steady, and the Turkish lira recovered some of its steep losses.

“The market is looking at things with a half-full lens these days, and there’s some basis for the market to take this in stride,” said Matthew Peron, head of global equity at Northern Trust Asset Management.

The coup attempt was quickly halted. Plus, economic reports around the world have been coming in better than analysts expected. “There is a firmer footing to the global economy, and this isn’t enough to knock that narrative,” Peron said.

TECH LEADERS: Technology stocks rose the most, 0.8 percent. Japanese tech company SoftBank Group is buying Britain’s ARM Holdings for 24.3 billion pounds ($32 billion) in the first big acquisition announced since the United Kingdom voted to leave the European Union. SoftBank also owns Sprint.

BETTER (THAN EXPECTED) BANKS: Financial stocks rose after Bank of America reported earnings that were better than analysts were expected. Banks have been struggling with low interest rates, which limit the profits they can make from making loans. Bank of America nevertheless reported a smaller decline in earnings than analysts forecast, due in part to higher trading revenue and cost cuts.

OIL PAIN: Energy stocks lagged the market with a loss of 0.6 percent. They fell with the price of crude oil, which lost 93 cents, or 2 percent, to $45.02 per barrel. Brent crude fell $1.07 to $46.54 a barrel in London.

THE SAFETY TRADE: The traditional hiding spots investors have flocked to when scared were mixed. The price of gold was up 0.2 percent to $1,329.80 per ounce, but U.S. government bond prices fell. The yield on the 10-year Treasury note, which moves in the opposite direction of its price, rose to 1.58 percent from 1.55 percent late Friday.

EARNINGS RUNWAY: A slew of companies are scheduled to report their quarterly earnings this week, including nearly a fifth of the S&P 500 index. Analysts have dim expectations, with forecasts for a fourth consecutive decline in earnings.

But many investors will be paying more attention to what companies have to say about upcoming earnings trends than how they did during the spring. Analysts are expecting earnings for the S&P 500 to return to growth in the current quarter, and investors hope to hear CEOs say at least that conditions are improving, if not good.

GLOBAL MARKETS: Britain’s FTSE 100 rose 0.6 percent, France’s CAC 40 was close to flat and South Korea’s Kospi index rose 0.2 percent. Japan’s stock market was closed for a holiday.

CURRENCIES: The dollar rose to 105.76 yen from 105.53 yen late Friday. The euro edged up to $1.1067 from $1.1063. The pound rose to $1.3255 from $1.3206.