New answers tagged

0

The HestonModelHelper in QuantLib expects a spot value, strike and BlackVol. In theory, you could convert the strike of your FX Options (which are normally quoted in Delta terms) into an absolute strike (Check this post for details), and then calibrate the model as if the instruments were options on an equity where the foreign rate would be the dividend. I ...


4

I would start by saying that yes, this is an acceptable precision. However, the reason you are not getting the same result is because, by default, QuantLib has accuracy=1.0e-8 and maxEvaluations=100. You can set these parameters like this: bond.bondYield(bond_price, dayCount, ql.Simple, ql.Quarterly, ql.Date(), 1.0e-16, 100) This will get you much closer....


0

The final payments on both legs of an AssetSwap should obviously be included wherever you choose to value it, both for the par Asset Swap and Market Asset Swap cases. In the QuantLib test suit you refer to, I see the final interest payments do exist, and are consistent with Bloomberg's pricer. Taking the first example for that example, for the fixed (bond) ...


1

QuantLib does have the SquareRootProcess class (link) but it has not been interfaced in SWIG and that's why it is not available in QuantLib-Python. If you open an issue on github, maybe someone will pick it up.


0

The problem is that the Bond constructor expects a leg of coupons and you are giving it a leg of simple cashflows. You can build it like this (the redemptions will be assumed from the coupons): dc = ql.Thirty360() cf1 = ql.FixedRateCoupon(ql.Date(25,1,2019), 100, 0.03, dc, ql.Date(25,1,2018), ql.Date(25,1,2019)) cf2 = ql.FixedRateCoupon(ql.Date(25,1,2020), ...


0

They are different, because you print the curve1 again under curve2.


1

To add a possible solution for your last comment: "usually in loans one is interested in the coupon rate that returns certain NPV, instead of the usual IRR"... In python you could extend the Bond class with your own function to get the coupon with matrix algebra. $$PV_{Loan} = PV_{amortizaitons} + PV_{coupons}$$ Decomposing the PV of the coupon by vectors:...


Top 50 recent answers are included