Hey there and welcome! As always (you'll find out) I have some questions for you that might help us offer you some advice. Bear with me here! If I sound like I'm grilling you...I am (forgive me, I'm pre-med and, in the past year, have become all too knowledgeable about bowel disorders and diagnostic testing!).
What kind of doctor have you been seeing for this problem? Have they run any tests whatsoever on you? How long have you been experiencing the constipation (C) and diarrhea (D)? How severe are your symptoms (i.e. do they prevent you from any normal daily activities, or wake you from sleep)? Did they come on suddenly or gradually? Do you have any other symptoms, like abdominal pain, gaseousness, bloating, fevers, or bloody stools? Can I ask how old you are? Any family history of inflammatory bowel disease, cancer, or any other significant health problems?
It does sound like you have classic IBS symptoms from what you wrote. For your alternating D and C, I don't think Imodium would be your best bet, at least not long-term...only for those days you can't get off the toilet and need to be somewhere! One of our members, dbab, can attest to this; as I recall, years of Imodium therapy didn't end up being a good idea in her case. Have you tried fiber therapy with an over-the-counter powder or pill like Citrucel or Metamucil? This can help both D and C. If you have abdominal pain, there are anti-spasmodic medications like hyoscyamine and dicyclomine that can help minimize stomach contractions.
Welcome to the site, and I hope we can be of help to you.