Main Content

instadd

Add types to instrument collection

Description

InstSetNew = instadd(InstSetOld,TypeString,Data) adds instruments to an existing instrument set InstSet. The output InstSetNew is a new instrument set containing the input data.

InstSetNew and InstSetOld store instruments of types 'Asian', 'Barrier', 'Bond', 'CBond', 'Cap', 'CashFlow', 'Compound', 'Fixed', 'Float', 'Floor', 'Lookback', 'OptBond', 'OptEmBond', 'OptEmFloat', 'RangeFloat','OptStock', 'Swap', or 'Swaption'. Financial Instruments Toolbox™ provides pricing and sensitivity routines for these instruments.

example

Examples

collapse all

Define the bond:

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

Create a portfolio with two cap instruments and a 4% bond and then display the portfolio:

InstSet = instadd('Cap', Strike, Settle, Maturity); 
InstSet = instadd(InstSet, 'Bond', CouponRate, Settle, Maturity);
instdisp(InstSet)
Index Type Strike Settle         Maturity       CapReset Basis Principal
1     Cap  0.06   06-Feb-2000    15-Jan-2003    1        0     100      
2     Cap  0.07   06-Feb-2000    15-Jan-2003    1        0     100      
 
Index Type CouponRate Settle         Maturity       Period Basis EndMonthRule IssueDate FirstCouponDate LastCouponDate StartDate Face
3     Bond 0.04       06-Feb-2000    15-Jan-2003    2      0     1            NaN       NaN             NaN            NaN       100 
 

Input Arguments

collapse all

Existing instrument variable, specified as an InstSet structure.

InstSetOld can contain instruments of types 'Asian', 'Barrier', 'Bond', 'CBond', 'Cap', 'CashFlow', 'Compound', 'Fixed', 'Float', 'Floor', 'Lookback', 'OptBond', 'OptEmBond', 'OptEmFloat', 'RangeFloat', 'OptStock', 'Swap', or 'Swaption'.

Data Types: struct

Instrument type, specified as a character vector. The supported instrument types are:

  • 'Asian'

  • 'Barrier'

  • 'Bond'

  • 'CBond'

  • 'Cap'

  • 'CashFlow'

  • 'Compound'

  • 'Fixed'

  • 'Float'

  • 'Floor'

  • 'Lookback'

  • 'OptBond'

  • 'OptEmBond'

  • 'OptEmFloat'

  • 'RangeFloat'

  • 'OptStock'

  • 'Swap'

  • 'Swaption'

Note

Each instrument type can have different Data fields.

Data Types: char

Instrument data fields, specified as a row vector or character vector for each instrument.

  • 'Asian' — For example:

    InstSet = instadd('Asian',OptSpec,Strike,Settle,ExerciseDates)

    For more information on Asian instrument arguments, see instasian.

  • 'Barrier' — For example:

    InstSet = instadd('Barrier',OptSpec,Strike,Settle,ExerciseDates,AmericanOpt,BarrierType,Barrier,Rebate)

    For more information on the Barrier instrument arguments, see instbarrier.

  • 'Bond' — For example:

    InstSet = instadd('Bond',CouponRate,Settle,Maturity,Period,Basis,EndMonthRule,IssueDate,FirstCouponDate,LastCouponDate,StartDate,Face)

    For more information on the Bond instrument arguments , see instbond.

  • 'CBond' — For example:

    InstSet = instadd('CBond',CouponRate,Settle,Maturity,ConvRatio'CallStrike',CallStrike,'CallExDates',CallExDates,'AmericanCall',AmericanCall,'PutStrike',PutStrike, ...
    'PutExDates',PutExDates,'AmericanPut',AmericanPut,'Period',Period,'Face',Face,'Spread',Spread,'IssueDate',IssueDate,'FirstCouponDate',FirstCouponDate,'LastCouponDate', ...
    LastCouponDate,'StartDate',StartDate)
    

    For more information on the CBond instrument arguments , see instcbond.

  • 'Cap' — For example:

    InstSet = instadd('Cap',Strike,Settle,Maturity,Reset,Basis,Principal)

    For more information on the Cap instrument arguments , see instcap.

  • 'CashFlow' — For example:

    InstSet = instadd('CashFlow',CFlowAmounts,CFlowDates,Settle,Basis)

    For more information on the Cash Flow instrument arguments , see instcf.

  • 'Compound' — For example:

    InstSet = instadd('Compound',UOptSpec,UStrike,USettle,UExerciseDates,UAmericanOpt,COptSpec,CStrike,CSettle,CExerciseDates,CAmericanOpt)

    For more information on the Compound instrument arguments , see instcompound.

  • 'Fixed' — For example:

    InstSet = instadd('Fixed',CouponRate,Settle,Maturity,Reset,Basis,Principal,EndMonthRule)

    For more information on the Fixed instrument arguments , see instfixed.

  • 'Float' — For example:

    InstSet = instadd('Float',Spread,Settle,Maturity,Reset,Basis,Principal,EndMonthRule,CapRate,FloorRate)

    For more information on the Fixed instrument arguments , see instfloat.

  • 'Floor' — For example:

    InstSet = instadd('Floor',Strike,Settle,Maturity,Reset,Basis,Principal)

    For more information on the Floor instrument arguments , see instfloor.

  • 'Lookback' — For example:

    InstSet = instadd('Lookback',OptSpec,Strike,Settle,ExerciseDates,AmericanOpt)

    For more information on the Lookback instrument arguments , see instlookback.

  • 'OptBond' — For example:

    InstSet = instadd('OptBond',BondIndex,OptSpec,Strike,ExerciseDates,AmericanOpt)

    For more information on the Bond Option instrument arguments , see instoptbnd.

  • 'OptStock' — For example:

    InstSet = instadd('OptStock',OptSpec,Strike,Settle,Maturity,AmericanOpt)

    For more information on the Stock Option instrument arguments , see instoptstock.

  • 'OptEmBond' — For example:

    InstSet = instoptembnd(CouponRate, Settle, Maturity, OptSpec, Strike, ...
    ExerciseDates,'AmericanOpt', AmericanOpt, 'Period', Period)

    For more information on the Bond with embedded option instrument arguments , see instoptembnd.

  • 'OptemFloat' — For example:

    InstSet = instoptemfloat(Spread, Settle, Maturity, OptSpec, Strike, ...
    ExerciseDates,'FloatReset', Reset)

    For more information on the Floating Rate Note with an embedded option instrument arguments , see instoptemfloat.

  • 'RangeFloat' — For example:

    InstSet = instrangefloat(Spread, Settle, Maturity, RateSched)

    For more information on the Range Note instrument arguments , see instrangefloat.

  • 'Swap' — For example:

    InstSet = instadd('Swap',LegRate,Settle,Maturity,LegReset,Basis,Principal,LegType,EndMonthRule,StartDate)

    For more information on the Swap instrument arguments , see instswap.

  • 'Swaption' — For example:

    InstSet = instadd('Swap',LegRate,Settle,Maturity,LegReset,Basis,Principal,LegType,EndMonthRule,StartDate)

    For more information on the Swaption instrument arguments , see instswaption.

Data Types: char

Output Arguments

collapse all

InstSetNew is an instrument set containing the new input data, returned as a structure.

Version History

Introduced before R2006a