I used top rail for my anemometer. It goes about 12 feet above my roof peak. Mine was simple galvanized rail.
What i did to combat sway, I filled about a foot of the lower end with closed cell dense spray foam. I let that set up a good 24 hours. I then filled the top rail with sand. Left about 6 inches at the top to cap it with closed cell foam again. Then I used some good sealing foil tape to top it off to try and prevent UV damage to the foam, keeping it hopefully sealed.
All that mass from the sand greatly reduced the swaying frequency. And it really didn't add as much weight as you'd think.