In order to calculate the amount of units for a trade, we may use one of the formulas below, according to the instrument being traded.
Please note that, previously, the unit and margin calculation for both BUY and SELL trades was based only on the SELL (Bid) rate.
As of 21 February 2018, the unit amount for BUY trades is calculated based on the BUY (Ask) rate to better reflect asset ownership. For SELL trades, it is still based on the SELL (Bid) rate.