Re: matching EUR OIS to bloomberg with python
Posted by vinnieb on Aug 03, 2016; 4:55pm
URL: http://quantlib.414.s1.nabble.com/matching-EUR-OIS-to-bloomberg-with-python-tp17631p17634.html
Hi Luigi,
I've come up with a data set that replicates the shape of the curve I'm interested in without being an actual copy (just playing it safe on data rights). Not sure if there is a format that helps, so I've just pasted as is from the Python code below. When I look at something similar in Bloomberg, I see a pretty tight tracking of zero rate to market rate with perhaps deviation at the 3rd decimal place, but when I calculate from those same market rates I get a big difference at the 2nd decimal between QL zero rates and bloomberg, and the same when I try compared to the other system I'm looking at. I don't know if there's either a solver accuracy threshold value that I need to set somewhere, or a mistake in code assumptions below maybe? I thought maybe interpolation method but I've tried a few variations on that without any significant improvement.
marketData = [(-0.34, (1,ql.Weeks)), (-0.34, (2,ql.Weeks)),
(-0.335, (1,ql.Months)), (-0.34, (2,ql.Months)),
(-0.34, (3,ql.Months)), (-0.34, (4,ql.Months)),
(-0.35, (5,ql.Months)), (-0.36, (6,ql.Months)),
(-0.362, (7,ql.Months)), (-0.366, (8,ql.Months)),
(-0.36, (9,ql.Months)), (-0.37, (10,ql.Months)),
(-0.375, (11,ql.Months)), (-0.378, (12,ql.Months)),
(-0.38, (18,ql.Months)), (-0.39, (2,ql.Years)),
(-0.38, (30,ql.Months)),
(-0.37, (3,ql.Years)), (-0.31, (4,ql.Years)),
(-0.25, (5,ql.Years)), (-0.15, (6,ql.Years)),
(-0.05, (7,ql.Years)), (0.05, (8,ql.Years)),
(0.15, (9,ql.Years)), (0.25, (10,ql.Years)),
(0.35, (11,ql.Years)), (0.45, (12,ql.Years)),
(0.60, (15,ql.Years)), (0.75, (20,ql.Years)),
(0.8, (25,ql.Years)), (0.84, (30,ql.Years)),
(0.85, (35,ql.Years)), (0.84, (40,ql.Years)),
(0.75, (50,ql.Years))]
rest of the code:
todaysDate = ql.Date(6,ql.July,2016)
ql.Settings.instance().evaluationDate = todaysDate
OIShelpers = [ ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(rate/100)),
ql.Period(1,ql.Days), fixingDays,
ql.TARGET(), ql.Following, False, ql.Actual360())
for rate, fixingDays in [(-0.33, 0) ] ]
eonia = ql.Eonia()
OIShelpers += [ ql.OISRateHelper(2, ql.Period(*tenor),
ql.QuoteHandle(ql.SimpleQuote(rate/100)), eonia)
for rate, tenor in marketData ]
eonia_curve = ql.PiecewiseLogCubicDiscount(0, ql.TARGET(), OIShelpers, ql.Actual365Fixed())
eonia_curve.enableExtrapolation()
And then data extracted via the code snippet in the original message.
Thanks a lot!