The invention relates to a system for electrical and/or magnetic neuronal stimulation, comprising a signal generator for generating a stimulation signal, in particular an alternating-current stimulation signal, an applicator for applying the stimulation signal, in particular in an area on or directly around the optic nerve, a lead for deriving a measurement signal, in particular an EEG signal, a biomarker calculation unit for calculating a biomarker based on the measurement signal, and an optimization unit, in particular for performing a stochastic optimization process, for optimizing the value of the biomarker by varying the stimulation signal.