NEW YORK (Reuters) - Wall Street posted record closing highs on Wednesday, driven by strong earnings, while U.S. Treasuries declined in price as investors focused on monetary policy and the dollar snapped a four-day rally.

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., October 16, 2017. REUTERS/Brendan McDermid

Long-dated U.S. Treasury yields rose and yields on the 2-year Treasury note US2YT=RR hit their highest level since November 2007, as investors bet on tighter global monetary policy.

All three Wall Street major indexes posted record closing highs. Strong earnings from International Business Machines Corp IBM.N helped the Dow Jones Industrial Average close above the 23,000 milestone for the first time.

“People are of the mindset that there is no alternative to equities and therefore they’re continuing to pour into them,”

said Ian Winer, head of equities at Wedbush Securities in Los Angeles.

The Dow Jones Industrial Average .DJI rose 160.16 points, or 0.7 percent, to 23,157.6, the S&P 500 .SPX gained 1.9 points, or 0.07 percent, to 2,561.26 and the Nasdaq Composite .IXIC added 0.56 points, or 0.01 percent, to 6,624.22.

MSCI's gauge of stocks across the globe .MIWD00000PUS gained 0.15 percent.

Investors focused on global economic strength and expectations for a gradual monetary policy tightening as they waited for signals that the European Central Bank would buy fewer bonds, said Paul Christopher, head global market strategist at Wells Fargo Investment Institute in St. Louis.

“That’s equivalent to taking your foot a little bit off the gas but not hitting the brake,” he said.

Benchmark 10-year notes US10YT=RR last fell 12/32 in price to yield 2.3411 percent, from 2.298 percent late on Tuesday. The 30-year bond US30YT=RR last fell 29/32 in price to yield 2.8483 percent, from 2.803 percent late on Tuesday.

Short-dated notes added to selling after comments from New York Fed President William Dudley, who sounded supportive of Fed Chair Janet Yellen’s weekend comments that the Fed was likely to continue its path of U.S. interest rate increases.

While the dollar found some support from higher U.S. Treasury yields, the greenback, as measured against six other major currencies, reversed from a small gain to a small decline in afternoon trading.

The dollar index .DXY fell 0.08 percent, with the euro EUR= up 0.22 percent to $1.1792.

The dollar index may have hit technical resistance at around the 93.80 level, which could have restrained the currency’s rise at least in the near term, Eric Viloria, currency strategist at Wells Fargo Securities in New York, said.

“I think we are looking at generally consolidative movement in the U.S. dollar,” he said.

In commodity markets, Brent oil prices retreated from three-week highs reached earlier on Wednesday, after a surprising fall-off in U.S. refining runs and an unexpected increase in inventories of gasoline and diesel.

U.S. crude CLcv1 rose 0.31 percent to $52.04 per barrel and Brent LCOcv1 was last at $58.20, up 0.55 percent on the day.

Gold fell for a third straight session as investors favored riskier bets. Spot gold XAU= dropped 0.3 percent to $1,280.90 an ounce.