Janet Yellen is turning from currency traders’ best friend to their biggest foe.

The most popular trade in the $5.3 trillion-a-day foreign-exchange market has been betting on a stronger dollar, leaving investors exposed when the Federal Reserve chairwoman damped speculation last month of an imminent increase to interest rates. As the dollar slowed its advance, an index of currency returns snapped a record winning streak, prompting traders to reassess how much higher the greenback can go.