DiscountPricer =
Discount with properties:
DiscountCurve: [1x1 ratecurve]
Add Instruments to finportfolio Object
Create a finportflio object using finportfolio and use addInstrument to put the FixedBond instruments in the portfolio.
f1 = finportfolio;
f1 = addInstrument(f1,FixB1)
f1 =
finportfolio with properties:
Instruments: [1x1 fininstrument.FixedBond]
Pricers: [0x1 finpricer.FinPricer]
PricerIndex: NaN
Quantity: 1
f1 = addInstrument(f1,FixB2)
f1 =
finportfolio with properties:
Instruments: [2x1 fininstrument.FixedBond]
Pricers: [0x1 finpricer.FinPricer]
PricerIndex: [2x1 double]
Quantity: [2x1 double]
Set Pricer for Portfolio
Use setPricer to set the pricer for the portfolio and then use pricePortfolio to calculate the price and sensitivities for the instruments in the portfolio.
f1 = setPricer(f1,DiscountPricer,[1,2])
f1 =
finportfolio with properties:
Instruments: [2x1 fininstrument.FixedBond]
Pricers: [1x1 finpricer.Discount]
PricerIndex: [2x1 double]
Quantity: [2x1 double]
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.