A tracking device for an intramedullary pin whose spatial position is determined and/or tracked in image-guided surgery, including a reference device at a proximal end of the intramedullary pin and a medical navigation system which locates the reference device and determines the orientation of the intramedullary pin from the proximal end. A deformation detection device detects deformations of the intramedullary pin and communicates the deformations to the navigation system. Also provided is a tracking method for determining or tracking the spatial position of an intramedullary pin in image-guided surgery, and to an intramedullary pin that includes a deformation detection device.