This is in beta and therefore subject to API changes.
The TradeFactory interface should be implemented by objects that create module:ct-trading/trademodel/Trade
objects.
The trade factory is used to create fresh module:ct-trading/trademodel/Trade
objects, or to restore trade
objects based on the contents of a Map
. It also informs any
module:ct-trading/trademodel/TradeFactoryListener
registered via module:ct-trading/trademodel/TradeFactory#addListener
whenever it
creates a new trade.
Methods
create New Trade(mTrade Fields)
Create a Trade
object for a new trade.
Parameters:
Name | Type | Description |
---|---|---|
mTradeFields |
Map | The map of fields required to create a trade. This should at least include AssetClass (e.g "FX"), TradingProtocol (e.g "RFS") and InstrumentName (e.g "/FX/GBPUSD"). |
restore Existing Trade(oTrade, mField Map)
Restores a trade that is currently known on the client.
Parameters:
Name | Type | Description |
---|---|---|
oTrade |
module:ct-trading |
The trade object to restore. |
mFieldMap |
Map | The trade data to restore the trade with. |
restore New Trade(mField Map) → {module:ct-trading /trademodel /Trade}
Restores a trade that is not known on the client, then returns the newly created trade.
Parameters:
Name | Type | Description |
---|---|---|
mFieldMap |
Map | The data to restore the trade with. |
Returns:
The newly created trade.