Can I talk to my friend and tell her she cannot move in because of my ex?
Why don't you want her to move in?
Because she kept inviting my ex to stay over for a couple of days.
It is good that you wanted to help a friend but if they won't accept your terms it is okay. You don't have to let them stay if you don't want to anymore, they can find other accommodations that suit them better.
I'm going to talk to her on Friday.
I'm sorry you are in this situation. You are not obligated to have your friend move in and should let her know. Having your ex around is only going to stir up more emotions so she should be more sensitive to that.