@@ -121,7 +121,8 @@ def __init__(
121121 self .put_dts = put_dts
122122 self .put_prices = put_prices
123123 self .par = 100.0
124- self .bond ._calculate_unadjusted_cpn_dts ()
124+ self .bond ._calculate_cpn_dts ()
125+ self .bond ._calculate_payment_dts ()
125126
126127 ####################################################################################
127128
@@ -136,7 +137,7 @@ def value(self, settle_dt: Date, discount_curve: DiscountCurve, model):
136137 cpn_times = []
137138 cpn_amounts = []
138139
139- for flow_dt in self .bond .cpn_dts [1 :]:
140+ for flow_dt in self .bond .payment_dts [1 :]:
140141 if flow_dt > settle_dt :
141142 cpn_time = (flow_dt - settle_dt ) / G_DAYS_IN_YEARS
142143 cpn_times .append (cpn_time )
@@ -209,10 +210,11 @@ def value(self, settle_dt: Date, discount_curve: DiscountCurve, model):
209210
210211 elif isinstance (model , BKTree ):
211212
212- """ Because we not have a closed form bond price we need to build
213- the tree out to the bond maturity which is after option expiry."""
213+ # Because we not have a closed form bond price we need to build
214+ # the tree out to the bond maturity which is after option expiry.
214215
215216 model .build_tree (t_mat , df_times , df_values )
217+
216218 v1 = model .callable_puttable_bond_tree (
217219 cpn_times ,
218220 cpn_amounts ,
@@ -222,8 +224,11 @@ def value(self, settle_dt: Date, discount_curve: DiscountCurve, model):
222224 put_prices ,
223225 face_amount ,
224226 )
227+
225228 model .num_time_steps += 1
229+
226230 model .build_tree (t_mat , df_times , df_values )
231+
227232 v2 = model .callable_puttable_bond_tree (
228233 cpn_times ,
229234 cpn_amounts ,
0 commit comments