Caplin Trader 4.7.1

Class: module:caplin/trading/trademodel/AbstractTradeFactory

module:caplin/trading/trademodel/AbstractTradeFactory

Constructor

new module:caplin/trading/trademodel/AbstractTradeFactory()

An abstract TradeFactory implementation that handles trade restoration. Extending classes should only implement module:caplin/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:caplin/trading/trademodel/Trade the trade object to restore.
mFieldMap Map the trade data to restore the trade with.
Implements:

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

Restores a trade that is not known on the client, then returns the newly created trade. This method internally invokes module:caplin/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:caplin/trading/trademodel/Trade