Use a sequestrant, not shock, for metal staining
Use a metal sequestrant and stop shocking with chlorine until the metals are under control.
The staining happens because chlorine oxidizes dissolved iron or copper, turning them into solids that settle on surfaces. A sequestrant (chelating agent) binds those metals so they stay dissolved and don’t react with chlorine. Add it according to the label, and keep your chlorine levels low for a day or two.
If you already have stains, you can remove them with ascorbic acid (vitamin C) first. Drop the pH to around 7.0, broadcast the ascorbic acid, brush, let it circulate, then add sequestrant after the stains disappear. After that, raise pH back to normal and balance chlorine carefully.
The real fix is preventing more metal from getting in. Check your fill water for iron or copper. If you have copper-based algaecides, stop using them — copper is usually the culprit. For iron, a phosphate-based sequestrant works best.
Get a decent metal test kit so you know what you’re dealing with. It’ll save you from guessing.