Electric wiring for arduino and hydraulic valves

Back up one step. How do your relays operate? Do they close and send 12 volts to the hydraulic valve when the control signal is low or 0? Or do the relays close and send 12 volts when the control signal is high or 1?

That information is the ultimate control for how your program MUST behave.

Paul