Your question has reminded me of a girl I used to flatshare with.
She would go out with blokes - nice ones for the most part - and spend her entire time being suspicious about them and whinging to me and our other flatmates that she knew they were going to treat her badly. Consequently, she was a cow to them. When they inevitably broke up, it proved she was right to be suspicious.
She never did work out the flaw in that argument...
I suspect your ex has probably got similar problems. He associates being loved with being hurt, so he pushes you away. At the same time, he's a normal human being and of course he craves love.
It maybe that he's too screwed up to sort this out and you need to accept that. On the other hand, you need to go and see him and have this thing out with him, all cards on the table. You need to tell him that if he wants you he can have you (if that's what you want), but only if he gets over what other people have done to him and stops being such a tw@ to you. You are not those other girls.
If he can't accept that, you need to do yourself a favour, chalk it up to experience and move on.