Does the headlight brightness swing with the ammeter swinging? If so, you may have a dirty connection. Or a short in your headlight wiring and the thermal overload protector in the headlight switch may be opening and closing. Or the overload switch itself could be bad. If your headlights have constant brightness while the ammeter swings, then I am at a loss right now to explain the ammeter movement.