The undulating fin exhibits two distinct motion modes: undulation and oscillation. However, the hydrodynamic performance during oscillatory motion has been rarely reported. In this study, numerical simulations were conducted to investigate the effects of factors such as the undulating angle, oscillation angle, and oscillation frequency on the hydrodynamic performance of the undulating fin during oscillatory motion. The mechanism of undulating fin oscillation was elucidated through flow field analysis. The results demonstrate that the undulating fin achieves unilateral movement during a single oscillation cycle. The hydrodynamic performance in the X-direction exhibits non-sinusoidal characteristics and shows a positive correlation with the undulating angle. In contrast, the hydrodynamic performance in the Y-direction correlates positively with both the oscillation angle and frequency. The hydrodynamic performance in the Z-direction is closely related to the vortex shedding position. Positive thrust is generated when the vortex sheds from the outer side of the undulating fin. This study provides novel insights and motion strategies for underwater locomotion of robots equipped with undulating fins.