Should it be fine to have sex when cramping in early pregnancy?

Sidkzia

Is it okay to have sex if you’re at 4 weeks of pregnancy with ongoing period-like cramps?

From my experience, i started to heavily bleed at 5 weeks that terminated my pregnancy. They couldn’t tell if it was chemical or mc.

I want to be extra cautious this time to not to lose another pregnancy.