LONDON/NEW YORK (Reuters) - After an unexpected rally that carried the dollar to 18-month peaks and saw it end 2018 as investors’ top trade, the currency faces challenges in the coming year.

An employee counts U.S. dollar banknotes at a currency exchange office in Jakarta, Indonesia October 23, 2018. Picture taken October 23, 2018. REUTERS/Beawiharta

They include an expensive valuation, a flagging equity boom, waning cash repatriation by U.S. companies, and the possibility that the U.S. Federal Reserve will not raise interest rates as many times as signaled.

Hence the prediction in a Reuters poll this month that the dollar will end 2019 around 5 percent below current levels..

That flies in the face of the current trend, with futures showing dollar positioning near historical highs.

Furthermore, the Bank of America Merrill Lynch’s monthly investor survey shows the greenback regaining the “most crowded trade” crown from the FAANG tech stocks group.

But the wheels have come off that investor bandwagon in recent years, as big bets have misfired on Bitcoin, tech and... the dollar, which markets had heavily bet against in late-2017.

(Graphics on 'USD and CFTC' - tmsnrt.rs/2A1CHPj)

(Graphics on 'Most crowded trade' - tmsnrt.rs/2R9NaSj)

“From a positioning perspective, the scope for the dollar to rally significantly is not there unless you see growth in the rest of the world really weakening and the United States continuing to be strong,” said Eugene Philalithis, portfolio manager at Fidelity International.

On the economic front, jobs and housing data suggest a decade-long U.S. recovery is losing traction and a flattening bond yield curve is flashing the classic recession warning.

While the Fed raised interest rates in December and signaled it would stay the course on policy tightening, money markets reckon otherwise.

(Graphics on 'US yield spread and recession' - tmsnrt.rs/2RuCkDH)

Then there is valuation.

Even before the dollar rally began in April, it was overvalued compared to historical averages against the currencies of trade partners and adjusted for inflation (REER). Now it is 12 percent more expensive than its 10-year average on that basis.

Other currencies including the British pound and some emerging heavyweights look significantly undervalued - the Turkish lira and Brazilian real by around 20 percent.

(Graphics on 'REER valuations' - tmsnrt.rs/2RhJ6fA)

(Graphics on 'U.S. housing starts and building permits' - tmsnrt.rs/2RpOcGG)

(Graphics on 'U.S. inflation breakevens and interest rates' - tmsnrt.rs/2GDjVDs)

But if odds are stacked against the dollar, why have investors rushed to embrace it as 2018 ends?

The Dollar Smile theory, put forward by former Morgan Stanley strategist Stephen Jen, offers an explanation.

It says the dollar strengthens as risk aversion grows - as is happening now - because investors rush for safe, liquid assets. It would then weaken as growth flags - the bottom of the smile - before rising again as the economy recovers.

Indeed Jen, now CIO at hedge fund Eurizon SLJ, considers cash dollars the best investment going into 2019.

But clouds are gathering over the broader economy too. This month’s BAML poll showed investors at their most pessimistic on global growth since the 2008 financial crisis.