Few days past I had signs that my period is coming. Today I had protective sex and now I have my period. Was that wrong to do?

No. You are smart to have protected sex but there is no reason not to enjoy this in any part of the cycle as long as you are comfortable. There is nothing wrong here.