Target detection and tracking based on single-pixel detectors enable high-speed and long-duration monitoring of fast-moving targets, showing great potential in various applications. However, traditional coding strategies based on digital micromirror devices (DMD) are significantly limited in refreshing speed and spectral response range, hindering their widespread use. Here, we propose an ultrafast and wide-spectral single-pixel tracking approach, which utilizes composite grating patterns encoded onto a spinning mask. By leveraging the continuous properties of coded phase and the wide-spectral transmission of photomasks, we experimentally demonstrate that this method can achieve single-pixel tracking at a speed of 400 kHz, covering a broad spectral range from ultraviolet to near infrared. We believe this cost-effective approach will promote the practical application of the single-pixel tracking technology in fields such as cytology, smart transportation, and others.