Main Content

Adding Instruments to an Existing Portfolio Using Functions

To use the instadd function to add additional instruments to an existing instrument portfolio, provide the name of an existing portfolio as the first argument to the instadd function.

Consider, for example, a portfolio containing two cap instruments only:

Strike = [0.06; 0.07];
Settle = '08-Feb-2000';
Maturity = '15-Jan-2003';

Port_1 = instadd('Cap', Strike, Settle, Maturity);

These commands create a portfolio containing two cap instruments with the same settlement and maturity dates, but with different strikes. In general, the input arguments describing an instrument can be either a scalar, or a number of instruments (NumInst)-by-1 vector in which each element corresponds to an instrument. Using a scalar assigns the same value to all instruments passed in the call to instadd.

Use the instdisp command to display the contents of the instrument set:

instdisp(Port_1)

Index Type Strike Settle      Maturity    CapReset Basis Principal
1     Cap  0.06   08-Feb-2000 15-Jan-2003 1        0     100 
2     Cap  0.07   08-Feb-2000 15-Jan-2003 1        0     100 

Now add a single bond instrument to Port_1. The bond has a 4.0% coupon and the same settlement and maturity dates as the cap instruments.

CouponRate = 0.04;
Port_1 = instadd(Port_1, 'Bond', CouponRate, Settle, Maturity);

Use instdisp again to see the resulting instrument set:

instdisp(Port_1)


Index Type Strike Settle         Maturity       CapReset Basis Principal
1     Cap  0.06   08-Feb-2000    15-Jan-2003    1        0     100      
2     Cap  0.07   08-Feb-2000    15-Jan-2003    1        0     100      
 
Index Type CouponRate Settle         Maturity     Period Basis EndMonthRule IssueDate ... Face
3     Bond 0.04       08-Feb-2000    15-Jan-2003  2      0     1            NaN       ... 100

See Also

| | | | | | | | | | | | | |

Related Examples

More About