How is unrealized gain/loss calculated?

Asset's current market price (if it were sold today) minus the asset's original cost when it was purchased.