NEW YORK (Reuters) - Wall Street stocks have climbed to record highs as worries over U.S.-China trade relations and the Federal Reserve’s monetary policy have receded, but cautious investors have been sticking with technology shares and some defensive stocks over value stocks and more speculative plays such as IPOs.

FILE PHOTO: A Wall St. street sign is seen near the New York Stock Exchange (NYSE) in New York City, U.S., September 17, 2019. REUTERS/Brendan McDermid

That’s unlikely to change in the near term even if stocks keep rising, strategists say, as uncertain economic conditions lead investors to shares of companies with solid earnings and growth prospects.

As concerns over a slowdown in global economic growth have loomed, technology shares and defensive shares in the real estate, utilities and consumer staples sectors have alternated in leading U.S. stocks higher. Technology companies are considered capable of earnings growth even if the economy falls into a recession, while defensive shares offer steady dividends.

The S&P 500 .SPX has gained 22% this year in large part because of the 36% gain in technology shares .SPLRCT, which have an outsized impact on the benchmark index. The S&P 500 tech sector includes the two largest U.S. companies by market capitalization, Apple Inc AAPL.O and Microsoft Corp MSFT.O.

Apple shares have surged 62% year-to-date, Microsoft 41%. Overall, tech stocks account for roughly a third of the benchmark index’s gains.

Real estate .SPLRCR shares have risen 26%, the second-largest percentage gain among S&P sectors, but they have a miniscule weighting on the index.

Shares of less fundamentally sound companies, by contrast, have faltered. The small-cap Russell 2000 index .RUT, a third of whose constituents have no net income, has underperformed the S&P 500 in 2019. And shares of several companies that have gone public this year have fallen sharply since their debuts, including Lyft Inc LYFT.O, Uber Technologies Inc UBER.N and Slack Technologies Inc WORK.N.

Unprofitable U.S. companies holding IPOs this year have had a median stock return of 0%, according to a Reuters analysis.

Investors are “not just going to buy anything indiscriminately,” said David Joy, chief market strategist at Ameriprise in Boston. “We want to see some earnings or some prospects for earnings.”

Recently, trading patterns among the S&P 500 have begun to shift. Defensive shares underperformed in October as the United States and China appeared on the verge of signing a limited trade agreement and the Federal Reserve cut interest rates for a third time this year. At the same time, value shares, so named because of their relatively low price-to-earnings ratios, have perked up. Over the past two months, the Russell 1000 Value .RLV index has outperformed the Russell 1000 Growth index .RLG.

The improved performance of value shares, concentrated in economically sensitive sectors such as financials, has prompted suggestions of a rotation in leadership among U.S. stocks. But even though conditions could support a breakout of such shares, some investors say they are reluctant to make bold bets until economic data confirms a rebound. On Friday, the Institute for Supply Management’s U.S. manufacturing index showed factory activity contracting for a third straight month in October.

“We’re not positioning ourselves for value to all of a sudden come back,” said Mark Stoeckle, chief executive officer of Adams Funds in Baltimore. “I’d rather have the data tell me it’s time to be in value.”

Indeed, the S&P 500 technology index has made new highs in the past week and throughout the year, while the S&P 500 financial .SPSY index remains below its 2018 peak.

“We’re looking for signs that tech is going to roll over,” said Keith Lerner, chief market strategist at SunTrust Advisory Services in Atlanta. “At this point, it’s too early to say that.”