Posted by
Jicun Zhong on
URL: http://quantlib.414.s1.nabble.com/QuantLib-Users-IborIndex-Fixings-vs-Bloomberg-Fixings-tp5632p5639.html
Hi,
I am still not sure what you are trying to achieve here. If you want to calculated the NPV and you define today as March 24, 2012 then you will not need any future fixings and it is also impossible to know any future fixings. Therefore the only thing QuantLib does is to forecast them and then use them to discount CFs to today. If you are interested to get the floating CFs on specific payment dates and you have fixings that should be used for these payment dates, then you can just construct a simple floating schedule to get the exact payment dates, using the floating day counter to get the year fraction and then multiply that with the fixing meant for that date and nominal. It is simple as that.
Regards!
jicun
-----Original Message-----
From: Smith, Dale [mailto:
[hidden email]]
Sent: den 11 april 2012 14:10
To: Jicun Zhong; Luigi Ballabio
Cc:
[hidden email]
Subject: RE: [Quantlib-users] [QuantLib-Users] IborIndex Fixings vsBloomberg Fixings
Hello,
Thanks very much for the responses.
The only future fixings available are forward rates built from today's yield curve. That's what Bloomberg uses. I thought the purpose of the IborIndex classes were to encapsulate this, however I see I was wrong.
I've decided I can use the InterpolatedDiscountCurve to achieve one of my goals by giving it discount factors. If this is in error, please let me know.
Thanks,
Dale Smith, Ph.D.
Senior Financial Quantitative Analyst
Risk & Compliance
Fiserv.
107 Technology Park
Norcross, GA 30092
Office: 678-375-5315
Mobile: 678-982-6599
Mail:
[hidden email]
www.fiserv.com
-----Original Message-----
From: Jicun Zhong [mailto:
[hidden email]]
Sent: Wednesday, April 11, 2012 4:00 AM
To: Smith, Dale; Luigi Ballabio
Cc:
[hidden email]
Subject: RE: [Quantlib-users] [QuantLib-Users] IborIndex Fixings vsBloomberg Fixings
Hello Dale,
If I understood correctly, the fixing will only affect the next floating cash flow in a Vanilla swap. Further floating CFs are estimated using the forward curve. Unless you are calculating already occurred floating CFs you will not need more than one fixing. From your code posted I see that you are value a swap start from March 26, 2012 and stretches out for 5 years, however all the fixings you added are future fixings which should be unknown to you because your today is March 24, 2012. Also I think QuantLib will not even try to use these fixing because future floating CFs are calculated using estimated/interpolated forward rates. So I am not sure what exactly do you want to achieve here. If you want to calculate future floating CFs you will not need more than 1 fixing. If you want to calculated occurred floating CFs, then you need to adjust you today's date.
Jicun
-----Original Message-----
From: Smith, Dale [mailto:
[hidden email]]
Sent: den 10 april 2012 16:13
To: Smith, Dale; Luigi Ballabio
Cc:
[hidden email]
Subject: Re: [Quantlib-users] [QuantLib-Users] IborIndex Fixings vs Bloomberg Fixings
Following up on my message from last week, here's what I've tried in the past few days.
Background: I created a simple fixed-floating swap in Bloomberg (using SWPM) and used the curve plus fixings from Bloomberg in some QuantLib code, closely following the swap example code in QuantLib.
My problem is the fixings from the floating leg index are not reproduced using
// constant nominal 1,000,000
Real nominal = 10000000.0;
// fixed leg
Frequency fixedLegFrequency = Quarterly; BusinessDayConvention fixedLegConvention = ModifiedFollowing; BusinessDayConvention floatingLegConvention = ModifiedFollowing; DayCounter fixedLegDayCounter = Thirty360(); Rate fixedRate = 0.01373122; DayCounter floatingLegDayCounter = Actual360(); // floating leg Frequency floatingLegFrequency = Quarterly; boost::shared_ptr<IborIndex> idx(new USDLibor(Period(3, Months), forecastingTermStructure)); ...
boost::shared_ptr<YieldTermStructure> depoFutSwapTermStructure(
new PiecewiseYieldCurve<ZeroYield, Linear>(
settlementDate, depoFutSwapInstruments,
termStructureDayCounter,
tolerance)
);
My questions are
* Has anyone successfully tied out a swap from SWPM with QuantLib swap valuation?
* Am I using the wrong class to build a YieldTermStructure?
I've done a lot of googling around about this, looked at the QuantLib examples, read the documentation, and stepped through the QuantLib code using a debugger. I've also checked
* Day count conventions (deposit, futures, and swap)
* Schedule dates (QuantLib dates are the same as in Bloomberg)
* Business day convention (modified following for both swap legs)
* Roll convention (Bloomberg has Backward (end of month))
* Bloomberg verifies they are using 3 month forward rates calculated from the curve I've selected in SWPM.
I can calculate the floating leg payments in Excel using the Bloomberg fixings, so I've isolated the problem to just the fixings and the yield curve structure.
Relevant code may be found at
http://sourceforge.net/mailarchive/message.php?msg_id=29078963I am sure I'm missing something here. Any advice is appreciated.
Thanks,
Dale Smith, Ph.D.
Senior Financial Quantitative Analyst
Risk & Compliance
Fiserv.
107 Technology Park
Norcross, GA 30092
Office: 678-375-5315
Mobile: 678-982-6599
Mail:
[hidden email]
www.fiserv.com
-----Original Message-----
From: Smith, Dale
Sent: Tuesday, April 10, 2012 7:58 AM
To: Luigi Ballabio
Cc:
[hidden email]
Subject: RE: [Quantlib-users] [QuantLib-Users] IborIndex Fixings vs Bloomberg Fixings
Hello,
Hello,
I don't want to be a pest but I need to get this resolved one way or another. Which YieldTermStructure derived class should I use to get back the exact fixings I've supplied? Here's what I'm using now.
>> boost::shared_ptr<YieldTermStructure>
>> depoFutSwapTermStructure(
>>
>> //new PiecewiseYieldCurve<Discount, Linear>(
>>
>> new PiecewiseYieldCurve<ZeroYield, Linear>(
>>
>> settlementDate,
>> depoFutSwapInstruments,
>>
>> termStructureDayCounter,
>>
>> tolerance));
I sent the interest rates I'm using in an earlier message.
Thanks,
Dale Smith, Ph.D.
Senior Financial Quantitative Analyst
Risk & Compliance
Fiserv.
107 Technology Park
Norcross, GA 30092
Office: 678-375-5315
Mobile: 678-982-6599
Mail:
[hidden email]
www.fiserv.com
-----Original Message-----
From: Luigi Ballabio [mailto:
[hidden email]]
Sent: Monday, April 02, 2012 5:05 PM
To: Smith, Dale
Cc:
[hidden email]
Subject: Re: [Quantlib-users] [QuantLib-Users] IborIndex Fixings vs Bloomberg Fixings
Ok, thanks. I probably won't be able to follow through this week (I'll be on vacation starting Wednesday) but hopefully someone can pick it up.
On Mon, Apr 2, 2012 at 10:20 PM, Smith, Dale <
[hidden email]> wrote:
> Thanks for responding.
>
> I can put this together for you tomorrow my time.
>
> Thanks,
> Dale Smith, Ph.D.
> Senior Financial Quantitative Analyst
> Risk & Compliance
> Fiserv.
> 107 Technology Park
> Norcross, GA 30092
> Office: 678-375-5315
> Mobile: 678-982-6599
> Mail:
[hidden email]
> www.fiserv.com
>
>
> -----Original Message-----
> From: Luigi Ballabio [mailto:
[hidden email]]
> Sent: Monday, April 02, 2012 4:16 PM
> To: Smith, Dale
> Cc:
[hidden email]
> Subject: Re: [Quantlib-users] [QuantLib-Users] IborIndex Fixings vs
> Bloomberg Fixings
>
> Sorry, I had saved your post but I didn't have time to follow through.
> Do you have a set of inputs that reproduces the problem? (Evaluation
> date, input rates, conventions you're using...)
>
> Luigi
>
>
> On Mon, Apr 2, 2012 at 9:49 PM, Smith, Dale <
[hidden email]> wrote:
>> Sending again in hopes it was simply forgotten...
>>
>>
>>
>> Thanks,
>>
>> Dale Smith, Ph.D.
>>
>> Senior Financial Quantitative Analyst
>>
>> Risk & Compliance
>>
>> Fiserv.
>>
>> 107 Technology Park
>>
>> Norcross, GA 30092
>>
>> Office: 678-375-5315
>>
>> Mobile: 678-982-6599
>>
>> Mail:
[hidden email]
>>
>> www.fiserv.com
>>
>>
>>
>> From: Smith, Dale
>> Sent: Thursday, March 29, 2012 10:43 AM
>> To:
[hidden email]
>> Subject: [QuantLib-Users] IborIndex Fixings vs Bloomberg Fixings
>>
>>
>>
>> Hello,
>>
>>
>>
>> I'm trying to tie out a QuantLib program with Bloomberg's SWPM screen.
>> I have the deposit, futures, and swap rates as in the Swap example
>> project, and created an IborIndex using the joint UK and US calendars
>> to pick up both sets of holidays.
>>
>>
>>
>> boost::shared_ptr<IborIndex> idx(new USDLibor(Period(3, Months),
>> forecastingTermStructure));
>>
>>
>>
>> forecastingTermStructure is linked to
>>
>>
>>
>> boost::shared_ptr<YieldTermStructure>
>> depoFutSwapTermStructure(
>>
>> //new PiecewiseYieldCurve<Discount, Linear>(
>>
>> new PiecewiseYieldCurve<ZeroYield, Linear>(
>>
>> settlementDate,
>> depoFutSwapInstruments,
>>
>> termStructureDayCounter,
>>
>> tolerance));
>>
>>
>>
>> My problem is the fixings used in the floating leg that Bloomberg
>> uses are not the same as what QuantLib uses. I did do a clearFixing()
>> on the IborIndex object and added the fixings I see on the SWPM
>> Resets tab. I've also confirmed by calculations in Excel that the
>> difference in cashflows on the floating leg is due entirely to the fixings.
>>
>>
>>
>> Bloomberg uses Piecewise Linear (Simple) for the interpolation. I
>> changed that to Piecewise Linear (Continuous) but the fixings still
>> don't match. I also changed to PiecewiseYieldCurve<ZeroYield, Linear>
>> in my own code after confirming with Bloomberg they are interpolating
>> the term structure, not the discount factors or the market rates.
>>
>>
>>
>> I've used Google to search for answers to this, and looked at the
>> examples and unit tests in the QuantLib code. Is there anywhere I've
>> missed in my searches?
>>
>>
>>
>> Thanks,
>>
>> Dale Smith, Ph.D.
>>
>> Senior Financial Quantitative Analyst
>>
>> Risk & Compliance
>>
>> Fiserv.
>>
>> 107 Technology Park
>>
>> Norcross, GA 30092
>>
>> Office: 678-375-5315
>>
>> Mobile: 678-982-6599
>>
>> Mail:
[hidden email]
>>
>> www.fiserv.com
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> -
>> --------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>>
http://p.sf.net/sfu/sfd2d-msazure
>> _______________________________________________
>> QuantLib-users mailing list
>>
[hidden email]
>>
https://lists.sourceforge.net/lists/listinfo/quantlib-users>>
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users