When to try again after a miscarriage?

Found out I was pregnant on Sunday and then started having cramping and heavy bleeding assuming miscarriage yesterday. Still bleeding and cramping. Dr is doing blood tests to check my hcg level. When should I start trying again? This was my first time being pregnant and first miscarriage we were trying for 9 months so it’s a hard loss. Wanted this badly.