Is the closing price the last transaction of the stock

Not necessarily, there are two situations in Hong Kong stocks:

1. When the stock is closed for bidding

The closing price is equal to the last U-shaped transaction price.

2. When the stock is not closed for bidding

During the period of 15 / 59 / 16 / 00, the system takes the closing price every 15 seconds and takes the median of the five trading prices as the closing price.