Main Content

Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments

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:

  1. Create an instrument object using fininstrument.

    myInst = fininstrument(InstType,…)

  2. Create a model object using finmodel.

    myModel = finmodel(ModelType,…)

  3. Create a ratecurve object using ratecurve.

    myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)

  4. Create a pricer object using finpricer.

    myPricer = finpricer(PricerType,myModel,myRC,...)

  5. 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:

  1. Create instrument objects using fininstrument.

    myInst1 = fininstrument(InstType,…)
    myInst2 = fininstrument(InstType,…)

  2. Create model objects using finmodel.

    myModel = finmodel(ModelType,…)
    myModel2 = finmodel(ModelType,…)
    

  3. Create one or more ratecurve objects using ratecurve.

    myRC1 = ratecurve('zero',Settle,ZeroDates,ZeroRates)
    myRC2 = ratecurve('zero',Settle,ZeroDates,ZeroRates)
    

  4. Create a pricer object using finpricer.

    myPricer1 = finpricer(PricerType,myModel,myRC1,...)
    myPricer2 = finpricer(PricerType,myModel,myRC2,...)
    

  5. Create a portfolio object using finportfolio.

    IP = finportfolio([MyInst1,MyInst2],[MyPricer1,MyPricer2],...)

  6. 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

| |

Related Topics