Calculations
The following section describes the calculations that the FTSC uses to convert from forwards to spots, and vice versa. Before the conversion, if the value of the pipSize parameter is greater than 0.0, the value of the epsSize parameter is added (for bids) or subtracted (for asks) from the forward price. For example, To calculate the bid price on the buy side: forward price = forward price + eps size To calculate the ask price on the sell side: forward price = forward price - eps size
Converting forwards to spots
When the prices are direct, spot price and quantity are calculated as follows:
spot price (unrounded) = mathUtil.add(forward price/multiplier,
forward points)
spot quantity = quantity * contract size
When the prices are indirect, bid price is used to calculate the ask price and quantity and vice-versa. The formulas used are:
spot price (unrounded) = mathUtil.add(multiplier/forward price,
forward points)
spot quantity =(((quantity.toFloat()*contractSize.toFloat()*
(forward price / multiplier)) * 10000.0).round()/10000.0 ).floor()
To round the calculated spot bid price, the spotPricePrecision parameter is used in the following way:
spot price(rounded) = spotprice(unrounded)*
spotPricePrecision.floor().toFloat()/spotPricePrecision
To round the calculated spot ask price, the spotPricePrecision parameter is used in the following way:
spot price(rounded) = spotprice(unrounded)*
spotPricePrecision.ceil().toFloat()/spotPricePrecision
Converting spots to forwards
When the prices are direct, forward price and quantity are calculated as follows:
forward price(unrounded) =
mathUtil.subtract(spot price , forward points)*multiplier
forward quantity = spot quantity / contract size forward points = forwardPointsBid or forwardPointsAsk depending on the side. forward points = mathUtil.add(forwardPointsBid , forwardPointsAsk) /2 in case of trade price conversions.
When the prices are indirect, bid price is used to calculate the ask price and quantity and vice-versa. The formula used is:
If the side is bid:
forward price(unrounded) = multiplier /mathUtil.subtract(spot price,
forward price(unrounded) = multiplier /mathUtil.subtract(spot price,
forward pointsBid) Contact Support   |   Community   |   Feedback