com.apama.md.adapter
Event ForwardSpotConvertHelper


For feeds providing FX Futures, such as CME, ForwardSpotConvertHelper is used to convert prices and quantities into their Spot equivalent.

The conversion is done using the Forward Points and other parameters provided. Once an order is placed against these prices the helper is used again to convert the prices in the order back to Forward from Spot.

For e.g. to convert Forward Bid price to Spot and then back to Forward (when isDirect is true), following calculations are used :

Spot Bid Price = mathUtil.add(Bid price/multiplier , forwardPointsBid) * spotPricePrecision).floor().toFloat() / spotPricePrecision

Forward Bid price (unrounded) = mathUtil.subtract(spotPrice , forwardPointsBid) * multiplier
Action Summary
 booleanconParamsValid(com.apama.md.adapter.FSConvertorParams conParams)

Validates FTSC parameters.
 com.apama.md.BBAconvertBBAFromSpot(com.apama.md.BBA bbaInst, integer conId, integer sessionId)

Generates a BBA event with forward price and quantity based on the provided BBA event with spot price and quantity.
 com.apama.md.BBAconvertBBAToSpot(com.apama.md.BBA bbaInst, integer conId, integer sessionId)

Generates a BBA event with spot price and quantity based on the provided BBA event with future price and quantity.
 com.apama.md.DDconvertDepthDeltaFromSpot(com.apama.md.DD depthDC, integer conId, integer sessionId)

Generates a Depth Delta event with forward prices and quantities based on the provided Depth event with spot prices and quantities.
 com.apama.md.ODconvertDepthDeltaFromSpotOrderbook(com.apama.md.DD depthDC, integer conId, integer sessionId)

Generates an Orderbook Delta event with forward prices and quantities based on the provided Depth event with spot prices and quantities.
 com.apama.md.DDconvertDepthDeltaToSpot(com.apama.md.DD depthDC, integer conId, integer sessionId)

Generates a Depth Delta event with spot prices and quantities based on the provided Depth Delta event with future prices and quantities.
 com.apama.md.ODconvertDepthDeltaToSpotOrderbook(com.apama.md.DD depthDC, integer conId, integer sessionId)

Generates an Orderbook Delta event with spot prices and quantities based on the provided Depth Delta event with future prices and quantities.
 com.apama.md.DconvertDepthSnapshotFromSpot(com.apama.md.D depth, integer conId, integer sessionId)

Generates a Depth event with forward prices and quantities based on the provided Depth event with spot prices and quantities.
 com.apama.md.OconvertDepthSnapshotFromSpotOrderbook(com.apama.md.D depth, integer conId, integer sessionId)

Generates an Orderbook event with forward prices and quantities based on the provided Depth event with spot prices and quantities.
 com.apama.md.DconvertDepthSnapshotToSpot(com.apama.md.D depth, integer conId, integer sessionId)

Generates a Depth event with spot prices and quantities based on the provided Depth event with future prices and quantities.
 com.apama.md.OconvertDepthSnapshotToSpotOrderbook(com.apama.md.D depth, integer conId, integer sessionId)

Generates an Orderbook event with spot prices and quantities based on the provided Depth event with future prices and quantities.
 com.apama.md.ESconvertES(com.apama.md.ES esInst, integer conId, integer sessionId, string outputStreamType)

Generates an ES event based on the ES event, connection Id and session Id provided.
 com.apama.md.ESDconvertESD(com.apama.md.ESD esdInst, integer conId, integer sessionId, string outputStreamType)

Generates an ESD event based on the ESD event, connection Id and session Id provided.
 com.apama.md.TconvertTradeFromSpot(com.apama.md.T trade, integer conId, integer sessionId)

Generates a Trade event with forward price and quantity based on the provided Trade event with spot price and quantity.
 com.apama.md.TconvertTradeToSpot(com.apama.md.T trade, integer conId, integer sessionId)

Generates a Trade event with spot price and quantity based on the provided Trade event with future price and quantity.
 com.apama.md.adapter.FSConvertorParamsextractParams(com.apama.session.CtrlParams ctrlParams)

