By Christopher Whittall and Saumya Vaishampayan 

A rally in technology shares this week propelled the Nasdaq Composite to its largest weekly gain since February.

Stocks rose slightly Friday ahead of a holiday weekend in the U.S., with the stock market closed Monday for Memorial Day.

This week's advance, which was led by riskier corners of the market, underscored investors' confidence in the U.S. economy. Data released Friday showed that the economy's slowdown in the first quarter wasn't as bad as initially thought, and Federal Reserve Chairwoman Janet Yellen said that a rate increase could be appropriate in the coming months if the economy and labor market continue to improve.

Still, gains in the broader market are likely to be capped, as they have been in recent months, as investors continue to focus on weak global growth, uncertainty about the path of U.S. interest rates and elevated valuations. The Dow and S&P haven't closed at all-time highs in a year.

"We're expecting the markets to be in this choppy pattern for the foreseeable future," said Bob Landry, portfolio manager at USAA Investment Solutions.

The Nasdaq Composite Index rose 0.65% Friday. For the week, the index rallied 3.4%, its biggest weekly rise since the week ended Feb. 19.

The Dow Jones Industrial Average added 44.93 points, or 0.25%, to 17873.22 and the S&P 500 rose 0.4%. Both indexes rose more than 2% for the week, marking their best weeks since March.

Investors have recalibrated their expectations for the path of U.S. interest rates over the past two weeks, sparking a rally in the dollar and bank shares. Improving data and a chorus of upbeat Fed speakers have signaled that a rise in short-term interest rates could come as soon as the Fed's June 14-15 meeting.

Fed-funds futures, used by investors to place bets on U.S. central-bank policies, showed the odds of a rate increase at the Fed's June meeting are 30%, up from 13% a month ago, according to CME Group. The same futures contracts suggest a 62% probability of an increase by July, up from 28%.

The yield on the 10-year Treasury note rose to 1.851% from 1.823% on Thursday.

"There is very little barrier to another rate hike," said David Stubbs, global market strategist at J.P. Morgan Asset Management, who expects the Fed to move in June or July.

Mr. Stubbs said that inflation is moving in the right direction, financial conditions have improved from the start of the year and there is "good momentum" in the labor market -- all green lights, in his view, for another rate increase.

The KBW Nasdaq Bank index of large commercial lenders rose more than 3% this week. Rising rates tend to be good for banks because they widen the difference between the interest banks charge on loans and what they pay for deposits. Shares of financial firms in the S&P 500 rallied 2.6%, helping drive the broader market higher.

Sectors that were hit hard earlier this year, when investors were worried about the possibility of an economic downturn in the U.S., advanced. Technology shares in the S&P 500 rose 3.6% for the week. The Nasdaq Biotechnology Index posted a weekly gain of 4.5%. The Russell 2000, the benchmark for small-company shares, rallied 3.4%.

The WSJ Dollar Index is up about 3% this month as investors have considered the prospect of a June or July rate increase.

The dollar continued to rise Friday. The euro fell 0.6% against the dollar to $1.1125, while the dollar rose 0.4% against the Japanese yen.

"If the Fed does raise rates [soon], then you could see the dollar continue to pick up and that could hurt some multinational tech companies...but we're not at that point yet," said Robert Pavlik, senior portfolio manager at Boston Private Wealth LLC. Mr. Pavlik has recently added to his position in International Business Machines, in part because of the company's dividend.

In commodities, U.S. crude oil fell 0.3% to $49.33 a barrel, after briefly touching $50 earlier this week.

A rally in energy prices helped propel global stocks higher in recent months after steep falls at the start of the year. U.S. crude oil has rallied this month, mainly thanks to disruptions to production and pipelines that have cut supply.

The rise has relieved pressure on risky assets such as stocks and high-yield debt, which fell sharply in line with oil prices at the start of the year on concerns over a low oil price pushing up defaults in the energy sector.

"The main driver of markets this year has been what's going on in commodities," said Mr. Stubbs, who noted that the higher oil price should boost inflation expectations and feed into the Fed's considerations over interest rates.

Mr. Stubbs said oil at around $50 to $60 a barrel is still cheap for consumers without being too painful for producers.

"It is basically a sweet spot," he said.

The Stoxx Europe 600 rose 0.2%. For the week, the index gained 3.4%, its largest since the week ended Feb. 19.

Asian markets ended mostly higher Friday. Japan's Nikkei Stock Average rose 0.4% after data Friday showed Japanese consumer prices fell again in April. The continuing falls could add to pressure on the Bank of Japan to unveil more easing measures to boost inflation -- a move that can support stocks.

Australia's S&P/ASX 200 rose 0.3% and notched its seventh-straight week of gains.

Write to Christopher Whittall at christopher.whittall@wsj.com and Saumya Vaishampayan at saumya.vaishampayan@wsj.com

 

(END) Dow Jones Newswires

May 27, 2016 16:42 ET (20:42 GMT)

Copyright (c) 2016 Dow Jones & Company, Inc.