1994 COUGAR XR7 stalling

I have a 1994 mercury Cougar 3.8l V6. What I have done replaced the MAF, TFI, fuel filter, plugs, wires, rotor, cap, Alternator, battery. The Problem. It will shut off unexpectedly. When ever it does this it will not restart most of the time, I have to disconnect the Battery then wait, it will start 95% of the time but sometimes I have to let it sit an hour or so. The mechanic says it will have to do it in shop for him to diagnose it, since disconnecting the battery clears the code. Sometimes when it restarts after this it begins to knock, but only for about 5-10 mins.This has happened twice. I noticed that oil gage drops a bit (fluctuates ) It has been sitting in my garage for a couple years because our states Emissions kept failing it. (It has since been repealed(Missouri)) I have taken it to the shop but it doesnt show codes.

Will a little pressure on the gas pedal keep it running?

yes, but it usually catches me off gaurd

Is this mechanic the one who threw all of those parts at the problem? You need another mechanic. There are a lot of checks which can be performed even without the major problem appearing.
I take it that the engine is cranking normally; but, isn’t firing? When the engine doesn’t start, check for spark from a spark plug wire. It can be tested, I suspect the ignition coil.

If opening the throttle plate just a tad is enough to keep it running or to start it, your Idle air control valve is probably going bad. You could try to clean it.

I think you may be on to it , It happened again last night. My neighbor and I pulled the wire from the coil. checked for a spark . Nothing. I visually inspected it this morning the rubber cover the protects one of the wire plugs is off to the side and the wire bundle from the fan was wedged through the coils wires, moved it. now to get this thing off. It looks fairly easy, but those Ford clips can break easily. Thanks for the suggestion hopefully this it.

no that was not it I had the Coil checked it was good , it has to be either to (stator) Distributor or the Control module

I’m betting that it only shuts down when it’s idling, correct?

You, my good friend, are losing oil pressure. It may be because the engine is worn out. That would cause the loss of pressure because the oil is flowing too easily through the spaces between the bearing surfaces where it is supposed to be maintaining a pressurized barrier. That knocking you hear is those poor bearing surfaces.

The condition of being worn out probably also means that it no longer has enough compression to keep itself idling. It just isn;t getting enough oomph from the combustion to keep rolling the parts over.

That worn out condition is probably also why it won’t pass emissions.

Try doing a compression test. I’ll bet you’ll get the answer to all your problems. That’s my guess.

What I’ve found out is I’m not getting a spark. Actually It will idle forever. But when I drive it may die. I put over 100 miles on it between Friday and Sat. Then it died pulling away from the house.
On the Emissions, they failed people repeatedly, you could get good mechanics and they could find nothing wrong with cars but they failed anyway and you would have to show that you spent $450 before they gave you your sticker. And all new cars Failed.

An ignition coil can check good; but, still be bad. The single ignition coil is cheap. Change it and watch the results.
When you pull away from a stop, it stalls? This could be a combination of dirty air intake track, which includes the air passage controlled by the idle air control valve (iac), and the throttle plate and bore.
Use a carb / throttle body cleaner, and generously spray the air intake tract with the cleaner. Let it soak a couple of hours. Start and run the engine at a fast idle. It’ll smoke out the exhaust.
When the gas pedal moves the throttle off idle, the tps (throttle position sensor) tells the engine computer. The computer orders the aic valve to allow more air into the throttle body, and it calls for more fuel. If the computer doesn’t get the signal and send the commands, or if the aic valve doesn’t respond, the engine power doesn’t increase immediately. It’ll lag until the oxygen sensor signals the engine computer that the air/fuel mix is too lean.
The tps needs to be checked (with a voltmeter) for a good, clean, dc output. The iac valve needs to be checked with a voltmeter on ac range.

It’s not the coil. I think it is either the control module or the Distributor (stator). I put new coil on and nothing. I want to get the heads done on this car but I’m chasing the this problem.

You still, still, haven’t revealed what the DTC (Diagnostic Trouble Code) is! The DTC has meaning. It could be a major player in finding what is wrong with the car.
Of course, you are using a digital multimeter and the repair manual to troubleshoot the problem, aren’t you (or, your mechanic is)?
So far, we’ve concluded that spark isn’t happening. There are several things which have to happen for spark to occur: The engine computer has to get timing signals from the sensors (VSS, cps, cks). It, then, orders the spark from the spark producers (such as the ignition coil, igniter, etc). The engine is at operating temperature when it stalls?
Some part isn’t operating properly when the engine is hot. Start with a hot engine, play a hair dryer around the ignition coil, igniter, and the VSS, Ckps, cps while the engine is running. Maybe, when you heat a certain component, the problem will occur.

I have the exact same car and it did the exact thing I found out after tinkering with it that the distributor had a bad switch inside it and it wouldn’t stay connected inside the unit so I pulled and replaced it and it worked.

it was not showing anycodes. I took it and had a computer diag on it.