An active medical device such as pacemaker, defibrillator and/or resynchronizer with automatic optimization of atrioventricular delay is disclosed. The active medical device is adapted for analyzing a signal delivered by a hemodynamic sensor such as an endocardial acceleration sensor, whose variation according to the AVD is represented by a sigmoid function. An optimal AVD is searched by: applying a reference AVD (XC), at least one left AVD (XL, XLL) and at least one right AVD (XR, XRR); measuring the corresponding hemodynamic parameters (Y1, Y2, Y3, Y4, Y5); evaluating the second derivative of the function at the respective points (XC, Y3; XL, Y2, XR, Y4) of the characteristic corresponding to the reference AVD, to the left AVD and to the right AVD; estimating from these values of second derivatives, the position of an intermediate point of the characteristic for which the second derivative is zero or minimum, and determining the corresponding AVD for that intermediate point as the optimal AVD.