Class BlockTradeExecution

java.lang.Object
com.caplin.motif.fx.trading.block.BlockTradeExecution

public class BlockTradeExecution extends Object

Base class for block trade objects within the FX Integration API.

Any Block Trades which desire execution capabilities should extend this class

  • Constructor Details

    • BlockTradeExecution

      public BlockTradeExecution(com.caplin.trading.Trade trade, BlockTradeLeg nearLeg, BlockTradeLeg farLeg)
      Constructs a BlockTradeExecution by wrapping around the original trade and trade legs.
      Parameters:
      nearLeg - The near leg of the Trade
      farLeg - The far leg of the Trade
  • Method Details

    • getNearLeg

      public BlockTradeLeg getNearLeg()
      Returns the near leg of the trade. All trade types will have a near leg.
      Returns:
      The near leg.
    • getFarLeg

      public BlockTradeLeg getFarLeg()
      Returns the far leg for swap trades, or null if this is not a swap trade.
      Returns:
      The far leg, or null if one does not exist.
    • isNetted

      public boolean isNetted()
      Whether or not this block trade is netted.
      Returns:
      true if this is a netted trade, false otherwise.
    • getLegById

      public BlockTradeLeg getLegById(int id)
      Returns the given leg by ID
    • getLegs

      public List<BlockTradeLeg> getLegs()
      Returns a list of all the legs
    • getTradingType

      public String getTradingType()
      Returns the type of trade that should be executed.
      Returns:
      The trade type.
    • getCurrencyPair

      public String getCurrencyPair()
      Returns the currency pair that this trade should be executed against.
      Returns:
      The currency pair in the format XXXYYY.
    • getBaseCurrency

      public String getBaseCurrency()
      Returns the base currency of the currency pair.
      Returns:
      The base currency in the format XXX.
    • getTermCurrency

      public String getTermCurrency()
      Returns the term currency of the currency pair.
      Returns:
      The term currency in the format YYY.
    • getDealtCurrency

      public String getDealtCurrency()
      Returns the currency that the amount denominates.
      Returns:
      The dealt currency, which may contain sub decimals.
    • getRequestID

      public String getRequestID()
      Returns the ID generated from the client. The combination of user and trade is unique.
      Returns:
      the request ID.
    • getUsername

      public String getUsername()
      Returns the username of the logged in user that created this trade.
      Returns:
      the username of the logged in user.
    • getAccount

      public Account getAccount()
      Returns the account that this trade should be booked against.
      Returns:
      The account.
    • toString

      public String toString()
      Overrides:
      toString in class Object