instadd
Add types to instrument collection
Description
adds instruments to an existing instrument set InstSetNew
= instadd(InstSetOld
,TypeString
,Data
)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.
Examples
Create a Portfolio with Two Cap Instruments and a 4% Bond
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
InstSetOld
— Existing instrument variable
structure
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
TypeString
— Instrument type
character vector
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
Data
— Instrument data fields
vector
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
InstSetNew
— Instrument set containing the new input data
structure
InstSetNew
is an instrument set containing the new
input data, returned as a structure.
Version History
Introduced before R2006a
See Also
instasian
| instbarrier
| instbond
| instcap
| instcf
| instcompound
| instfixed
| instfloat
| instfloor
| instlookback
| instoptbnd
| instoptembnd
| instoptstock
| instswap
| instswaption
| instaddfield
| instdisp
| instcbond
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
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.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)