Converts a set of CtrlParams into a new FSConvertorParams event.
 com.apama.md.adapter.FSConvertorParamsmergeParams(com.apama.session.CtrlParams ctrlParams, com.apama.md.adapter.FSConvertorParams baseParams)

Merges the base FSConvertorParams with the provided set of CtrlParams.
 voidsetParams(com.apama.md.adapter.FSConvertorParams givenParams)

Sets the parameters for forward to spot or spot to forward conversions.
 
Action Detail

conParamsValid

boolean conParamsValid(com.apama.md.adapter.FSConvertorParams conParams)
Validates FTSC parameters.
Parameters:
conParams - FSConvertorParams event to be validated.
Returns:
False if an invalid parameter is found, true otherwise.

convertBBAFromSpot

com.apama.md.BBA convertBBAFromSpot(com.apama.md.BBA bbaInst, integer conId, integer sessionId)
Generates a BBA event with forward price and quantity based on the provided BBA event with spot price and quantity.
Parameters:
bbaInst - BBA event with spot price and quantity.
conId - The connection id to use in the returned BBA event.
sessionId - The session id to use in the returned BBA event.
Returns:
The BBA event with forward price and quantity.

convertBBAToSpot

com.apama.md.BBA convertBBAToSpot(com.apama.md.BBA bbaInst, integer conId, integer sessionId)
Generates a BBA event with spot price and quantity based on the provided BBA event with future price and quantity.
Parameters:
bbaInst - BBA event with future price and quantity.
conId - The connection id to use in the returned BBA event.
sessionId - The session id to use in the returned BBA event.
Returns:
The BBA event with spot price and quantity.

convertDepthDeltaFromSpot

com.apama.md.DD convertDepthDeltaFromSpot(com.apama.md.DD depthDC, integer conId, integer sessionId)
Generates a Depth Delta event with forward prices and quantities based on the provided Depth event with spot prices and quantities.
Parameters:
depthDC - Depth Delta event with spot prices and quantities.
conId - The connection id to use in the returned Depth Delta event.
sessionId - The session id to use in the returned Depth Delta event.
Returns:
The Depth Delta event with forward prices and quantities.

convertDepthDeltaFromSpotOrderbook

com.apama.md.OD convertDepthDeltaFromSpotOrderbook(com.apama.md.DD depthDC, integer conId, integer sessionId)
Generates an Orderbook Delta event with forward prices and quantities based on the provided Depth event with spot prices and quantities.
Parameters:
depthDC - Depth Delta event with spot prices and quantities.
conId - The connection id to use in the returned Depth Delta event.
sessionId - The session id to use in the returned Depth Delta event.
Returns:
The Depth Delta event with forward prices and quantities.

convertDepthDeltaToSpot

com.apama.md.DD convertDepthDeltaToSpot(com.apama.md.DD depthDC, integer conId, integer sessionId)
Generates a Depth Delta event with spot prices and quantities based on the provided Depth Delta event with future prices and quantities.
Parameters:
depthDC - Depth Delta event with future prices and quantities.
conId - The connection id to use in the returned Depth Delta event.
sessionId - The session id to use in the returned Depth Delta event.
Returns:
The Depth Delta event with spot prices and quantities.

convertDepthDeltaToSpotOrderbook

com.apama.md.OD convertDepthDeltaToSpotOrderbook(com.apama.md.DD depthDC, integer conId, integer sessionId)
Generates an Orderbook Delta event with spot prices and quantities based on the provided Depth Delta event with future prices and quantities.
Parameters:
depthDC - Depth Delta event with future prices and quantities.
conId - The connection id to use in the returned Depth Delta event.
sessionId - The session id to use in the returned Depth Delta event.
Returns:
The Depth Delta event with spot prices and quantities.

convertDepthSnapshotFromSpot

com.apama.md.D convertDepthSnapshotFromSpot(com.apama.md.D depth, integer conId, integer sessionId)
Generates a Depth event with forward prices and quantities based on the provided Depth event with spot prices and quantities.
Parameters:
depth - Depth event with spot prices and quantities.
conId - The connection id to use in the returned Depth event.
sessionId - The session id to use in the returned Depth event.
Returns:
The Depth event with forward prices and quantities.

convertDepthSnapshotFromSpotOrderbook

