setExercisePolicy
Set exercise policy for FixedBondOption
,
FloatBondOption
, or Vanilla
instrument
Since R2020b
Syntax
Description
sets the exercise policy for a UpdatedInstrumentObject
= setExercisePolicy(InstrumentObject
,exerciseDate
,Strike
,exerciseStyle
)FixedBondOption
,
FloatBondOption
, or
Vanilla
instrument
object.
Examples
Set Exercise Policy for Fixed Bond Option Instrument
This example shows how to use setExercisePolicy
to maintain consistency between the exercise schedule and exercise style when using a FixedBondOption
instrument.
Create FixedBond
Instrument Object
Use fininstrument
to create a FixedBond
instrument object as the underlying bond.
BondInst = fininstrument("FixedBond",'Maturity',datetime(2029,9,15),'CouponRate',.021,'Period',1,'Name',"bond_instrument");
Create FixedBondOption
Instrument Object
Use fininstrument
to create a callable FixedBondOption
instrument object with a European exercise.
FixedBOption = fininstrument("FixedBondOption",'ExerciseDate',datetime(2025,9,15),'Strike',98,'Bond',BondInst,'OptionType',"call",'ExerciseStyle',"european",'Name',"fixed_bond_option")
FixedBOption = FixedBondOption with properties: OptionType: "call" ExerciseStyle: "european" ExerciseDate: 15-Sep-2025 Strike: 98 Bond: [1x1 fininstrument.FixedBond] Name: "fixed_bond_option"
Set the Exercise Style to American
Use setExercisePolicy
to define ExerciseStyle
as American
.
FixedBOption = setExercisePolicy(FixedBOption,datetime(2025,9,15),98,"American")
FixedBOption = FixedBondOption with properties: OptionType: "call" ExerciseStyle: "american" ExerciseDate: 15-Sep-2025 Strike: 98 Bond: [1x1 fininstrument.FixedBond] Name: "fixed_bond_option"
Set Exercise Policy for a Specific Fixed Bond Option Instrument
This example shows how to use setExercisePolicy
to maintain consistency between the exercise schedule and exercise style when using a FixedBondOption
instrument object with three Fixed Bond instruments.
Create FixedBond
Instrument Object
Use fininstrument
to create a FixedBond
instrument object as the underlying bond.
BondInst = fininstrument("FixedBond",'Maturity',datetime(2029,9,15),'CouponRate',.021,'Period',1,'Name',"bond_instrument");
Create FixedBondOption
Instrument Object
Use fininstrument
to create a callable FixedBondOption
instrument object for three Fixed Bond Option instruments with European exercises.
FixedBOption = fininstrument("FixedBondOption",'ExerciseDate',datetime([2025,9,15 ; 2025,10,15 ; 2025,11,15]),'Strike',98,'Bond',BondInst,'OptionType',"call",'ExerciseStyle',"european",'Name',"fixed_bond_option")
FixedBOption=3×1 object
3x1 FixedBondOption array with properties:
OptionType
ExerciseStyle
ExerciseDate
Strike
Bond
Name
Set the Exercise Style to American
Use setExercisePolicy
to define ExerciseStyle
as American
for the second (FixedBOption(2)
) instrument.
FixedBOption(2) = setExercisePolicy(FixedBOption(2),datetime(2025,9,15),98,"American")
FixedBOption=3×1 object
3x1 FixedBondOption array with properties:
OptionType
ExerciseStyle
ExerciseDate
Strike
Bond
Name
FixedBOption(2).ExerciseStyle
ans = "american"
FixedBOption.ExerciseStyle
ans = "european"
ans = "american"
ans = "european"
Input Arguments
InstrumentObject
— Instrument object
FixedBondOption
object | FloatBondOption
object | Vanilla
object
Instrument object, specified using a previously created FixedBondOption
,
FloatBondOption
, or
Vanilla
instrument
object.
Note
If the FixedBondOption
, FloatBondOption
, or
Vanilla
instrument object is a vector of instruments, you must
use setExercisePolicy
separately with each instrument.
Data Types: object
exerciseDate
— Exercise date
datetime
Exercise date, specified as a scalar datetime.
Data Types: datetime
Strike
— Strike
numeric
Strike, specified as a scalar numeric.
Data Types: double
exerciseStyle
— Option exercise style
"American"
(default) | string with value "European"
, "American"
, or
"Bermudan"
| character vector with value 'European'
,
'American'
, or 'Bermudan'
Option exercise style, specified as a scalar string or character vector.
Data Types: string
| char
Output Arguments
UpdatedInstrumentObject
— Updated instrument object
object
Updated instrument object, returned as an object.
Version History
Introduced in R2020b
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)