Stream–orbit misalignment – II. A new algorithm to constrain the Galactic potential