Class
caplin.fx.trademodel

FxTrade

The FX Trade adds functions specific for FX trades to the generic caplin.trading.trademodel.Trade class.

Constructor Summary

Attributes Name and Description
caplin.fx.trademodel.FxTrade(caplin.trading.trademodel.TradeLegFactory oFactory, caplin.trading.statemachine.StateMachine oStateMachine, caplin.trading.trademodel.TradeMessageService oTradeMessageService, String sTradingProtocol, String sTradingType)

Constructs a FxTrade.

Method Summary

Attributes Name and Description
void afterLegAdded(caplin.trading.trademodel.TradeLeg oLeg, int nLegId)

Checks if this is a second leg being added to the trade, and if so sets the instrument to the same value as the first leg.

int getInitialLegCount(String sTradeType)

Returns the initial number of legs to be completed in a trade based on the trade type.

int getMaxLegCount(String sTradeType)

Returns the maximum number of legs to be completed in a trade based on the trade type.

Methods inherited from class caplin.trading.trademodel.Trade:
addDataFieldChangedListener, addDataFieldsChangedListener, addDerivation, addInvalidServerEventListener, addLeg, addLegs, addStateChangedListener, addStructureChangedListener, addTradeRestoredListener, addTradingStatusChangedListener, addValidator, beforeLegAdded, getAccount, getAssetClass, getCurrentState, getDataAsStructuredMap, getFieldValue, getLeg, getLegById, getLegs, getOverallTimeOut, getRemainingTimeToTrade, getRequestID, getRestorationID, getServerFailureMessage, getState, getStateMachine, getTradeChannelStatus, getTradeDate, getTradeID, getTradingProtocol, getTradingStatus, getTradingType, getUserTradedOnBehalfOf, isEventAllowed, processClientEvent, processServerEvent, removeAllLegs, removeDataFieldChangedListener, removeDataFieldsChangedListener, removeInvalidServerEventListener, removeLeg, removeStateChangedListener, removeStructureChangedListener, removeTradeRestoredListener, removeTradingStatusChangedListener, resume, setAccount, setFieldValue, setTradeDate, setTradingType, setUserTradedOnBehalfOf, stop, suspend, update

Constructor Detail

caplin.fx.trademodel.FxTrade(caplin.trading.trademodel.TradeLegFactory oFactory, caplin.trading.statemachine.StateMachine oStateMachine, caplin.trading.trademodel.TradeMessageService oTradeMessageService, String sTradingProtocol, String sTradingType)

Constructs a FxTrade.

Parameters
caplin.trading.trademodel.TradeLegFactory oFactory The Trade leg factory use to create trade legs. Must not be null.
caplin.trading.statemachine.StateMachine oStateMachine A StateMachine suitable for the trading protocol. Must not be null.
caplin.trading.trademodel.TradeMessageService oTradeMessageService A TradeMessageService responsible for sending trade data to and from the trading system. Must not be null.
String sTradingProtocol The protocol used for trading, for example ESP, RFQ or RFS.
String sTradingType The type of trading this instance will perform, for example SPOT, FORWARD or SWAP.

Method Detail

void afterLegAdded(caplin.trading.trademodel.TradeLeg oLeg, int nLegId)

Checks if this is a second leg being added to the trade, and if so sets the instrument to the same value as the first leg. This assumes that a two legged FX trade represents a swap.

Parameters
caplin.trading.trademodel.TradeLeg oLeg The leg about to be added to the trade.
int nLegId The identifier of the leg being added.

int getInitialLegCount(String sTradeType)

Returns the initial number of legs to be completed in a trade based on the trade type.

Parameters
String sTradeType A string representation of the trade type (SPOT, FWD, SWAP or FWDFWDSWAP).
Returns
The initial number of legs for this FX trade.

int getMaxLegCount(String sTradeType)

Returns the maximum number of legs to be completed in a trade based on the trade type.

Parameters
String sTradeType A string representation of the trade type (SPOT, FWD, SWAP or FWDFWDSWAP).
Returns
The maximum number of legs for this FX trade.