aboutsummaryrefslogtreecommitdiffstats
path: root/python/yieldcurve.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/yieldcurve.py')
-rw-r--r--python/yieldcurve.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/yieldcurve.py b/python/yieldcurve.py
index ba454d76..934d5bc4 100644
--- a/python/yieldcurve.py
+++ b/python/yieldcurve.py
@@ -206,15 +206,17 @@ def build_curves(currency="USD"):
if __name__=="__main__":
#evaluation_date = Date(29, 4, 2014)
Settings.instance().evaluation_date = today()
+
import matplotlib.pyplot as plt
- ts = YC()
+ helpers = rate_helpers("USD")
+ ts = YC(helpers)
cal = calendar_from_name('USA')
p1 = Period('1M')
p2 = Period('2M')
p3 = Period('3M')
p6 = Period('6M')
p12 = Period('12M')
- sched = Schedule(ts.reference_date, ts.reference_date+Period('5Y'), Period('3M'), cal)
+ sched = Schedule.from_rule(ts.reference_date, ts.reference_date + Period('5Y'), Period('3M'), cal)
days = [pydate_from_qldate(d) for d in sched]
f3 = [ts.forward_rate(d, d + p3, Actual360(), 0).rate for d in sched]
f6 = [ts.forward_rate(d, d + p6, Actual360(), 0).rate for d in sched]