I don't know the situation that led to your loss. It was truly unfortunate and I'm sorry you had to go through it. What I can tell you is generally sex and orgasm are safe during pregnancy. It can lead to labor, usually when the body is close to it anyway. Unless you have an underlying condition that would create a high-risk pregnancy (which you should have been informed of by now) you should be able to orgasm without causing undue harm to yourself or your baby. Ask your midwife to be sure.