public interface Leg
Trades are comprised of one or more trade legs, each representing the exchange of a financial instrument and
the resultant cashflow. One or more Leg
instances are contained within a single Trade
instance -
this provides the transactional wrapper around a complete trade.
The Leg
interface acts a factory to create actions that relate to this leg. These actions can be
added to instances of TradeEvent
.
Each leg is assigned a unique identifier on creation. These identifiers are used to prefix the names of any fields relating to this leg, for example a field "Amount" relating to a leg with ID 1 will be stored and sent over the wire as "L1_Amount".
Leg identifiers are handled automatically by the TradingDataSource so it is not necessary for API developers to keep track of them. However it is important to ensure that the relevant prefixed field names are present in the field configuration file for the TradingDataSource. For example, if your application allows a trade to contain up to three legs and one of the field names is "Amount" then the fields "L1_Amount", "L2_Amount" and "L3_Amount" must be defined in the fields configuration file.
Modifier and Type | Method and Description |
---|---|
LegAction |
createAddLegAction()
Creates an action that represents the addition of a leg to a trade.
|
LegAction |
createRemoveLegAction()
Creates an action that represents the removal of a leg from a trade.
|
LegAction |
createUpdateLegAction()
Creates an action that represents an update to an existing trade leg, for example a change in the
value of one of the leg fields.
|
LegAction createAddLegAction()
LegAction createRemoveLegAction()
LegAction createUpdateLegAction()
Please send bug reports and comments to Caplin support