TAKE A LOOK-What the U.S. tax plan means for financial markets

Dec 20 (Reuters) - Financial markets have been sensitive to the lengthy back-and-forth on the largest overhaul of the U.S. tax code in 30 years, with stocks reflecting the most optimism as investors look forward to a corporate windfall. For a factbox of what the U.S. tax bill contains: Here is a look at how investors in various markets and sectors are positioned:

STOCKS Anticipation of the tax plan passing has underpinned stocks all year as investors salivated over the potential boost to corporate earnings. Stocks have been highly sensitive to any newsflow about the plan and analysts have for months worried about a selloff if it were to fail.

-The fear of missing out has kept investors in stocks -2018 earnings forecasts are being adjusted sharply higher -Investors have increasingly priced in the tax cut -Investors size up tax reform after Democrats gain -Tax plan adds added wrinkle to seasonal tax-loss selling

SECTORS A corporate tax cut is expected to benefit certain sectors more than others, with domestically focused companies seen as the biggest winners because they typically have higher tax rates. The tax cut is expected to lift prospects in particular for banks, telecoms, transports.

-The stocks poised to win from tax cuts -Fuel for the already hot rally in automation companies -GRAPHIC-Banks, healthcare service firms among winners

DOLLAR Prospects of a tax break on companies' foreign earnings and expectations of wider U.S. budget deficits helped boost the dollar to its highest levels since 2002 soon after U.S. President Donald Trump's presidential victory in November 2016. But the currency faltered this year as Republicans struggled to make progress on their plans. Some have speculated that now could be a time for dollar bulls to reappear, but there is skepticism about how much of a lift the tax overhaul would give the greenback.

-Repatriation plan may not cure long-term dollar weakness -POLL-U.S. tax cuts to eventually underpin dollar

TREASURIES With the likelihood that the tax bill will be signed into law before Christmas, investors have been closing out curve-flattening trades, driving parts of the yield curve to their steepest levels in nearly three weeks. That said, the consensus among analysts is that longer-term flattening trend remains intact as the net impact of the tax overhaul would be unlikely to add more than a 0.5 percentage point to U.S. gross domestic product in 2018 and its intended stimulus effect would fade by 2019.

-Yields at nine-month high on tax growth optimism -Tax plan may stoke selling in long-maturity bonds

(Editing by Meredith Mazzilli)