The present invention relates generally to implantable medical devices and more particularly to systems and methods for stimulating a heart of a patient. At least one left atrial pressure, LAP, signal over a cardiac cycle is obtained. The A-wave is identified using the LAP signal and a maximum positive rate of change of the A-wave of the LAP signal is determined. The maximum positive rate of change of the A-wave corresponds to the rate which the pressure in the atrium raises as the atria contraction forces more blood into the ventricle during the very last stage of diastole. Further, AV and/or VV delay is adjusted in response to the maximum positive rate of change of the A-wave, wherein a reduction of the maximum positive rate of change of the A-wave indicates an AV and/or VV delay providing an enhanced hemodynamic performance.