* Nikkei pares morning gains as Shanghai dips
* Losses limited after upbeat results from JPMorgan
* Commodities prices lift shares of miners, trading houses
By Antoni Slodkowski
TOKYO, Jan 17 (Reuters) - Japan's Nikkei average gave up earlier gains to go flat on Monday, reflecting a slump in Chinese equities after the People's Bank of China hiked lenders' required reserves.
The Nikkei was stuck in a tight range as energy-related stocks gained on higher oil prices, but there was a fall in construction machinery makers with big exposure to China, such as Komatsu Ltd <6301.T>.
"Both the Shanghai and Hong Kong markets opened lower on Monday, souring the mood on the Nikkei. The CPI figures due on Thursday are also making markets a little jittery," said Hideyuki Ishiguro, a supervisor in the investment strategy section of Okasan Securities.
Although economists polled by Reuters said China's consumer price index may show a cooling of inflation from November's 28-month highs, they also reckoned any slowdown in inflation would likely be temporary. [
]Komatsu, which relies on China for about 20 percent of its sales of construction, mining and utility equipment, shed 1 percent to 2,513 yen and Hitachi Construction Machinery <6305.T> was 1.2 percent lower at 2,019 yen.
"But it's not all bad news on the Nikkei with the downside limited as investors are encouraged by a strong start to the earnings season in the U.S. and are waiting for more big firms to show strong results," Ishiguro said.
Results from Apple <AAPL.O>, due on Tuesday, are a key immediate focus for the market. Economic bellwether General Electric <GE.N> as well as big tech names such as Google <GOOG.O> and eBay <EBAY.O> are also due to report.
The benchmark Nikkei <
> rose earlier on stronger earnings than expected from JPMorgan <JPM.N>. By afternoon it was up 5.66 points at 10,504.70.On Friday it fell 0.9 percent after a surprisingly weak settlement of options for January.
Resistance for the benchmark now looms at 10,620.57, an eight-month high hit last week. If that level is breached, the next target investors are eyeing is 10,638.23, a high hit in May last year.
The broader Topix index <
> shed 0.1 percent to 929.65.FOREIGNERS SET TO KEEP BUYING
The Nikkei has climbed 2.6 percent this year and is up 15 percent since the start of November -- a rally driven by foreign funds, which have boosted their stance on Japanese stocks to neutral from underweight.
"Foreign buying will probably continue further as expectations for Japanese firms to post strong results have been heightened by robust U.S. earnings," said Fumiyuki Takahashi, an equity strategist for Barclays Capital Japan.
"Foreigners have been buying domestic demand-related shares like banks and property recently, but they may switch back to exporters if the yen stays stable and if we see some more solid earnings announcements in the U.S. high-tech sector."
Higher prices of commodities, with Brent crude rising above $99 a barrel on Friday, helped shares of trading houses and other oil-related companies. Inpex Corp. <1605.T>, Japan's top oil and gas developer, gained 0.5 percent to 489,500 yen.
Shares of non-ferrous metals smelters also rose as benchmark three-month copper on the London Metal Exchange <CMCU3> jumped to $9,679.50 a tone in Asia on Monday from $9,650 on Friday. Dowa Holdings Co <5714.T> advanced 1.6 percent to 558 yen.