Using the concept developed in earlier papers, that the cosmic rays originate in three different main sites, a) the normal supernova explosions into the interstellar medium, b) the supernova explosions into a stellar wind, and c) powerful radio galaxies, we demonstrate in this paper that the spectrum and chemical abundances above 104 GeV can be well understood. Using existing data on the chemical composition of cosmic rays near TeV energies as a constraint, we adjust the parameters of the model to fit the shower size data from the Akeno experiment; this is necessary since the derivation of an all particle spectrum involves an assumption about the chemical composition of the cosmic rays and so we have to fit the shower size data first and then derive the all particle spectrum. We present a successful fit to the shower size data which allows us to draw three main conclusions: a) For most of the energy range above 105 GeV the wind explosions can account for both chemical composition and spectrum including the knee feature, b) the highest particle energies required from the stellar wind explosions imply a magnetic field in the preexisting stellar wind of at least 3 Gauss at a fiducial distance of 1014 cm, c) the chemical abundances above 105 GeV are dominated by heavy nuclei such as Neon and higher. The bump observed in the all particle spectrum below the knee gets weakened with the proper treatment of the energy dependent chemical composition. At the high energy end we obtain an estimate of the extragalactic flux of protons.