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

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()

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

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

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

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 pointsAsk)

forward pointsAsk)

if the side is ask:

forward price(unrounded) = multiplier /mathUtil.subtract(spot price,

forward pointsBid)

forward pointsBid)

Quantity for bid and ask:

forward quantity = ((spot quantity/contract size.toFloat())/

(spot price/multiplier)).round()

(spot price/multiplier)).round()

To round the calculated forward price, pipSize and epsSize parameters are used in the following way:

For buy side, floor function is used:

forward price(rounded) =(mathUtil.add( forward price (unrounded), eps size)

/ pip size).floor().toFloat()* pip size

/ pip size).floor().toFloat()* pip size

For sell side, ceiling function is used:

forward price(rounded) =(mathUtil.subtract( forward price (unrounded),

eps size) / pip size).ceil().toFloat()* pip size

eps size) / pip size).ceil().toFloat()* pip size

Copyright Â© 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)