In this work we investigate the detectability of the gravitational stochastic background produced by cosmological sources in scenarios of structure formation. The calculation is performed in the framework of hierarchical structure formation using a Press–Schechter-like formalism. The model considers the coalescences of three kinds of binary systems, namely double neutron stars (NS–NS), the neutron star–black hole (NS–BH) binaries and the black hole–black hole (BH–BH) systems. We also included in the model the core-collapse supernovae leaving black holes as compact remnants. In particular, we use two different dark energy scenarios, specifically cosmological constant (Λ) and Chaplygin gas, in order to verify their influence on the cosmic star formation rate, the coalescence rates and the gravitational wave backgrounds. We calculate the gravitational wave signals separately for each kind of source and also determine their collective contribution for the stochastic background of gravitational waves. Concerning the compact binary systems, we verify that these sources produce stochastic backgrounds with signal-to-noise ratio (S/N) values ∼1.5 (∼0.90) for NS–NS, ∼0.50 (∼0.30) for NS–BH, ∼0.20 (∼0.10) for BH–BH and ∼0.14 (∼0.07) for core-collapse supernovae for a pair of advanced LIGO detectors in the cosmological-constant (Chaplygin gas) cosmology. Particularly, the sensitivity of the future third-generation detectors such as the Einstein Telescope (ET), in the triangular configuration, could increase the present S/N values by a high factor (∼300–1000) when compared to the S/N calculated for advanced LIGO detectors. As an example, the collective contribution of these sources can produce S/N ∼ 3.3 (∼1.8) for the Λ (Chaplygin gas) cosmology for a pair of advanced LIGO interferometers and within the frequency range ∼10 Hz–1.5 kHz. Considering ET we have S/N ∼ 2200 (∼1300) for the Λ (Chaplygin gas) cosmology. Thus, the third-generation gravitational wave detectors could be used to reconstruct the history of star formation in the Universe and to contribute for the characterization of the dark energy, for example, identifying if there is evidence for the evolution of the dark energy equation-of-state parameter w(a).