A medical system comprising: three electrode pairs to be arranged at or within a human being or animal; an excitation means, including electric field excitation signal generators, connected to the electrodes and adapted to apply alternating excitation signals at preset frequency to the electrodes of the electrode pairs to generate electric fields through the heart between electrodes of respective electrode pair; a signal receiving means; a signal controlling and processing means, characterized by: an implantable heart stimulator provided with sensing and stimulating heart electrodes and adapted to generate a signal representing the voltage potential difference between the voltage potential of at least one of the heart electrodes used as detecting electrode and a reference electrode, wherein the voltage potential is related to the generated electric field, the implantable heart stimulator comprises a telemetry unit adapted to wirelessly communicate the signal to the signal receiving means, which is adapted to generate a potential difference signal that is applied to the signal controlling and processing means that is adapted to process the detected potential difference signal in order to determine parameters representing heart wall movement; and a microprocessor for determining, based on the parameters representing heart wall movement, optimal settings of AV-delay, VV-delay or stimulation rate of the implantable heart stimulator resulting in the most favourable heart wall movement. three electrode pairs to be arranged at or within a human being or animal; an excitation means, including electric field excitation signal generators, connected to the electrodes and adapted to apply alternating excitation signals at preset frequency to the electrodes of the electrode pairs to generate electric fields through the heart between electrodes of respective electrode pair; a signal receiving means; a signal controlling and processing means, characterized by: an implantable heart stimulator provided with sensing and stimulating heart electrodes and adapted to generate a signal representing the voltage potential difference between the voltage potential of at least one of the heart electrodes used as detecting electrode and a reference electrode, wherein the voltage potential is related to the generated electric field, the implantable heart stimulator comprises a telemetry unit adapted to wirelessly communicate the signal to the signal receiving means, which is adapted to generate a potential difference signal that is applied to the signal controlling and processing means that is adapted to process the detected potential difference signal in order to determine parameters representing heart wall movement; and a microprocessor for determining, based on the parameters representing heart wall movement, optimal settings of AV-delay, VV-delay or stimulation rate of the implantable heart stimulator resulting in the most favourable heart wall movement. an implantable heart stimulator provided with sensing and stimulating heart electrodes and adapted to generate a signal representing the voltage potential difference between the voltage potential of at least one of the heart electrodes used as detecting electrode and a reference electrode, wherein the voltage potential is related to the generated electric field, the implantable heart stimulator comprises a telemetry unit adapted to wirelessly communicate the signal to the signal receiving means, which is adapted to generate a potential difference signal that is applied to the signal controlling and processing means that is adapted to process the detected potential difference signal in order to determine parameters representing heart wall movement; and a microprocessor for determining, based on the parameters representing heart wall movement, optimal settings of AV-delay, VV-delay or stimulation rate of the implantable heart stimulator resulting in the most favourable heart wall movement.