An implantable medical device is connected to a multipolar LV lead and an implantable sensor. The sensor signal from the sensor is used to identify a time point of mitral valve closure for a cardiac cycle when a ventricular pulse generator generates pacing pulses that are applied to the electrodes of the multipolar LV lead according to a pacing sequence. A time interval processor determines the time interval from onset of LV activation to the time point of mitral valve closure. This procedure is repeated for multiple different pacing sequences of a sequence set. The pacing sequence that resulted in shortest time interval is then selected by a selector as the currently optimal pacing sequence for the patient.