Caplin Trader 4.8.0

Class: module:caplin/trading/derivation/TierDerivation

module:caplin/trading/derivation/TierDerivation

Constructor

new module:caplin/trading/derivation/TierDerivation()

The TierDerivation class is used to generate the derived fields for an ESP trade. For example, the bid/ask prices are derived from the dealt amount and the corresponding tier limits. When the dealt amount changes, then the bid/ask rate must be recalculated.
Extends:

Extends

Methods

getDerivedFields() → {Array}

Returns a list of fields that are derived from this derivation. These fields may be required as input fields to another derivation, and will be appended to the dataHolder when recalculateDerivedFields is called.
Returns:
A list of derived field names (as strings).
Type
Array

getInputFields() → {Array}

Returns a list of fields used as inputs to the Derivation. The input fields of one derivation may be the derived fields of another derivation, and thus will determine the order in which the derivations will be performed.
Returns:
A list of input field names (as strings).
Type
Array

recalculateDerivedFields(oData)

Recalculates the bid and ask price and updates the specified DataHolder with these derived fields.
Parameters:
Name Type Description
oData module:caplin/trading/trademodel/DataHolderWrapper The data that is augmented by this derivation. Must be a non null instance.