Caplin Trader 5.1.0

Class: module:ct-trading/trademodel/AbstractTradeFactory

module:ct-trading/trademodel/AbstractTradeFactory()

new module:ct-trading/trademodel/AbstractTradeFactory()

An abstract TradeFactory implementation that handles trade restoration.

Extending classes should only implement module:ct-trading/trademodel/TradeFactory#createNewTrade. They should also invoke the super constructor.

Implements:

Methods

restoreExistingTrade(oTrade, mFieldMap)

Restores a trade that is currently known on the client.

Parameters:
Name Type Description
oTrade module:ct-trading/trademodel/Trade

the trade object to restore.

mFieldMap Map

the trade data to restore the trade with.

Implements:

restoreNewTrade(mFieldMap) → {module:ct-trading/trademodel/Trade}

Restores a trade that is not known on the client, then returns the newly created trade. This method internally invokes module:ct-trading/trademodel/AbstractTradeFactory#restoreExistingTrade on the newly restored trade.

Parameters:
Name Type Description
mFieldMap Map

The data to restore the trade with.

Implements:
Returns:

The newly created trade.

Type
module:ct-trading/trademodel/Trade