diff options
Diffstat (limited to 'python/yieldcurve.py')
| -rw-r--r-- | python/yieldcurve.py | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/python/yieldcurve.py b/python/yieldcurve.py index 6aefe563..fa7f153b 100644 --- a/python/yieldcurve.py +++ b/python/yieldcurve.py @@ -109,26 +109,21 @@ def YC(helpers = None, currency="USD", MarkitData=None): def jpYC(effective_date, currency="USD", MarkitData=None): if MarkitData is None: - MarkitData = getMarkitIRData(effective_date, - currency) - types = 'M'*len(MarkitData['deposits']) + 'S'*len(MarkitData['swaps']) - periods = [t for t, _ in MarkitData['deposits']] + \ - [t for t, _ in MarkitData['swaps']] - rates = [r for _, r in MarkitData['deposits']] + \ - [r for _, r in MarkitData['swaps']] - rates = np.array(rates) + markit_data = getMarkitIRData(effective_date, + currency) + periods, rates = zip(*markit_data['deposits']) + periods_swaps, rate_swaps = zip(*markit_data['swaps']) + types = 'M'*len(periods) + 'S'*len(periods_swaps) + rates = np.array(rates + rates_swaps) + periods = list(period + periods_swaps) if currency == "USD": fixed_period = '6M' float_period = '3M' - fixed_dcc = '30/360' - float_dcc ='ACT/360' elif currency == 'EUR': fixed_period = '12M' float_period = '6M' - fixed_dcc = '30/360' - float_dcc = 'ACT/360' return YieldCurve(effective_date, types, periods, rates, 'ACT/360',\ - fixed_period, float_period, fixed_dcc, float_dcc, + fixed_period, float_period, '30/360', 'ACT/360', BadDay.MODIFIED) def ql_to_jp(ql_yc): |
