Cyclothymia is a variant of bipolar disorder....and usually the mood swings are days to weeks......
Swinging between moods as quickly as you describe is called ultradian cycling---and is very rare.
There's also a heavy overlap with borderline personality, in which a person has problems with the prefrontal cortex----basically their body runs away with their emotions, as they have almost no breaks.....
There is another thing that could explain your symptoms.....I experienced very rapid super high and low mood swings for almost a year, and they cycled from high to low within minutes to a few days........it turned out my body has a lot of allergies I didn't know I had, and I'm also going to be tested for celiac disease---which is autoimmune, and not quite an allergy......
If I were you, I'd get a referral to see an allergist....we have no idea how much the foods we eat affect our moods....