Over the past years, coregistered EEG-fMRI has emerged as a powerful tool for neurocognitive research and correlated studies, mainly because of the possibility of integrating the high temporal resolution of the EEG with the high spatial resolution of fMRI. However, additional work remains to be done in order to improve the quality of the EEG signal recorded simultaneously with fMRI data, in particular regarding the occurrence of the gradient artefact. We devised and presented in this paper a novel approach for gradient artefact correction based upon optimised moving-average filtering (OMA). OMA makes use of the iterative application of a moving-average filter, which allows estimation and cancellation of the gradient artefact by integration. Additionally, OMA is capable of performing the attenuation of the periodic artefact activity without accurate information about MRI triggers. By using our proposed approach, it is possible to achieve a better balance than the slice-average subtraction as performed by the established AAS method, regarding EEG signal preservation together with effective suppression of the gradient artefact. Since the stochastic nature of the EEG signal complicates the assessment of EEG preservation after application of the gradient artefact correction, we also propose a simple and effective method to account for it.