When I was exiting the interstate, the transmission started clunking, banging, etc. then the Check Engine Light came on. This also happens when accelerating after being stopped at a red light. I found that when this happens, if I pull over and turn off my truck for a few minutes, then restart the engine, the clunking disappears. The dealership explained to me that a transmission valve had gone bad.
They could attempt to solve the problem, but without any guarantee. I had them do the repair, paid them, and two days later the problem returned. After that I returned to the dealership and that time they told me that my truck needed a new transmission. Instead, I flushed the transmission and then added Royal Purple Transmission fluid. The clunking and banging still exists. What can I do to get this problem permanently fixed?
Check for problem codes - you mention that the Check Engine Light is on. This could be the torque convertor clutch not releasing as you slow down, or not locking up smoothly when you reach 40-50 mph accelerating. And yes, the torque convertor lockup/release is actuated by a valve in the transmission. Take your truck to a reputable transmission repair facility and have them diagnose this issue.