  Two classes of high energy sources in our galaxy are believed to host
magnetars, neutron stars whose emission results from the dissipation of their
magnetic field. The extremely high magnetic field of magnetars distorts their
shape, and causes the emission of a conspicuous gravitational waves signal if
rotation is fast and takes place around a different axis than the symmetry axis
of the magnetic distortion. Based on a numerical model of the cosmic star
formation history, we derive the cosmological background of gravitational waves
produced by magnetars, when they are very young and fast spinning. We adopt
different models for the configuration and strength of the internal magnetic
field (which determines the distortion) as well as different values of the
external dipole field strength (which governs the spin evolution of magnetars
over a wide range of parameters). We find that the expected gravitational wave
background differs considerably from one model to another. The strongest
signals are generated for magnetars with very intense toroidal internal fields
($\sim 10^{16}$ G range) and external dipole fields of $\sim 10^{14}$, as
envisaged in models aimed at explaining the properties of the Dec 2004 giant
flare from SGR 1806-20. Such signals should be easily detectable with third
generation ground based interferometers such as the Einstein Telescope.
