Main Content

setExercisePolicy

Set exercise policy for FixedBondOption, FloatBondOption, or Vanilla instrument

Since R2020b

Description

UpdatedInstrumentObject = setExercisePolicy(InstrumentObject,exerciseDate,Strike,exerciseStyle) sets the exercise policy for a FixedBondOption, FloatBondOption, or Vanilla instrument object.

example

Examples

collapse all

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"

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 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 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

collapse all

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

Exercise date, specified as a scalar datetime.

Data Types: datetime

Strike, specified as a scalar numeric.

Data Types: double

Option exercise style, specified as a scalar string or character vector.

Data Types: string | char

Output Arguments

collapse all

Updated instrument object, returned as an object.

Version History

Introduced in R2020b