Pseudonoise (PN) code tracking loops are essential in various direct‐sequence spread‐spectrum (DSSS) systems for both, communication and navigation applications. This paper shows how to optimize the so‐called modified code tracking loop (MCTL) of first‐ and second‐order by using the mean time to lose lock (MTLL) as a performance criterion. The state equation of the first‐order MCTL is related to the Smoluchowski ‐ Kramers approximation of a second‐order system described by the Langevin equation of motion. For such a specific system, the MTLL is known by the work of Kramers. In case of the second‐order type II loop (having two perfect integrators), which cannot be described by the Langevin equation, the computation of the MTLL is based on the singular perturbation method. Optimal parameters maximizing the MTLL under the constraint of Doppler effects and the channel noise are derived for both type of loops, resulting in very simple expressions that can be used immediately for a practical loop design. Measurements performed for the first‐order MCTL verify the theoretical optimal loop parameters and indicate that the time to lose lock is exponentially distributed. Monte Carlo simulations confirm also very well the theoretical results in case of a second‐order loop and hence, show that the application of the singular perturbation method yields an excellent approximation of the MTLL.