com.apama.md.O convertDepthSnapshotFromSpotOrderbook(com.apama.md.D depth, integer conId, integer sessionId)
Generates an Orderbook event with forward prices and quantities based on the provided Depth event with spot prices and quantities.
Parameters:
depth - Depth event with spot prices and quantities.
conId - The connection id to use in the returned Depth event.
sessionId - The session id to use in the returned Depth event.
Returns:
The Depth event with forward prices and quantities.

convertDepthSnapshotToSpot

com.apama.md.D convertDepthSnapshotToSpot(com.apama.md.D depth, integer conId, integer sessionId)
Generates a Depth event with spot prices and quantities based on the provided Depth event with future prices and quantities.
Parameters:
depth - Depth event with future prices and quantities.
conId - The connection id to use in the returned Depth event.
sessionId - The session id to use in the returned Depth event.
Returns:
The Depth event with spot prices and quantities.

convertDepthSnapshotToSpotOrderbook

com.apama.md.O convertDepthSnapshotToSpotOrderbook(com.apama.md.D depth, integer conId, integer sessionId)
Generates an Orderbook event with spot prices and quantities based on the provided Depth event with future prices and quantities.
Parameters:
depth - Depth event with future prices and quantities.
conId - The connection id to use in the returned Depth event.
sessionId - The session id to use in the returned Depth event.
Returns:
The Depth event with spot prices and quantities.

convertES

com.apama.md.ES convertES(com.apama.md.ES esInst, integer conId, integer sessionId, string outputStreamType)
Generates an ES event based on the ES event, connection Id and session Id provided.
Parameters:
esInst - ES event to be modified.
conId - The connection id to use in the returned ES event.
sessionId - The session id to use in the returned ES event.
outputStreamType - The output stream type.
Returns:
The ES event populated with the conId and sessionId provided.

convertESD

com.apama.md.ESD convertESD(com.apama.md.ESD esdInst, integer conId, integer sessionId, string outputStreamType)
Generates an ESD event based on the ESD event, connection Id and session Id provided.
Parameters:
esdInst - ESD event to be modified.
conId - The connection id to use in the returned ES event.
sessionId - The session id to use in the returned ES event.
outputStreamType - The output stream type.
Returns:
The ESD event populated with the conId and sessionId provided.

convertTradeFromSpot

com.apama.md.T convertTradeFromSpot(com.apama.md.T trade, integer conId, integer sessionId)
Generates a Trade event with forward price and quantity based on the provided Trade event with spot price and quantity.
Parameters:
trade - Trade event with spot price and quantity.
conId - The connection id to use in the returned Trade event.
sessionId - The session id to use in the returned Trade event.
Returns:
The Trade event with forward price and quantity.

convertTradeToSpot

com.apama.md.T convertTradeToSpot(com.apama.md.T trade, integer conId, integer sessionId)
Generates a Trade event with spot price and quantity based on the provided Trade event with future price and quantity.
Parameters:
trade - Trade event with future price and quantity.
conId - The connection id to use in the returned Trade event.
sessionId - The session id to use in the returned Trade event.
Returns:
The Trade event with spot price and quantity.

extractParams

com.apama.md.adapter.FSConvertorParams extractParams(com.apama.session.CtrlParams ctrlParams)
Converts a set of CtrlParams into a new FSConvertorParams event.
Parameters:
ctrlParams - CtrlParams event from which the new FSConvertorParams event values are to be extracted.
Returns:
New FSConvertorParams event containing the extracted parameters.

mergeParams

com.apama.md.adapter.FSConvertorParams mergeParams(com.apama.session.CtrlParams ctrlParams, com.apama.md.adapter.FSConvertorParams baseParams)
Merges the base FSConvertorParams with the provided set of CtrlParams.
Parameters:
ctrlParams - CtrlParams to be merged with the base FSConvertor params.
baseParams - Base FSConvertorParams to be merged with the CtrlParams.
Returns:
New FSConvertorParams event containing the merged parameter values.

setParams

void setParams(com.apama.md.adapter.FSConvertorParams givenParams)
Sets the parameters for forward to spot or spot to forward conversions.
Parameters:
givenParams - FSConvertorParams event containing the FTCS parameters.