We have similar codes--a 220 line cannot have a cord longer than 3'--if the pump is hard-wired. Less clear if you have a twist lock. The pump's power hookup cannot be closer than 5 ' to the pool.

There are do-it-yourself latches and hinges from a company called "MagnaLatch" that puts the control for the latch 5' off the ground--that' code. Here's what my gate looks like--the hinges are self-closing, the latch is self-latching:



It works EXTREMELY well. I did the install myself--well, I did build the gate and fence, too.

The latch uses gravity and magnets--no springs.