Did I miscary

I had unprotected sex 5 days before my period was due & my period was 3 weeks late. My doctor reccomeneded me to wait till I got my period or wait 3 weeks to get a preg test but the day before I was going to see her I had the worst pain I had ever felt in my life in my tummy aswell as heavy bleeding. The pain eased up throughout the night & it wasn't as bad the next day. But since I didn't get to get a preg test done is there still a chance I was pregnant?