You are thinking in the right direction, but what happens if there are an even number of remaining buckets and the one you have to pick from starts with only one ball? A small tweak to your strategy will fix the problem.
Added: Note that your strategy has the same player (you) playing first in each bucket. You do that by ensuring that each bucket takes two turns to empty. As long as there is more than one ball in each bucket to start it works fine. A bucket with a single ball only permits one turn, so ruins your strategy. You want to start if there are no buckets with a single ball. If there is one bucket with a single ball, you want to start the bucket just after it, so you want your opponent to take the single ball. That means you want to start the bucket just before the single ball so you can empty it in one turn. You don't want to finish the bucket two before the single ball because then your opponent wins. As long as there are not two single ball buckets in a row, you win by taking all but one ball unless the bucket is just before a single, in which case you take them all. If there are two single ball buckets in a row, they cancel out because each will take exactly one turn and you can ignore them.