This is the most powerful dua to prevent miscarriage.
Bismillah Illazi La Yadurru ma-asmihi Shai-Un Fill Ardi Wala Fis Samaa-e Wahu Wass-Samee-Ul Aleem
Recite this dua before sleeping 111 times during pregnancy to prevent your miscarriage. This is a very effective dua if you already have miscarriage symptoms and want to prevent it.
Thanks to Sabiha who asked this question What is the dua for miscarriage in Islam? This question has been asked many times before. This answer will not help only one person but others too to prevent miscarriage using this given dua.
Dear Sister, Ten years is a very long time, and I am sorry for what you are going through. Yes, you can do this dua to prevent miscarriage. Also, keep doing Istighfar and Sadqah regularly. At the same time, make sure to see a good doctor as well. I pray for you. May Allah bless you with a healthy baby soon, Inshallah.