The effect of Hamiltonian symmetry on generation of odd and even harmonics