How long do you have to wait after a miscarriage to try to have another baby?

When YOU are ready. Family or friends with good intentions might pressure a couple to "try again" right away. But both partners must go through a process of grieving for the baby they thought they would have and preparing for what's next. When they get healthy, eat right, avoid toxins and exercise, odds of having a successful pregnancy might increase. They cannot replace the one lost but can often complete a new one.
Until neg pg test. You need to wait until your current pregnancy test is negative until you try to get pregnant again. Otherwise, if you present to the provider with a +preg test without having had a negative one, it is difficult to know with certainty if the test is from a new or the old pregnancy. From a physiological standpoint, there is no carryover effect from one pregnancy to another, so no other need to wait.