Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Prices fixed income, equity, FX and credit derivatives with QuantLib Python, covering yield curves, options, swaps and bonds.
73% 86%+14 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 16 of 22 without it.
3 of 3 safety checks passed
Not used yet
QuantLib Python provides pricing and risk analytics for fixed income, equity, FX, and credit derivatives. Covers yield curves, options, swaps, bonds, caps/floors, swaptions, and structured products. The standard open-source quantitative finance library used by banks, hedge funds, and fintech.
uv pip install QuantLib-Python
import QuantLib as ql
ql.Settings.instance().evaluationDate = ql.Date(15, 6, 2024)
schedule = ql.Schedule(
ql.Date(15, 6, 2023), ql.Date(15, 6, 2028),
ql.Period(ql.Semiannual),
ql.UnitedStates(ql.UnitedStates.GovernmentBond),
ql.Unadjusted, ql.Unadjusted,
ql.DateGeneration.Backward, False)
bond = ql.FixedRateBond(2, 100.0, schedule, [0.05], ql.ActualActual())
ytm = bond.bondYield(95.0, ql.ActualActual(), ql.Compounded, ql.Semiannual)
print(f"YTM: {ytm:.4%}")
Next to this one in the catalogue, plus more from the same author.