Based upon patient studies indices a high degree of correlation was found between HRV and VO2.sub.max, i.e., the patient's exercise capacity. Based on this finding, a pacing therapy optimization protocol for treating patients with CHF has been devised. The protocol involves first pacing the patient's heart with a pacemaker programmed to operate in a first mode for a predetermined time period and then collecting electrogram data from which a HRV index is derived. The mode is then changed and the steps repeated until all possible modes have been utilized. At that time, a determination is made as to which of the modes is associated with the largest HRV index and the pacemaker is then programmed to function in that mode. Alternatively, the method of the present invention can be applied to changes in drug therapy instead of or in combination with pacing therapy.