Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments
Object-Based Framework Workflow
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 usingratecurve
.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 different types of instruments, 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 usingratecurve
.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.
See Also
fininstrument
| finmodel
| finpricer
Related Topics
- Choose Instruments, Models, and Pricers
- Mapping Financial Instruments Toolbox Functions to Object-Based Framework for Instruments, Models, and Pricers
- Mapping Financial Instruments Toolbox Curve Functions to Object-Based Framework