– U.S. stocks posted their first four-day winning streak since January, as semiconductor and biotechnology shares rallied while weaker-than-expected retail sales spurred speculation on timing for higher interest rates.

Micron Technology jumped 11 percent, leading chipmakers higher, amid talk of a buyout. The Nasdaq biotechnology index increased 2.3 percent to a record. Apache and ­Chesapeake Energy rose more than 2.1 percent as oil gained. JPMorgan Chase advanced 1.4 percent after its quarterly profit beat analysts' estimates as expenses fell.

The Standard & Poor's 500 index rose 0.5 percent to 2,108.95 at 4 p.m. in New York, and closed at a three-week high. The Dow Jones industrial average added 75.90 points, or 0.4 percent, to 18,053.58, while the Nasdaq Composite Index climbed 0.7 percent. About 5.7 billion shares traded hands on U.S. exchanges Tuesday, 12 percent below the three-month average.

"I was a little disappointed with the retail sales numbers today, so I was a little surprised by the rally," said Mark Kepner, an equity trader at Chatham, N.J.,-based Themis Trading. "Maybe the drumbeat of the September rate rise is something that may get pushed back to later in the year. Going forward it's going to take earnings to push us higher. JPMorgan started the week of earnings off pretty well."

Greece's financial crisis and turmoil in China's equity market had diverted attention from corporate profits, U.S. economic data and the Fed's monetary policy. Fed Chairwoman Janet ­Yellen appears before ­Congress on Wednesday.

Bloomberg News