Custom Pricing Models Interfaces
Custom Pricing Models are objects that expose standard COM interfaces based upon the following definitions.
The interface is defined within the TTPriceModel type library and is available to any development environment that supports the creation of COM objects.
Interface IPriceModel derived objects are responsible for converting exchange prices into yield prices and converting those yield prices back into exchange prices.
Note: The word Yield throughout this document is a convention of X_TRADER’s code base and is not meant to restrict the values computed by the Custom Pricing Models.
- A library may contain multiple IPriceModel derived objects, including Init, PriceToYield and YieldToPrice.
The following table describes methods that must be implemented by the object derived from IPriceModel.
|Init||Provides the pricing model with the same data used by X_TRADER’s Yield to Maturity calculation. The Custom Pricing Model can use or disregard the data; it does not have any impact on X_TRADER. The data is passed in an object; a 2x10 array containing both the labels and the values.|
|PriceToYield||Provides the pricing model with an exchange price value in a double. The pricing model is responsible for returning a yield price based on this exchange price.|
Provides the pricing model with a yield price value in a double. The pricing model is responsible for returning an exchange price based on this yield price.
Note: The contract made between the custom pricing model and X_TRADER is that the value returned from YieldToPrice is the same value passed into PriceToYield. If the returned value differs from the value passed into PriceToYield then results from the custom pricing model become undefined.
- IPriceModelFactory derived objects are responsible for creating IPriceModel derived objects as requested by a user.
- A library may contain multiple IPriceModelFactory derived objects, but it is not necessary.
- A single IPriceModelFactory may support up to max_value(long) number of IPriceModels.
The following table describes methods that must be implemented by the object derived from IPriceModelFactory.
|NumberOfSupportedPricingModels||Returns the number of pricing models supported by the factory. This is the total number of IPriceModels that exist with the Library and are created by this Factory.|
|GetPriceModelName||Returns the name of the pricing model based on the supplied index.|
|GetPriceModel||Returns the IPriceModel derived object based on the supplied index.|