I am sorry you have had to go through this twice, it is such a distressing thing for you.
It's hard to comment on what your diet needs without doing a clinical exam. I specialise in treating anything to do with pregnancy, and as far as I am aware there are no specific dietary interventions to prevent miscarriages. The truth is, we simply do not know what causes the majority of miscarriages, and anyone who tells you otherwise is misleading you. Women with low oestrogen conceive and carry to term, as do women with low egg reserve/poor ovarian function etc etc. Some women in perfect reproductive health never conceive, or never carry to term. It really is a field open to guesswork as much as fate as much as hard science.
Eating a good all-round diet is a big help in any instance, and taking Folic Acid supplements essential if you want to get pregnant regardless of any previous history. There are specific dietary interventions in Chinese Medicine but, you need to get a diagnosis first. I have worked with many women who have a history of miscarriage and who are now proud and happy mothers. I think you might benefit from seeing a properly qualified acupuncturist who has plenty of experience in the fertility field - ask before you commit.
Don't lose hope - it can take a few attempts before your body 'gets it'.