was bought at a higher price, so you had a loss.
But within one month if you buy the same stock at a lower price than the price you sold it, the system will readjust your cost.