After struggling for 18 months to gain a toehold in the commodity business, the American Stock Exchange is considering giving up and merging its American Commodity Exchange with the New York Futures Exchange, a subsidary of the New York Stock Exchange.

Executives of the two rival stock exchanges have held exploratory talks about combining their commodity operations and have discussed the possibility with officials of the Commodity Futures Trading Commission.

AMEX Chairman Arthur Levitt met yesterday with CFTC Chairman James Stone. Wall Street sources said the merger was the main thing they talked about.

Some declined to comment on the meeting, which was set up at Levitt's request. CFTC officials in the past reportedly have encouraged merger of the two operations.

Since it opened its trading floor a year and half ago, ACE has failed to attract much business. Last month its trading volume averaged barely 250 contracts a day, compared with 230,000 a day on the Chicago board of Trade.

Despite ACE's difficulties, the New York Stock Exchange has formed its own commodity subsidiary and hopes to begin trading this spring on its NYFE -- which is called "knife" in the trade.

Both ACE and NYFE specialize in financial futures rather than the traditional agricultural commodies.

ACE trades futures contracts in Government National Mortgage Assn. mortgages, U.S. Treasury bonds and Treasury bills.

NYFE has asked the CFTC to approve contracts in 90-day Treasury bills, 20-year Treasury bonds and five foreign currencies -- the British pound, the Canadian dollar, the German mark, the Japanese yen and the Swiss franc.

Officials of NYFE have said they hope to be in business by April 1, but the CFTC is not expected to act on NYFE's contracts until its April meeting.

In an interview, AMEX'S Levitt said he is "philosophically" in favor of merging the two exchanges. "Three exchanges are too many," he said. When NYFE opens its doors, New York will have four, counting the New York Mercantile Exchange and the Comex, Commodity Exchange, Inc.

Admitting that ACE is losing money, Levitt denied persistent rumors that the exchange will close. ACE members, he added, are willing to continue putting money into the operation if no merger is possible.

Under the merger that's being discussed, NYFE would in effect buy ACE's operations.

The trading floor that NYFE is building a few yards away from the Stock Exchange has six pits. Only three will be needed for the NYFE's initial operations.

NYFE has made several studies of taking over the ACE operations, each of them concluding that from a purely business point of view, it's not a good idea. NYFE will have substantial start-up costs and taking on the unprofitable ACE opertions will only add to the loses, the studies indicate. u

But Wall Street sources say there are compelling "nonbusiness" grounds for the merger. Public confidence in the futures markets might be hurt if ACE closed, but could be strengthened by a merger, they note.

AMEX chairman Levitt, who has taken the lead in the merger talks, is not formally in charge of ACE. Unlike NYFE, which is a wholly-owned subsidary of NYSE, ACE is only an "affiliate" of AMEX. AMEX and ACE have interlocking boards of directors; ACE's chairman is Elliott Smith.