diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2021-09-17 14:32:26 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2021-09-17 14:32:26 -0400 |
| commit | fbe778e3964b80517d1c442d3ca9d19c38e88a37 (patch) | |
| tree | e91f62140a6819e3bfdb1cbf8697f6931ee42ca4 | |
| parent | 60ea3e046ddc0942677a51c3b6688885d755df8b (diff) | |
| download | pyisda-fbe778e3964b80517d1c442d3ca9d19c38e88a37.tar.gz | |
use new templated PiecewiseYieldCurve
| -rw-r--r-- | pyisda/utils.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pyisda/utils.py b/pyisda/utils.py index 4e3b024..2e035cd 100644 --- a/pyisda/utils.py +++ b/pyisda/utils.py @@ -7,18 +7,20 @@ from quantlib.time.api import ( Months, ModifiedFollowing, Actual360, + Annual, Semiannual, Thirty360, Actual365Fixed, ) from quantlib.indexes.ibor_index import IborIndex from quantlib.currency.api import USDCurrency, EURCurrency -from quantlib.indexes.ibor_index import IborIndex from quantlib.termstructures.yields.api import ( + BootstrapTrait, PiecewiseYieldCurve, DepositRateHelper, SwapRateHelper, ) +from quantlib.math.interpolation import LogLinear import numpy as np import datetime import requests @@ -117,8 +119,8 @@ def rate_helpers(currency="USD", MarkitData=None): def YC(currency="USD", helpers=None, MarkitData=None): if helpers is None: helpers = rate_helpers(currency, MarkitData) - curve = PiecewiseYieldCurve(0, 1, 0, WeekendsOnly(), helpers, Actual365Fixed()) - return curve + return PiecewiseYieldCurve[BootstrapTrait.Discount, LogLinear]( + 0, WeekendsOnly(), helpers, Actual365Fixed()) def build_yc(trade_date, ql_curve=False): |
