The shape memory behavior of a NiTi nanoparticle is analyzed by molecular dynamics simulations. After a detailed description of the equilibrium structures of the used model potential, the multi variant martensitic ground state, which depends on the geometry of the particle, is discussed. Tensile load is applied, changing the variant configuration to a single domain state with a remanent strain after unloading. Heating the particle leads to a shape memory effect without a phase transition to the austenite, but by variant reorientation and twin boundary formation at a certain temperature. These processes are described by stress-strain and strain-temperature curves, together with a visualization of the microstructure of the nanoparticle. Results are presented for five different Ni concentrations in the vicinity of 50%, showing for example, that small deviations from this ideal composition can influence the critical temperature for shape recovery significantly.