NEW YORK — Stocks are edging higher in midday trading on Wall Street as investors welcomed earnings gains from major companies including Bank of America and the railroad operator CSX.

Investors were also encouraged by reassurance from Fed Chairman Ben Bernanke that there was no "preset course" for ending the bank's massive bond-purchasing program.

The Dow Jones industrial average inched up three points to 15,455 as of midday Eastern time Wednesday.

The Standard & Poor's 500 rose four points, or 0.2 percent, to 1,680. The Nasdaq composite rose five points, 0.2 percent, to 3,603.

Investors also bought bonds after Bernanke spoke. The yield on the benchmark 10-year Treasury note fell to 2.47 percent from 2.53 percent.

Toy maker Mattel sank 7 percent to $43.27 after its second-quarter income plunged 24 percent.