Class BlockTradeExecution
java.lang.Object
com.caplin.motif.fx.trading.block.BlockTradeExecution
Base class for block trade objects within the FX Integration API.
Any Block Trades which desire execution capabilities should extend this class
-
Constructor Summary
ConstructorDescriptionBlockTradeExecution
(com.caplin.trading.Trade trade, BlockTradeLeg nearLeg, BlockTradeLeg farLeg) Constructs a BlockTradeExecution by wrapping around the original trade and trade legs. -
Method Summary
Modifier and TypeMethodDescriptionReturns the account that this trade should be booked against.Returns the base currency of the currency pair.Returns the currency pair that this trade should be executed against.Returns the currency that the amount denominates.Returns the far leg for swap trades, or null if this is not a swap trade.getLegById
(int id) Returns the given leg by IDgetLegs()
Returns a list of all the legsReturns the near leg of the trade.Returns the ID generated from the client.Returns the term currency of the currency pair.Returns the type of trade that should be executed.Returns the username of the logged in user that created this trade.boolean
isNetted()
Whether or not this block trade is netted.toString()
-
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 TradefarLeg
- The far leg of the Trade
-
-
Method Details
-
getNearLeg
Returns the near leg of the trade. All trade types will have a near leg.- Returns:
- The near leg.
-
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
Returns the given leg by ID -
getLegs
Returns a list of all the legs -
getTradingType
Returns the type of trade that should be executed.- Returns:
- The trade type.
-
getCurrencyPair
Returns the currency pair that this trade should be executed against.- Returns:
- The currency pair in the format XXXYYY.
-
getBaseCurrency
Returns the base currency of the currency pair.- Returns:
- The base currency in the format XXX.
-
getTermCurrency
Returns the term currency of the currency pair.- Returns:
- The term currency in the format YYY.
-
getDealtCurrency
Returns the currency that the amount denominates.- Returns:
- The dealt currency, which may contain sub decimals.
-
getRequestID
Returns the ID generated from the client. The combination of user and trade is unique.- Returns:
- the request ID.
-
getUsername
Returns the username of the logged in user that created this trade.- Returns:
- the username of the logged in user.
-
getAccount
Returns the account that this trade should be booked against.- Returns:
- The account.
-
toString
-