what are the calculation of the margin trading