Interface Leg


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.

  • Method Summary

    Modifier and Type
    Method
    Description
    Creates an action that represents the addition of a leg to a trade.
    Creates an action that represents the removal of a leg from a trade.
    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.
  • Method Details

    • createAddLegAction

      LegAction createAddLegAction()
      Creates an action that represents the addition of a leg to a trade.
      Returns:
      The leg action.
    • createRemoveLegAction

      LegAction createRemoveLegAction()
      Creates an action that represents the removal of a leg from a trade.
      Returns:
      The leg action.
    • createUpdateLegAction

      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.
      Returns:
      The leg action.