Shimmying is a symptom rather than a single disease, and an indication that a fish no longer has proper control of its nerves and muscles. It occurs when fish are under severe stress, most often because of environmental problems.
The classic scenario is when mollies are kept in soft or acidic water conditions. Though tolerant fish in many ways, they do not do well in soft or acidic water, and it is very common to see mollies kept that way start to shimmy. To varying degrees, almost all the other livebearers sold to hobbyists are sensitive to soft or acidic water conditions, and consequently the shimmies may be seen among any of them kept in the wrong water conditions.
Cold water conditions can have the same effect on tropical fish as well, with cichlids in particular being extremely sensitive to even short-term exposure to cold water. Poor water quality can also trigger the shimmies, as can other sorts of poisons such as copper. Certain bacterial and protozoan diseases, such as
finrot, mouth
fungus, and slime
disease, seem to be associated with the shimmies as well.