What is going on?

I’m supposed to start my period in 10 days. A few days ago I was spotting like this for 2 days. Does anyone know what it could be? Yesterday I didn’t bleed and this morning I didn’t either. But after I had sex I did but not until later this afternoon.