In this paper, a heuristic algorithm based on particle-in-cell (PIC) simulation is introduced to investigate the harmonic generation during the ionization and formation of plasma by a non-relativistic laser field when it propagates through hydrogen atoms. The harmonic generation is considered for the radiative recombination of an ionized electron with its nearest ion. The ionization algorithm is improved by considering the Stark effect and nonzero velocity for ionized electrons. Energy conservation is evaluated during the recombination process. In our code, for the first time, Maxwell's equations are integrated for harmonic fields in a separate mesh using the artificial recombination current as a source term. The simulation results are then used to illustrate the intensity spectrum of generated fields. It is shown that the initial momentum of ionized electrons affects the harmonic spectrum because the energy of radiated photons varies with the electron energy.