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 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.String
getBaseCurrency()
Returns the base currency of the currency pair.String
getCurrencyPair()
Returns the currency pair that this trade should be executed against.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 IDList<BlockTradeLeg>
getLegs()
Returns a list of all the legsBlockTradeLeg
getNearLeg()
Returns the near leg of the trade.String
getRequestID()
Returns the ID generated from the client.String
getTermCurrency()
Returns the term currency of the currency pair.String
getTradingType()
Returns the type of trade that should be executed.String
getUsername()
Returns the username of the logged in user that created this trade.boolean
isNetted()
Whether or not this block trade is netted.String
toString()
-
-
-
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 TradefarLeg
- 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 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.
-
-