Sex and high risk issues

Melissa • I`m a newlywed who just got married August 23, 2014. My hubby and I have officially been together for 4 years and are trying for our rainbow baby. We lost our first at 8 weeks in December. <3
My dr said sex can't cause a miscarriage, but why do some doctors tell us not to have sex for awhile? I am high risk...lost my first baby at 8 weeks. It was right after we heard the heartbeat and decided it was ok to have sex again. I then had a chemical in april in which we were quite active when I thought I was pregnant. Now I don't want anything to do with sex...worried it can really cause complications. Just wondering it there is any research on it...