U.S. energy companies this week added oil rigs for the first time in the past three weeks as drillers follow through on plans to spend more on E&P in anticipation of higher crude prices in 2018 than recent years.

That move higher came despite recent declines in U.S. crude prices, which are on track to fall for a fourth week in a row this week on worries trade tensions between the U.S., China and Europe could hurt oil demand.

Drillers added three oil rigs in the week to July 27, bringing the total count to 861, Baker Hughes, a GE company, said in its weekly report.

For the month, the oil rig count increased by three in July after losing one rig in June.

More than half the total oil rigs are in the Permian Basin in west Texas and eastern New Mexico, the nation’s biggest shale oil field. Active units there increased by four this week, bringing the total to 479, the same as in early June and the highest since January 2015.

The U.S. rig count, an early indicator of future output, is higher than a year ago when 766 rigs were active as energy companies have been ramping up production in anticipation of higher prices in 2018 than previous years.

So far this year, U.S. oil futures have averaged $66.11 per barrel. That compares with averages of $50.85 in 2017 and $43.47 in 2016.

Looking ahead, crude futures were trading near $68 for the balance of 2018 and about $65 for calendar 2019.

In anticipation of higher prices in 2018 than 2017, U.S. financial services firm Cowen & Co. this week said the E&P companies they track have provided guidance indicating a 13% increase this year in planned capital spending.

Cowen said those E&Ps expect to spend a total of $81.7 billion in 2018, up from an estimated $72.1 billion in 2017.

Analysts at Simmons & Co., energy specialists at U.S. investment bank Piper Jaffray, this week forecast average total oil and natural gas rig count would rise from 876 in 2017 to 1,033 in 2018, 1,092 in 2019 and 1,227 in 2020. That is the same as last week's expectations.

Since 1,048 oil and gas rigs were already in service, drillers would only have to add a handful of rigs during the rest of the year to hit Simmons’ forecast for 2018.

So far this year, the total number of oil and gas rigs active in the United States has averaged 1,009. That keeps the total count for 2018 on track to be the highest since 2014, which averaged 1,862 rigs. Most rigs produce both oil and gas.

The U.S. Energy Information Administration this month projected average annual U.S. production will rise to a record high 10.8 million barrels per day (MMbbl/d) in 2018 and 11.8 MMbbl/d in 2019 from 9.4 MMbbl/d in 2017.

The current all-time U.S. annual output peak was in 1970 at 9.6 MMbbl/d, according to federal energy data.