(John Kemp is a Reuters market analyst. The views expressed are his own)

LONDON- Oil prices ran out of momentum last week as hedge fund managers stopped buying and realised some profits following a strong rally since the start of October.

Hedge funds and other money managers sold the equivalent of 29 million barrels in the six major futures and options contracts linked to petroleum prices in the week to Nov. 19.

Fund managers became small sellers after buying 176 million barrels over the previous five weeks, records published by ICE Futures Europe and the U.S. Commodity Futures Trading Commission show.

Portfolio managers last week sold NYMEX and ICE WTI (-23 million barrels) and European gasoil (-8 million) while buying small volumes of Brent (+1 million) and U.S. gasoline (+2 million).

Oil prices have rallied amid expectations the United States and China will reach a limited trade deal, helping the global economy to avoid a recession and supporting oil consumption in 2020.

Traders are also increasingly optimistic production growth from U.S. shale will slow next year as price cuts result in fewer new wells drilled.

Neither the trade deal nor the slowdown in U.S. shale output is certain, however, and there is a risk of the market getting ahead of itself.

Most hedge fund managers appear content to wait for a stronger signal about the talks before committing more money to the rally, and in a few cases betting on a short-term pullback.

With front-month Brent prices already up more than $5 per barrel (10%) since the start of October and $7 (13%) from their August lows, traders stopped buying and made minor sales in a few cases.

(Editing by Alexander Smith) ((john.kemp@thomsonreuters.com and on twitter @JKempEnergy))