Class BlockTradeExecution


  • public class BlockTradeExecution
    extends java.lang.Object

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

    Any Block Trades which desire execution capabilities should extend this class

    • Constructor Summary

      Constructors 
      Constructor Description
      BlockTradeExecution​(com.caplin.trading.Trade trade, BlockTradeLeg nearLeg, BlockTradeLeg farLeg)
      Constructs a BlockTradeExecution by wrapping around the original trade and trade legs.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Account getAccount()
      Returns the account that this trade should be booked against.
      java.lang.String getBaseCurrency()
      Returns the base currency of the currency pair.
      java.lang.String getCurrencyPair()
      Returns the currency pair that this trade should be executed against.
      java.lang.String getDealtCurrency()
      Returns the currency that the amount denominates.
      BlockTradeLeg getFarLeg()
      Returns the far leg for swap trades, or null if this is not a swap trade.
      BlockTradeLeg getLegById​(int id)
      Returns the given leg by ID
      java.util.List<BlockTradeLeg> getLegs()
      Returns a list of all the legs
      BlockTradeLeg getNearLeg()
      Returns the near leg of the trade.
      java.lang.String getRequestID()
      Returns the ID generated from the client.
      java.lang.String getTermCurrency()
      Returns the term currency of the currency pair.
      java.lang.String getTradingType()
      Returns the type of trade that should be executed.
      java.lang.String getUsername()
      Returns the username of the logged in user that created this trade.
      boolean isNetted()
      Whether or not this block trade is netted.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • 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 Detail

      • 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 java.util.List<BlockTradeLeg> getLegs()
        Returns a list of all the legs
      • getTradingType

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

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

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

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

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

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

        public java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object