@@ -813,6 +813,10 @@ def test_cpn_types():
813813
814814def test_stack_exchange ():
815815
816+ # https://quant.stackexchange.com/questions/66508/schedule-yield-to-maturity-and-npv-of-fixed-rate-bond-from-quantlib-python
817+
818+ # Unable to reconcile with strange example
819+
816820 issue_dt = Date (28 , 9 , 2019 )
817821 maturity_dt = Date (28 , 9 , 2024 )
818822 coupon = 0.05
@@ -823,9 +827,9 @@ def test_stack_exchange():
823827
824828 value_dt = Date (31 , 7 , 2020 )
825829 settle_dt = value_dt .add_days (100 )
826- print (settle_dt )
830+ # print(settle_dt)
827831
828- print (bond .print_payments (settle_dt , 100 ))
832+ # print(bond.print_payments(settle_dt, 100))
829833
830834 spot_dts = [Date (31 , 7 , 2020 ), Date (1 , 1 , 2027 )]
831835 spot_rates = [0.01 , 0.02 ]
@@ -839,15 +843,15 @@ def test_stack_exchange():
839843 DayCountTypes .ACT_360 ,
840844 )
841845
842- print (
843- "Dirty Price = %12.7f"
844- % bond .dirty_price_from_discount_curve (settle_dt , zero_curve )
845- )
846+ # print(
847+ # "Dirty Price = %12.7f"
848+ # % bond.dirty_price_from_discount_curve(settle_dt, zero_curve)
849+ # )
846850
847- print (
848- "Clean Price = %12.7f"
849- % bond .clean_price_from_discount_curve (settle_dt , zero_curve )
850- )
851+ # print(
852+ # "Clean Price = %12.7f"
853+ # % bond.clean_price_from_discount_curve(settle_dt, zero_curve)
854+ # )
851855
852856
853857###############################################################################
0 commit comments