NEW YORK, OCT. 15 -- The Dow Jones industrial average rose 18 points today after erratic swings that swept the index to a 37-point loss at midmorning and a 37-point gain in the early afternoon.

The tug-of-war was primarily waged by traders who were bullish over oil losses and those who were bearish over an inauspicious beginning to the heavy flow of third-quarter corporate earnings.

Depressed oil prices buoyed the Dow all day as November crude futures opened almost $1-per-barrel lower. They briefly extended their loss to more than $2 per barrel and eventually settled down $1.74 at $37.95.

But generally sour third-quarter earnings reports proved an effective counterbalance to falling oil prices, especially after IBM reported net profit toward the low end of Wall Street expectations. IBM managed to rebound to only a 1-point loss at 99 1/4.

At the close, the Dow stood at 2416.34, up 18.32, but advances barely edged declines on the Big Board on moderate volume of 164 million shares. Broad market indexes lagged the blue-chip measures.

A mostly firm U.S. bond market, with the 30-year Treasury up 5/32 at the close, was supportive to stocks, as were higher equity prices overseas.

"The stock market is once again moving inversely to oil prices," said strategist Michael Metz at Oppenheimer, "but there are other factors here. Steady bonds is one, and although IBM earnings came in a little below expectations, there was no disaster."

Some traders said that part of the reason for the day's unnerving whipsaws in a 74-point Dow range is that the market is, with some difficulty, settling into what is likely to be its trading range over the next few weeks.

Among the groups showing leadership were telecommunications stocks -- after a glowing write-up on the Baby Bells in Barron's -- household products, foods, tobaccos, drugs and toiletries.

Earnings for the big banks were mildly supportive of the battered stocks. Security Pacific was up 3/8 at 20 at the close, J.P. Morgan rose 1 3/8 to 34 7/8, First Chicago posted a 3/4 advance at 15 3/4 and Chase Manhattan edged up 1/4 to 12 3/4.

The Dow transports finished up 2.59 at 832.29, while the utilities -- the only major index to post a gain last week -- rose 1.13 to 206.99.

Among broad stock indexes, the Standard & Poor's 500 rose 3.20 to 303.23 and the NYSE Composite gained 1.42 to 165.84. But secondary measures lagged. The Value Line added only 0.47 to 218.68, the Nasdaq rose 1.99 to 329.54 and the Amex Market Value lost 0.70 to 293.27.