Miscarriage, how long will I bleed for?

Pa

I had a missed miscarriage early this year in March (D&C).

Positive pregnancy test 9/13 and positive at the doctor's office too. Was supposed to be 6 weeks but there was no gestational sac. They told me that maybe it implanted later than we thought but I was preparing for the worse again.

On 9/29 I started cramping and bleeding. It's been on and off but how long is this supposed to last? My lower back has been hurting so much today.

When will I know the miscarry is over and its period?