Forgiving an ex.

I was told I was very foolish for forgiving my ex even after eveything that he did to me. Long story short he cheated on me and lied to me within our relationship. The ending point was that he cheated on me with his ex and she got pregnant but he claims he wasn't sure that was his baby and this is while i was pregnant his baby and I ended up having a miscarriage and he wasn't around and he broke up with me. It took me almost 8 months to come to terms with everything and I chose to forgive him and let the pain go and I told him this recently. We aren't getting back together ever. But am I stupid for forgiving him?