Stable domain patterns in a chain of NiFe nanoelements have been investigated using finite element micromagnetic simulations. The solution of the Landau-Lifshitz-Gilbert equation provides the hysteresis curves as well as the dynamic response of the system subject to an external field. We have studied elliptical elements with a long axis of 165 nm, a short axis of 55 nm and a thickness of 10 nm. Due to the shape anisotropy and magnetostatic interactions neighboring elements spontaneously align their magnetization antiparallel, if the magnetization of the elements was initially parallel to the short axis. If the initial magnetization is antiparallel, the magnetostatic stray field stabilizes this configuration. If the elements are in contact with each other, the effect of domain wall magnetoresistance can be used for applications. Chains of six elliptic elements with contact faces have been investigated. For sufficiently small contact faces, the antiparallel domain pattern is maintained, even though there is exchange coupling between neighboring elements. For small contact faces the stability of the antiparallel pattern is shown and a switching field of 48 kA/m has been obtained. The switching fields can be tailored by the shape and size of the elements.