instswaption
Construct swaption instrument
Syntax
Description
to specify an American swaption.InstSet = instswaption(___,AmericanOpt,SwapReset,Basis,Principal)
to add swaption instruments to an instrument variable.InstSet = instswaption(InstSetOld,___)
[
to list field metadata for the swaption instrument.FieldList,ClassList,TypeString] = instswaption
Examples
This example shows how to create two European swaption instruments using the following data.
OptSpec = {'Call'; 'Put'};
Strike = .05;
ExerciseDates = datetime(2011,1,1);
Spread=0;
Settle = datetime(2007,1,1);
Maturity = datetime(2012,1,1);
AmericanOpt = 0;
InstSet = instswaption(OptSpec, Strike, ExerciseDates, Spread, Settle, Maturity, ...
AmericanOpt);
% view the European swaption instruments using instdisp
instdisp(InstSet)Index Type OptSpec Strike ExerciseDates Spread Settle Maturity AmericanOpt SwapReset Basis Principal FloatBasis FixedBasis FloatReset FixedReset 1 Swaption Call 0.05 01-Jan-2011 0 01-Jan-2007 01-Jan-2012 0 1 0 100 NaN NaN NaN NaN 2 Swaption Put 0.05 01-Jan-2011 0 01-Jan-2007 01-Jan-2012 0 1 0 100 NaN NaN NaN NaN
This example shows how to create two European swaption instruments with receiving and paying legs using the following data.
OptSpec = {'Call'; 'Put'};
Strike = .05;
ExerciseDates = datetime(2011,1,1);
Spread=0;
Settle = datetime(2007,1,1);
Maturity = datetime(2012,1,1);
AmericanOpt = 0;
SwapReset = [2 4]; % 1st column represents receiving leg, 2nd column represents paying leg
Basis = [1 3]; % 1st column represents receiving leg, 2nd column represents paying leg
InstSet = instswaption(OptSpec,Strike,ExerciseDates,AmericanOpt,Spread,Settle,Maturity, ...
SwapReset,Basis);View the European swaption instruments using instdisp.
instdisp(InstSet)
Index Type OptSpec Strike ExerciseDates Spread Settle Maturity AmericanOpt SwapReset Basis Principal FloatBasis FixedBasis FloatReset FixedReset 1 Swaption Call 0.05 01-Jan-2011 0 0 01-Jan-2007 NaN 2 4 1 3 100 NaN NaN NaN NaN 2 Swaption Put 0.05 01-Jan-2011 0 0 01-Jan-2007 NaN 2 4 1 3 100 NaN NaN NaN NaN
Input Arguments
Definition of the option as 'call' or 'put',
specified as a NINST-by-1 cell array of
character vectors with values 'call' or 'put'. A
'call' swaption entitles the buyer to pay the fixed rate. A
'put' swaption entitles the buyer to receive the fixed
rate.
Data Types: char | cell
Strike swap rate values, specified as a
NINST-by-1 vector.
Data Types: double
Option exercise dates, specified as a vector using a datetime array, string array, or date character vectors, where each row is the schedule for one option and the last element of each row must be the same as the maturity of the tree.
For a European option, use a
NINST-by-1vector of exercise dates. Each row is the schedule for one option. For a European option, there is only oneExerciseDateon the option expiry date.For an American option, use a
NINST-by-2vector of exercise dates. For each instrument, the option can be exercised on any coupon date between or including the pair of dates on that row. If only one non-NaNdate is listed, or ifExerciseDatesisNINST-by-1, the option can be exercised between the underlying swapSettleand the single listedExerciseDate.
To support existing code, instswaption also
accepts serial date numbers as inputs, but they are not recommended.
Number of basis points over the reference rate, specified as a vector of
nonnegative integers for the number of instruments
(NINST)-by-1).
Data Types: double
Settle date for each swap, specified as a
NINST-by-1 vector using a datetime array, string
array, or date character vectors.
To support existing code, instswaption also
accepts serial date numbers as inputs, but they are not recommended.
Maturity date for each swap, specified as a
NINST-by-1 vector using a datetime array, string
array, or date character vectors.
To support existing code, instswaption also
accepts serial date numbers as inputs, but they are not recommended.
(Optional) Option type, specified as
NINST-by-1 integer flags with values:
0— European1— American
The AmericanOpt argument is required to invoke American
exercise rules.
Data Types: double
(Optional) Reset frequency per year for each leg, specified as a
NINST-by-1 vector or
NINST-by-2 matrix. If
SwapReset is NINST-by-2,
the first column represents the receiving leg, while the second column represents the
paying leg.
Data Types: double
(Optional) Day-count basis of the instrument, specified as a
NINST-by-1 vector or
NINST-by-2 matrix representing the basis for
each leg. If Basis is
NINST-by-2, the first column represents the
receiving leg, while the second column represents the paying leg.
0 = actual/actual
1 = 30/360 (SIA)
2 = actual/360
3 = actual/365
4 = 30/360 (PSA)
5 = 30/360 (ISDA)
6 = 30/360 (European)
7 = actual/365 (Japanese)
8 = actual/actual (ICMA)
9 = actual/360 (ICMA)
10 = actual/365 (ICMA)
11 = 30/360E (ICMA)
12 = actual/365 (ISDA)
13 = BUS/252
For more information, see Basis.
Data Types: double
(Optional) Notional principal amount, specified as a
NINST-by-1 vector.
Data Types: double
Variable containing an existing collection of instruments, specified as a struct.
Instruments are classified by type; each type can have different data fields. The
stored data field is a row vector or character vector for each instrument. The
InstSetOld argument is specified only when adding swaption
instruments to an existing instrument set. For more information on the
InstSet variable, see instget.
Data Types: struct
Output Arguments
(Optional) Variable containing a collection of instruments. Instruments are broken
down by type and each type can have different data fields. Each stored data field has
a row vector or character vector for each instrument. For more information on the
InstSet variable, see instget.
Data Types: double
Name of each data field for this instrument type, returned as a
NFIELDS-by-1 cell array of character
vectors.
Data Types: char | cell
Data class of each field, returned as a
NFIELDS-by-1 cell array of character vectors.
Valid character vectors are 'dble', 'date', and
'char'.
Data Types: char | cell
Type of instrument added, returned as a character vector (for a swaption,
TypeString = 'Swaption').
Data Types: char
More About
A swaption (swap option) is a financial derivative that gives the holder the right, but not the obligation, to enter into an interest-rate swap agreement at a specified future date and under predetermined terms.
Swaptions are used by investors and institutions to hedge against interest rate fluctuations or to speculate on future changes in interest rates.
A call swaption or payer swaption allows the option buyer to enter into an interest-rate swap in which the buyer of the option pays the fixed rate and receives the floating rate.
A put swaption or receiver swaption allows the option buyer to enter into an interest-rate swap in which the buyer of the option receives the fixed rate and pays the floating rate.
Version History
Introduced before R2006aAlthough instswaption supports serial date numbers,
datetime values are recommended instead. The
datetime data type provides flexible date and time
formats, storage out to nanosecond precision, and properties to account for time
zones and daylight saving time.
To convert serial date numbers or text to datetime values, use the datetime function. For example:
t = datetime(738427.656845093,"ConvertFrom","datenum"); y = year(t)
y =
2021
There are no plans to remove support for serial date number inputs.
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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)