My doctor said no sex

Ok so I'm 24 weeks and high risk. My first pregnacy it was full term my second my water broke at 29 weeks but was able to make it to 36 weeks. So since I have a history of preterm labor there's a chance it can happen again. I get weekly injections to try and prevent pre-term labor. about 3 weeks ago I experienced contractions after intercouse so my doctor advised that we try and hold off on sex untill I'm 36 weeks but today it happend it's been two weeks & me and my husband just went for it. But I feel bad I didn't experience any cramps or anything but what do you guys think should I just stop and obey my doctors orders. I want my baby to be born healthy and right now I feel horribly for putting my needs first.