Main Content

setExercisePolicy

Set exercise policy for FixedBondOption, FloatBondOption, or Vanilla instrument

Description

example

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

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"

Input Arguments

collapse all

Instrument object, specified using a previously created FixedBondOption, FloatBondOption, or Vanilla instrument object.

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.

Introduced in R2020b