If the trade occurs at or above the ask price, it is considered a buy (ask volume). If the trade occurs at or below the bid price, it is considered a sell (bid volume).