2004 Ford F150 5.4L (Automatic)

My car engine stalled and displayed “Check Gauges”. It starts well all the time but keeps switching off every 20 or so yards. I have changed both the fuel filter and the fuel pump but the problem persists. Please tell me what can possibly be the fault.