I had the same problem with a hanging feeder and waterer near the fence. I used bungee cords to attach it to the fence. Then I gave up and put the waterer on a cinder block to get it off the ground, again with the bungee cord to hold it to the fence. The shape of the container matters too. If it's conical, the cord slides up. If it's more square shaped, the cord does a better job holding it flat to the fence.
If it's out in the middle of the run, you'll have to find another way to secure it. Maybe hang it from a tripod/teepee type of support, and attach it to the support legs. Something sturdy so that it can't get knocked or blown over. I was thinking of doing something like that, but like the space savings of using the fence as support.