This is not as complex as it is being made out to be.
Aluminum does not influence a magnetic field, unless it has DC
current running through it. Anything with
current running through it does have a magnetic field unless it is AC or DC wrapped around the negative and positive conductors...and even then there will be some magnetic influence.
You DON'T want to put a
compass where there is DC current flowing, like a mast that has wires running through it unless you don't mind seeing two different headings when your mast lights are on versus when they are off. Or you dont mind seeing your heading reading swing wildly when you transmit on your masthead
antenna.
Put the
fluxgate below
deck as far away from the iron
engine and DC wires as you can get it. Being as close as possible to the
boats center of buoyancy is not all that critical...getting it way from DC wires and the
engine is very important in you want minimal corrections to you fluxgates deviation table. Deviation table corrections outside of 10 degrees are generally considered unacceptable.