Electric dipole moment of the proton can be searched in an electric storage ring by measuring the spin precession rate of the proton beam on the vertical plane. In the ideal case, the spin precession comes from the coupling between the electric field and the electric dipole moment. In a realistic scenario, the magnetic field becomes a major systematic error source as it couples with the magnetic dipole moment in a similar way. The beam can see the magnetic field in various configurations which include direction, time dependence, etc. For instance, geometric phase effect is observed when the beam sees the field at different directions and phases periodically. We have simulated the effect of the magnetic field in the major independent scenarios and found consistent results with the analytical estimations regarding the static magnetic field cases. We have set a limit for the magnetic field in each scenario and proposed solutions to avoid systematic errors from magnetic fields.