A system for detecting myocardial ischemia includes an implantable device having one or more leads connected thereto, at least one electrode on a lead of the device, and a microprocessor in the implantable device. The electrode is configured to stimulate the heart. The at least one sensor is configured to measure a characteristic of blood in a coronary vessel. The microprocessor is programmed to: run a stress test on the heart by stimulating the heart with the electrode record data obtained from the at least one sensor during the stress test and determine whether there is myocardial ischemia based upon the recorded data.