NEW YORK, JULY 30 -- The Dow Jones industrial average rose 18 points today after tumbling 23 points at the outset. Computerized program trading whipped the market swiftly lower at the outset and sharply higher in the last hour of trading, traders said.

Lower foreign equity markets and a sell-off in UAL Corp. -- on evidence that its long-suffering, employee-led buyout is once again disintegrating -- helped undermine the early market.

But there was little question among traders that, without index-arbitrage sell-programs at the opening and four waves of buy-programs in the last hour, the Dow would have languished in a 12-point range all day.

At the close, the Dow stood at 2917.33, up 18.82, but New York Stock Exchange declines, which ran well ahead of advances for most of the day, ended just a small margin ahead on moderate volume of 146 million shares.

''It was a tough day to trade,'' said equities trader Dan Murphy at C.J. Lawrence. ''People were still digesting last week's economic figures, and they were also taking a very hard look at those artificial rallies we've had that were entirely off the oil issues.

''I think we're going to see a nervous, volatile tape, with intraday movement increasingly driven by program trading, not by real supply and demand,'' he said.

Rebounds in some individual stocks helped alleviate market fears. Key were Disney, which opened flat but finished up 1 7/8 at 117 7/8 after its 5-point, earnings-related tumble on Friday. HomeFed, another phoenix, gained 1 3/8 to 11 3/8 on a bounce from last week's sharp losses.

Among Dow components, Boeing, soft all day, dropped 5/8 to 58 5/8 but trimmed a full-point morning loss. Alcoa rose 1 3/4 to 69 5/8, while the Dow's prominent oil stocks once again chipped in to help rally the index. Chevron rose 1 3/4 to 79, Texaco gained 1 3/8 to 62 7/8 and Exxon tacked on 1 1/2 to 50 3/4 as September New York crude oil futures rose 17 cents to $20.21 per barrel.

But among the airline stocks, prospects of rising fuel prices undermined price structures, beyond the damage that may have been caused by spillover selling on the news that Chemical Banking Corp. had withdrawn its part of the financing for the employee buyout of United Airlines. UAL, United's parent firm, fell 6 1/8 to 156 7/8.

When a United buyout deal last fell apart, on Oct. 13, 1989, the stock market plummeted 190 points on fears that the 1980s ''takeover fever,'' a strong underpinning of the post-1987 crash market, was history.

''It's not so much the fact that the UAL deal itself looks to be in jeopardy,'' said chief trader Kenneth Ducey at S.G. Warburg. Instead, the market is clearly unsettled by the perceptions that banks have become much more tightfisted than recent Federal Reserve policy has warranted and that, given the mood of restraint in banking, the Fed may not have the control it needs to forestall a full-blown recession, Ducey said.

Among the Dow transports, the only prominent exception to lower prices was Union Pacific, up 2 1/4 at 75 3/4. The transports finished down 9.66 at 1125.01. The utilities, however, took the bond-market rally to heart and surged 3.71 to close at 207.06.

Among broad stock indexes, divergences between blue-chip and secondary indexes were striking. The Standard & Poor's 500 was up 2.11 at 355.55 and the NYSE Composite rose 0.86 at 194.18, but the Value Line closed down 0.64 at 278.85, the Amex Market Value fell 1.84 to 353.65 and the Nasdaq Composite skidded 3.21 to 439.38.