A cardiac stimulator is connected to a hemodynamic sensor to sense hemodynamic signals. An optimization module determines recommended AV and VV delays based on IEGM signals. A data processing module determines a delay control parameter for each preset AV delay and VV delay based on the collected hemodynamic signals for respective preset AV delay and VV delay, determines the AV delay setting that corresponds to the maximum delay control parameter and the VV delay setting that corresponds to the maximum delay control parameter, determines an AV delay error correction value as a difference between the AV delay corresponding to the maximum delay control parameter and a recommended AV delay, and determines a VV delay error correction value as a difference between the VV delay corresponding to the maximum delay control parameter and a recommended VV delay.