sex after miscarriage

How long did you wait to have sex after a miscarriage? I am going to wait a cycle before ttc, but how long should you wait to just have sex? I forgot to ask my doctor today. I am still physically recovering, but after the bleeding stops can I? I don't want to risk an infection.