It comes from a railroad term, 'highball'. A highball was a railroad signal that looked like a ball on an arm on a tower. When it was raised, it meant a clear track ahead. A trainmaster or brakeman could hold their arms high and move their hands in a circle for the same meaning. The Swedish farmers were known to wave an arm high over their heads and shout "hej" (hello) when greeting someone.