Financial Instruments Toolbox™ supports an object framework for pricing financial instruments. There
are three types of object constructors in the framework:
fininstrument
to create an instrument object,
finmodel
to create a model object, and
finpricer
to create a pricer object. The canonical workflow
to price an instrument is:
Create an instrument object using fininstrument
.
myInst = fininstrument(InstType,…)
Create a model object using finmodel
.
myModel = finmodel(ModelType,…)
Create a ratecurve
object using ratecurve
.
myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
Create a pricer object using finpricer
.
myPricer = finpricer(PricerType,myModel,myRC,...)
Price the instrument using an associated price
function.
[Price, PriceResult] = price(myPricer, myInst,…)
For examples showing how to use this workflow to create an instrument and a ratecurve
object, see:
You can also price an entire portfolio. After creating instrument objects and pricer
objects, you can add the instrument and pricer objects to a
finportfolio
object and then price the portfolio using this workflow:
Create instrument objects using fininstrument
.
myInst1 = fininstrument(InstType,…) myInst2 = fininstrument(InstType,…)
Create model objects using finmodel
.
myModel = finmodel(ModelType,…) myModel2 = finmodel(ModelType,…)
Create one or more ratecurve
objects using ratecurve
.
myRC1 = ratecurve('zero',Settle,ZeroDates,ZeroRates) myRC2 = ratecurve('zero',Settle,ZeroDates,ZeroRates)
Create a pricer object using finpricer
.
myPricer1 = finpricer(PricerType,myModel,myRC1,...) myPricer2 = finpricer(PricerType,myModel,myRC2,...)
Create a portfolio object using finportfolio
.
IP = finportfolio([MyInst1,MyInst2],[MyPricer1,MyPricer2],...)
Price the portfolio using pricePortfolio
.
[portPrice, portSens, instPrice, instSens] = price(IP)
For an example showing how to use this workflow to create a portfolio, see Workflow to Create and Price a Portfolio of Instruments.
fininstrument
| finmodel
| finpricer