Newly born massive magnetars are generally considered to be produced by binary neutron star (NS) mergers, which could give rise to short gamma-ray bursts (SGRBs). The strong magnetic fields and fast rotation of these magnetars make them promising sources for gravitational wave (GW) detection using ground based GW interferometers. Based on the observed masses of Galactic NS-NS binaries, by assuming different equations of state (EOSs) of dense matter, we investigate the stochastic gravitational wave background (SGWB) produced by an ensemble of newly born massive magnetars. The massive magnetar formation rate is estimated through: (i) the SGRB formation rate (hereafter entitled as MFR1); (ii) the NS-NS merger rate (hereafter entitled as MFR2). We find that for massive magnetars with masses $M_{\rm mg}=2.4743 M_\odot$, if EOS CDDM2 is assumed, the resultant SGWBs may be detected by the future Einstein Telescope (ET) even for MFR1 with minimal local formation rate, and for MFR2 with a local merger rate $\dot{\rho}_{\rm c}^{\rm o}(0)\lesssim 10$ ${\rm Mpc}^{-3}{\rm Myr}^{-1}$. However, if EOS BSk21 is assumed, the SGWB may be detectable by the ET for MFR1 with the maximal local formation rate. Moreover, the background spectra show cutoffs at about 350 Hz in the case of EOS BSk21, and at 124 Hz for CDDM2, respectively. We suggest that if the cutoff at $\sim100$ Hz in the background spectrum from massive magnetars could be detected, then the quark star EOS CDDM2 seems to be favorable. Moreover, the EOSs, which present relatively small TOV maximum masses, would be excluded.