com.apama.md.adapter
Event CrossRateLegPair


The CrossRateLegPair event object is used to determine the validity of the synthetic cross based on the two input legs. It is also used to determine the parity of the two input legs.

For example, when calculating the synthetic cross rate for GBP/JPY, using GBP/USD and USD/JPY as the two legs, both would have a "parity" of true. If we were calculating the same synthetic cross but used USD/GBP instead for the front leg, then this leg would have a "parity" of false, as we need to use the inverse of the leg in the cross rate calculation.
Member summary
 stringcross
 stringleg1
 stringleg2
 stringintermediate
 booleanparity1
 booleanparity2
 
Action summary
 booleandetermineParity(string cross, string leg1, string leg2)

This function validates that the synthetic cross can be calculated based on the two input legs. It also calculates the parity of each leg (IE the direction of the input legs are correct or if they are inverted).
 stringgetCrossSymbol()

Helper function to get the name of the synthetic cross rate.
 booleangetLeg1Parity()

Helper function to get the parity of the front leg used for the synthetic cross rate.
 stringgetLeg1Symbol()

Helper function to get the name of the front leg used for the synthetic cross rate.
 booleangetLeg2Parity()

Helper function to get the parity of the back leg used for the synthetic cross rate.
 stringgetLeg2Symbol()

Helper function to get the name of the back leg used for the synthetic cross rate.
 stringgetOtherLegSymbol(string symbol)

Helper function to get the opposite legs symbol name based on the symbol passed in.
 booleaninitialise(string cross, string leg1, string leg2)

This function initialises the CrossRateLegPair event and used to determine the validity of the synthetic cross based on the two input legs.
 
Member detail

cross

string cross

intermediate

string intermediate

leg1

string leg1

leg2

string leg2

parity1

boolean parity1

parity2

boolean parity2

Action detail

determineParity

boolean determineParity(string cross, string leg1, string leg2)
This function validates that the synthetic cross can be calculated based on the two input legs. It also calculates the parity of each leg (IE the direction of the input legs are correct or if they are inverted).
Parameters:
cross - The symbol name of the synthetic cross rate to be calculated
leg1 - The symbol name of the front leg to be used in the cross rate calculation
leg2
Returns:
true if the two legs can be used to create the synthetic cross false otherwise
Since:
CMF 2.2.0

getCrossSymbol

string getCrossSymbol()
Helper function to get the name of the synthetic cross rate.
Returns:
The name of the synthetic cross
Since:
CMF 2.2.0

getLeg1Parity

boolean getLeg1Parity()
Helper function to get the parity of the front leg used for the synthetic cross rate.

For example, when calculating the synthetic cross rate for GBP/JPY, using GBP/USD and USD/JPY as the two legs, both would have a "parity" of true. If we were calculating the same synthetic cross but used USD/GBP instead for the front leg, then this leg would have a "parity" of false, as we need to use the inverse of the leg in the cross rate calculation.
Returns:
true if the front leg is in the direction of the cross false if the leg is inverted
Since:
CMF 2.2.0

getLeg1Symbol

string getLeg1Symbol()
Helper function to get the name of the front leg used for the synthetic cross rate.
Returns:
The name of the front leg used for the synthetic cross rate
Since:
CMF 2.2.0

getLeg2Parity

boolean getLeg2Parity()
Helper function to get the parity of the back leg used for the synthetic cross rate.

For example, when calculating the synthetic cross rate for GBP/JPY, using GBP/USD and USD/JPY as the two legs, both would have a "parity" of true. If we were calculating the same synthetic cross but used USD/GBP instead for the front leg, then this leg would have a "parity" of false, as we need to use the inverse of the leg in the cross rate calculation.
Returns:
true if the back leg is in the direction of the cross false if the leg is inverted
Since:
CMF 2.2.0

getLeg2Symbol

string getLeg2Symbol()
Helper function to get the name of the back leg used for the synthetic cross rate.
Returns:
The name of the back leg used for the synthetic cross rate
Since:
CMF 2.2.0

getOtherLegSymbol

string getOtherLegSymbol(string symbol)
Helper function to get the opposite legs symbol name based on the symbol passed in.

For example, when calculating the synthetic cross rate for GBP/JPY, using GBP/USD and USD/JPY as the two legs, calling this function with the name of the front leg (IE "GBP/USD") would return the value for the back leg (IE "USD/JPY").
Parameters:
symbol
Returns:
The opposite legs symbol name based on the leg passed in, or an empty string indicating an error.
Since:
CMF 2.2.0

initialise

boolean initialise(string cross, string leg1, string leg2)
This function initialises the CrossRateLegPair event and used to determine the validity of the synthetic cross based on the two input legs.
Parameters:
cross - The symbol name of the synthetic cross rate to be calculated
leg1 - The symbol name of the front leg to be used in the cross rate calculation
leg2
Returns:
true if the two legs can be used to create the synthetic cross false otherwise
Since:
CMF 2.2.0