LONDON (Reuters) - Investors are gaining confidence - up to a point - that 2018 will be the year of oil stocks.

FILE PHOTO: A oil pump is seen at sunset outside Scheibenhard, near Strasbourg, France, October 6, 2017 . REUTERS/Christian Hartmann

While shares in top energy companies have risen since mid-2017, they have failed to keep step with recovering crude markets, opening up a historically unusual performance gap. Big oil stocks have also underperformed broader equity indexes.

Uncertainty over whether the crude rally can stick and fears that advances in electric vehicles will undermine longer-term demand for oil still overshadow the sector.

But a brighter outlook for oil prices compared with the slump of 2014-15 - coupled with a revival in energy companies’ profits and cash generation after three years of brutal cuts - could mark a turning point, according to investors and a string of global banks.

“2017 was a challenging year for investors but there are now real opportunities in the energy sector,” said Olivia Markham, portfolio manager at BlackRock Commodities Income Investment Trust. She expects oil prices to rise gradually by 2020 as supplies tighten due to a dive in investment in recent years.

UBS, RBC and JP Morgan have put out strongly positive outlooks for the sector in recent weeks, while Barclays analysts predicted on Thursday that earnings for the European integrated oil stocks could grow 20 percent from the third quarter.

Optimists point to developments like Shell's RDSa.L raising in November of its cash flow outlook to $30 billion from $25 billion by 2020, assuming prices at $60 a barrel.

“Annus Mirabilis. Highest free cashflow in a decade bodes well for 2018,” Bernstein said in its outlook for European oil majors.

Figures for last year are grim, due largely to a dismal first half. The MSCI world energy index .dMIWO0EN00PUS, which tracks top oil stocks, gained just 1.3 percent even though Brent crude hit 2-1/2 year highs. Europe's oil and gas sector.SXEP, which includes Shell, Total TOTF.PA, BP BP.L and Eni ENI.MI, was the worst-performing in the region.

LITTLE CONVICTION

Oil majors' shares typically move in step with prices of the crude that they extract, but that correlation broke down last year. Since June, the MSCI index has gained 20 percent but Brent LCOc1 shot up 50 percent to around $68 a barrel, after OPEC and other major producers agreed to cut output.

The majors are set to cut spending on oil and gas exploration for a fifth year in a row in 2018, determined to maintain the capital discipline they imposed during the slump.

With production from U.S. shale deposits expected to increase sharply, scepticism remains over whether crude can stay at current levels.

“There’s little conviction on the oil price sustainability both from the market and from the oil majors because no one is touching capex plans or investment. Everyone is waiting to understand what’s going on,” said Angelo Meda, head of equities at Italian fund manager Banor SIM.

As well as slashing spending, the majors made tens of thousands of staff redundant and sold off assets to adapt to lower oil prices which, despite the recent gains, remain far below levels above $100 in 2011-14. Such savings have led to sharp increases in earnings in recent quarters.

Whether the sector can extend the share rally and close the performance gap in 2018 depends on a belief that majors can still prosper should oil prices fall back again.

“From here it’s a question of whether or not investors think something has really changed in the industry, that you can still have earnings improving even if the macro doesn’t help you out,” said Peter Hackworth, oil equity analyst at Goldman Sachs.

As well as the strong cash flow generation at the European majors, early signs of capital discipline among U.S. explorers and producers also point to a better picture for the sector this year.

Goldman predicts big oil firms will return 13 percent in 2018, ahead of a forecast 9 percent rise in the Brent price.

SCRAPPING THE SCRIP

One crucial component in winning back investors’ confidence is a return to paying dividends fully in cash. Offering the option of taking dividends in stock has saved the majors billions upfront but diluted their earnings per share.

Shell and BP have both made enough revenue in recent quarters to boost their payouts. Goldman Sachs estimates most big oil firms will have scrapped scrip dividends or made share buy-backs which offset the dilution in the next 12 months.

Average dividend yields of 5.5 percent will be more than covered by cash flow this year, Hackworth said.

But not all investors have yet accepted the message that current payout levels will continue.

“The market is still discounting these dividends as unsustainable whereas today, right now, they are sustainable. So I think the market is overreacting,” said Eric Moore, European income fund manager at Miton, who has been increasing his oil holdings in the past year.

Moore's fund holds BP, Shell, Statoil STL.OL, Eni and Premier Oil. PMO.L

Analysts have also been revising up their earnings forecasts since October after sharp downgrades earlier in 2017. Any uptick in mergers and acquisitions - noticeably absent as the majors concentrated on restructuring rather than purchases during the slump – could also boost the sector.

PEAK DEMAND?

Investors remain wary that oil demand may peak due to eventual mass adoption of battery-powered cars and more curbs on fossil fuel emissions by industry to meet environmental targets.

“Electric vehicles and government policies on carbon have led investors to question the longer-term outlook for oil,” Blackrock’s Markham said.

Some are hedging their bets, buying shares in battery companies and chipmakers involved in making electric cars while lessening their exposure to pure oil plays.

But the shift to cleaner energy doesn’t necessarily mean investors are dumping the oil majors. Many are sticking with them but favoring companies which put more emphasis on renewables.

Nick Davis, European income fund manager at Polar Capital, said he prefers Total, which is investing more in gas as well as venturing into battery and solar power.

But in the shorter term, and with the electric vehicle picture still unclear, stocks do not yet fully price in these risks, analysts said.

Evercore ISI analyst Doug Terreson said cash preservation remains the key for investors focusing on returns more than growth. For him, BP, Shell, Chevron CVX.N and ConocoPhillips COP.N offer the best proposition in 2018, he said in a note.

“The historical investment model which assumed that higher oil prices would always lead to higher share prices in energy appears disrupted. It failed in 2017 and will again in 2018, in our view.”

GRAPHIC - Oil prices and energy shares: here