I am trying to use QuantLib library in order to calculate prices given the yield for US Treasury Notes and Bonds.
When calculating the present values in Bloomberg, it discounts future cash flows in compound method except when the settlement is in the last coupon period where Bloomberg discounts the cash flows using simple method instead of compounding.
However in QuantLib, I am unable to find a compounding method to support the above discounting. QuantLib has the following compounding methods.
Simple
Compounded
Continuous
SimpleThenCompounded
If I use 'Compounded', QuantLib price matches with Bloomberg only when the settlement is before the final coupon period. On the other hand, if I use 'SimpleThenCompounded', QuantLib price matches Bloomberg only when the settlement is in the final coupon period.
I appreciate if someone can help me to resolve this.
Thanks
-James