Nowadays, Cardiovascular Magnetic Resonance (CMR) is gaining popularity in medical imaging and diagnosis. The acquisition of CMR images needs to be synchronized with the current cardiac phase to compensate the motion of the beating heart. The Electrocardiogram (ECG) signal can be used for such applications by detecting the QRS complex. However, the magnetic fields of the MR scanner contaminate the ECG signal which hampers QRS detection during CMR imaging. This paper presents a new real-time QRS detection algorithm for CMR gating applications based on the higher order statistics of the ECG signal. The algorithm uses the 4th order central moment to detect the R-peak. The algorithm was tested using two different databases. One database consisted of 12-lead ECGs which were acquired from 9 subjects inside a 3 T Magnetic Resonance Imaging (MRI) scanner with a total of 9241 QRS complexes. The 12-lead ECG arrhythmia database from the St. Petersburg Institute of Cardiological Technics (InCarT) served as the second database. 168341 QRS complexes were used from this database. For the ECG database acquired inside the MRI scanner, the proposed algorithm achieved a sensitivity (Se) of 99.99% and positive predictive value (+P) of 99.60%. Using the InCarT database, Se=99.43% and +P=99.91% were achieved. Hence, this algorithm enables a reliable R-peak detection in real-time for triggering purposes in CMR imaging.