Confused

So today I had sex with my bf and it was extremely pain. 😖 my friend said I was probably ovulating but on my <a href="https://play.google.com/store/apps/details?id=com.glow.android.eve">period tracker</a> it says I ovulated last week. Is it possible to ovulate 4 days before period?