2000 ford ranger xlt 4x4 with engine problems?

It also has a 3.0l v6. I have posted a few times about it. Anyways, it pings like hell when it is above idle speed. I thought it might be the crankshaft sensor or the knock sensor. The check engine light is on and it has a slight miss at idle. I have changed plugs, wires, oil, filter, and added injector cleaner, high octane fuel, and a lucus oil additive. It is quite at idle now, but at higher rpms 2-4000, it pings like crazy. What's going on? Bad sensor? I took it to a shop to get the cel read and it came up as an unreadable code…

Take it to Ford Dealer and have them decode the light and fix it. I would suspect the egr valve.