There are guidelines, but ask three cops what they are and you'll get three different answers. If they don't like what you are doing they can always cite you for reckless riding or, if you weren't reckless they can usually cite you for one (or both) of these:
Originally Posted by mototraveler
22107. No person shall turn a vehicle from a direct course or move right or left upon a roadway until such movement can be made with reasonable safety and then only after the giving of an appropriate signal in the manner provided in this chapter in the event any other vehicle may be affected by the movement.
22108. Any signal of intention to turn right or left shall be given continuously during the last 100 feet traveled by the vehicle before turning.
assuming you weren't 100% in one lane 100% of the time.