Realized Profit

I had an order to open CHRUSDT (perp). When the order was executed, my account was charged Realized Profit. I thought the Realized Profit should occur when the order is closed. Why it occured in the time of opening?