In this paper, we consider the application of optimal periodic control sequences to switched dynamical systems. The control sequence is obtained using a finite-horizon optimal method based on dynamic programming. We then consider Euler approximate solutions for the system extended with bounded perturbations. The main result gives a simple condition on the perturbed system for guaranteeing the existence of a stable limit cycle of the unperturbed system. An illustrative numerical example is provided which demonstrates the applicability of the method.