  A strong candidate for a source of gravitational waves is a highly
magnetised, rapidly rotating neutron star (magnetar) deformed by internal
magnetic stresses. We calculate the mass quadrupole moment by perturbing a
zeroth-order hydrostatic equilibrium by an axisymmetric magnetic field with a
\emph{linked poloidal-toroidal structure}. In this work, we do \emph{not}
require the model star to obey a barotropic equation of state (as a realistic
neutron star is not barotropic), allowing us to explore the hydromagnetic
equilibria with fewer constraints. We derive the relation between the ratio of
poloidal-to-total field energy $\Lambda$ and ellipticity $\epsilon$ and briefly
compare our results to those obtained using the barotropic assumption. Then, we
present some examples of how our results can be applied to astrophysical
contexts. First, we show how our formulae, in conjunction with current
gravitational wave (non-)detections of the Crab pulsar and the Cassiopeia A
central compact object (Cas A CCO), can be used to constrain the strength of
the internal toroidal fields of those objects. We find that, for the Crab
pulsar (whose canonical equatorial dipole field strength, inferred from spin
down, is $4\times 10^8$ T) to emit detectable gravitational radiation, the
neutron star must have a strong toroidal field component, with maximum internal
toroidal field strength $B_{\mathrm{tm}}=7\times 10^{12}$ T; for gravitational
waves to be detected from the Cas A CCO at 300 Hz, $B_{\mathrm{tm}}\sim
10^{13}$ T, whereas detection at 100 Hz would require $B_{\mathrm{tm}}\sim
10^{14}$ T. Using our results, we also show how the gravitational wave signal
emitted by a magnetar immediately after its birth (assuming it is born rapidly
rotating, with $\Lambda\lesssim 0.2$) makes such a newborn magnetar a stronger
candidate for gravitational wave detection than, for example, an SGR giant
flare.
