dual curve bootstrapping

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

dual curve bootstrapping

ashwinids
I'm trying to learn dual curve bootstrapping by following the paper
          discouting.cpphttps://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVuaqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E

First I created full ois discounting curve,then supplied it to the swapratehelper to bootstrap the forward curve.

code for swapratehelper:

      boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
        Handle<Quote>(s12mRate), 1*Years,
        calendar, swFixedLegFrequency,
        swFixedLegConvention, swFixedLegDayCounter,
        swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)));

I'm getting compilation errors
  no known conversion for argument 1 from ‘QuantLib::Handle<QuantLib::Quote>’ to ‘QuantLib::Rate {aka double}
 no known conversion for argument 8 from ‘QuantLib::Handle<QuantLib::YieldTermStructure>’ to ‘const QuantLib::Handle<QuantLib::Quote>&


These compilation error start after addition of QuantLib::Handle<QuantLib::YieldTermStructure> to swapratehelper constructor.

I have attached a sample of the code.
Please guide me here,what i'm doing wrong?



   
Reply | Threaded
Open this post in threaded view
|

Re: dual curve bootstrapping

Peter Caspers-4
Hi,

the compiler is not able to match any of the four constructors. You
are obviously trying to call the second one. In your code

boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
        Handle(s12mRate), 1*Years,
        calendar, swFixedLegFrequency,
        swFixedLegConvention, swFixedLegDayCounter,
        swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)));

you should write Handle<Quote>(s12mRate), and make sure, that s12mRate
is of type boost::shared_ptr<Quote> and OISwapTermStructure is of type
boost::shared_ptr<YieldTermStructure>.

If you attach the full code we could have a more detailed look.

Peter




On 4 October 2015 at 16:44, ashwinids <[hidden email]> wrote:

> I'm trying to learn dual curve bootstrapping by following the paper
>            discouting.cpp
> <http://quantlib.10058.n7.nabble.com/file/n16940/discouting.cpp>
> https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVuaqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E
> <https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVuaqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E>
>
> First I created full ois discounting curve,then supplied it to the
> swapratehelper to bootstrap the forward curve.
>
> code for swapratehelper:
>
>       boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>         Handle(s12mRate), 1*Years,
>         calendar, swFixedLegFrequency,
>         swFixedLegConvention, swFixedLegDayCounter,
>
> swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)));
>
> I'm getting compilation errors
>   no known conversion for argument 1 from
> ‘QuantLib::Handle<QuantLib::Quote>’ to ‘QuantLib::Rate {aka double}
>  no known conversion for argument 8 from
> ‘QuantLib::Handle<QuantLib::YieldTermStructure>’ to ‘const
> QuantLib::Handle<QuantLib::Quote>&
>
>
> These compilation error start after addition of
> QuantLib::Handle<QuantLib::YieldTermStructure> to swapratehelper
> constructor.
>
> I have attached a sample of the code.
> Please guide me here,what i'm doing wrong?
>
>
>
>
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/dual-curve-bootstrapping-tp16940.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: dual curve bootstrapping

Luigi Ballabio
Also, the constructor takes two other arguments between the index and the discount curve. Using the default values for those, the complete call should be:

      boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
        Handle<Quote>(s12mRate), 1*Years,
        calendar, swFixedLegFrequency,
        swFixedLegConvention, swFixedLegDayCounter,
        swFloatingLegIndex, Handle<Quote>(), 0*Days,
        Handle<YieldTermStructure>(OISwapTermStructure)));

Luigi


On Sun, Oct 4, 2015 at 7:15 PM Peter Caspers <[hidden email]> wrote:
Hi,

the compiler is not able to match any of the four constructors. You
are obviously trying to call the second one. In your code

boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
        Handle(s12mRate), 1*Years,
        calendar, swFixedLegFrequency,
        swFixedLegConvention, swFixedLegDayCounter,
        swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)));

you should write Handle<Quote>(s12mRate), and make sure, that s12mRate
is of type boost::shared_ptr<Quote> and OISwapTermStructure is of type
boost::shared_ptr<YieldTermStructure>.

If you attach the full code we could have a more detailed look.

Peter




On 4 October 2015 at 16:44, ashwinids <[hidden email]> wrote:
> I'm trying to learn dual curve bootstrapping by following the paper
>            discouting.cpp
> <http://quantlib.10058.n7.nabble.com/file/n16940/discouting.cpp>
> https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVuaqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E
> <https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVuaqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E>
>
> First I created full ois discounting curve,then supplied it to the
> swapratehelper to bootstrap the forward curve.
>
> code for swapratehelper:
>
>       boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>         Handle(s12mRate), 1*Years,
>         calendar, swFixedLegFrequency,
>         swFixedLegConvention, swFixedLegDayCounter,
>
> swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)));
>
> I'm getting compilation errors
>   no known conversion for argument 1 from
> ‘QuantLib::Handle<QuantLib::Quote>’ to ‘QuantLib::Rate {aka double}
>  no known conversion for argument 8 from
> ‘QuantLib::Handle<QuantLib::YieldTermStructure>’ to ‘const
> QuantLib::Handle<QuantLib::Quote>&
>
>
> These compilation error start after addition of
> QuantLib::Handle<QuantLib::YieldTermStructure> to swapratehelper
> constructor.
>
> I have attached a sample of the code.
> Please guide me here,what i'm doing wrong?
>
>
>
>
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/dual-curve-bootstrapping-tp16940.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--

------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: dual curve bootstrapping

ashwinids
I'm using Handle<Quote> in my actual code,it is during asking that i
missed the '<Quote>'.
I'm sorry for that.

Using Luigi solution, i'm able to compile it. I'm not a c++ champ, but
shouldn't constructors work without providing parameters with default
values.

Thank you very much for help.


On 10/4/15, Luigi Ballabio <[hidden email]> wrote:

> Also, the constructor takes two other arguments between the index and the
> discount curve. Using the default values for those, the complete call
> should be:
>
>       boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>         Handle<Quote>(s12mRate), 1*Years,
>         calendar, swFixedLegFrequency,
>         swFixedLegConvention, swFixedLegDayCounter,
>         swFloatingLegIndex, Handle<Quote>(), 0*Days,
>         Handle<YieldTermStructure>(OISwapTermStructure)));
>
> Luigi
>
>
> On Sun, Oct 4, 2015 at 7:15 PM Peter Caspers <[hidden email]>
> wrote:
>
>> Hi,
>>
>> the compiler is not able to match any of the four constructors. You
>> are obviously trying to call the second one. In your code
>>
>> boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>>         Handle(s12mRate), 1*Years,
>>         calendar, swFixedLegFrequency,
>>         swFixedLegConvention, swFixedLegDayCounter,
>>
>> swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)));
>>
>> you should write Handle<Quote>(s12mRate), and make sure, that s12mRate
>> is of type boost::shared_ptr<Quote> and OISwapTermStructure is of type
>> boost::shared_ptr<YieldTermStructure>.
>>
>> If you attach the full code we could have a more detailed look.
>>
>> Peter
>>
>>
>>
>>
>> On 4 October 2015 at 16:44, ashwinids <[hidden email]> wrote:
>> > I'm trying to learn dual curve bootstrapping by following the paper
>> >            discouting.cpp
>> > <http://quantlib.10058.n7.nabble.com/file/n16940/discouting.cpp>
>> >
>> https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVuaqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E
>> > <
>> https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVuaqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E
>> >
>> >
>> > First I created full ois discounting curve,then supplied it to the
>> > swapratehelper to bootstrap the forward curve.
>> >
>> > code for swapratehelper:
>> >
>> >       boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>> >         Handle(s12mRate), 1*Years,
>> >         calendar, swFixedLegFrequency,
>> >         swFixedLegConvention, swFixedLegDayCounter,
>> >
>> > swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)));
>> >
>> > I'm getting compilation errors
>> >   no known conversion for argument 1 from
>> > ‘QuantLib::Handle<QuantLib::Quote>’ to ‘QuantLib::Rate {aka double}
>> >  no known conversion for argument 8 from
>> > ‘QuantLib::Handle<QuantLib::YieldTermStructure>’ to ‘const
>> > QuantLib::Handle<QuantLib::Quote>&
>> >
>> >
>> > These compilation error start after addition of
>> > QuantLib::Handle<QuantLib::YieldTermStructure> to swapratehelper
>> > constructor.
>> >
>> > I have attached a sample of the code.
>> > Please guide me here,what i'm doing wrong?
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://quantlib.10058.n7.nabble.com/dual-curve-bootstrapping-tp16940.html
>> > Sent from the quantlib-users mailing list archive at Nabble.com.
>> >
>> >
>> ------------------------------------------------------------------------------
>> > _______________________________________________
>> > QuantLib-users mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
> --
>
> <http://leanpub.com/implementingquantlib/>
> <http://implementingquantlib.com>
> <http://twitter.com/lballabio>
>


--
Thanks & regards
Ashwini kumar pal
09919169021

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: dual curve bootstrapping

Stefano Portolan
Hello,

If I am not mistaken you can leave the default arguments apart in a C++ call if (and only if) they are the last parameters of your call. Being in the middle in your case you do have to provide at least the default values as Luigi showed you.

Cheers.
Stefano



-----Original Message-----
From: ashwini pal [mailto:[hidden email]]
Sent: lundi 5 octobre 2015 05:22
To: Luigi Ballabio
Cc: QuantLib users
Subject: Re: [Quantlib-users] dual curve bootstrapping

I'm using Handle<Quote> in my actual code,it is during asking that i missed the '<Quote>'.
I'm sorry for that.

Using Luigi solution, i'm able to compile it. I'm not a c++ champ, but shouldn't constructors work without providing parameters with default values.

Thank you very much for help.


On 10/4/15, Luigi Ballabio <[hidden email]> wrote:

> Also, the constructor takes two other arguments between the index and
> the discount curve. Using the default values for those, the complete
> call should be:
>
>       boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>         Handle<Quote>(s12mRate), 1*Years,
>         calendar, swFixedLegFrequency,
>         swFixedLegConvention, swFixedLegDayCounter,
>         swFloatingLegIndex, Handle<Quote>(), 0*Days,
>         Handle<YieldTermStructure>(OISwapTermStructure)));
>
> Luigi
>
>
> On Sun, Oct 4, 2015 at 7:15 PM Peter Caspers <[hidden email]>
> wrote:
>
>> Hi,
>>
>> the compiler is not able to match any of the four constructors. You
>> are obviously trying to call the second one. In your code
>>
>> boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>>         Handle(s12mRate), 1*Years,
>>         calendar, swFixedLegFrequency,
>>         swFixedLegConvention, swFixedLegDayCounter,
>>
>> swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)));
>>
>> you should write Handle<Quote>(s12mRate), and make sure, that
>> s12mRate is of type boost::shared_ptr<Quote> and OISwapTermStructure
>> is of type boost::shared_ptr<YieldTermStructure>.
>>
>> If you attach the full code we could have a more detailed look.
>>
>> Peter
>>
>>
>>
>>
>> On 4 October 2015 at 16:44, ashwinids <[hidden email]> wrote:
>> > I'm trying to learn dual curve bootstrapping by following the paper
>> >            discouting.cpp
>> > <http://quantlib.10058.n7.nabble.com/file/n16940/discouting.cpp>
>> >
>> https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad
>> =rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%
>> 2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVu
>> aqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E
>> > <
>> https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad
>> =rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%
>> 2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVu
>> aqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E
>> >
>> >
>> > First I created full ois discounting curve,then supplied it to the
>> > swapratehelper to bootstrap the forward curve.
>> >
>> > code for swapratehelper:
>> >
>> >       boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>> >         Handle(s12mRate), 1*Years,
>> >         calendar, swFixedLegFrequency,
>> >         swFixedLegConvention, swFixedLegDayCounter,
>> >
>> > swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure))
>> > );
>> >
>> > I'm getting compilation errors
>> >   no known conversion for argument 1 from
>> > ‘QuantLib::Handle<QuantLib::Quote>’ to ‘QuantLib::Rate {aka double}  
>> > no known conversion for argument 8 from
>> > ‘QuantLib::Handle<QuantLib::YieldTermStructure>’ to ‘const
>> > QuantLib::Handle<QuantLib::Quote>&
>> >
>> >
>> > These compilation error start after addition of
>> > QuantLib::Handle<QuantLib::YieldTermStructure> to swapratehelper
>> > constructor.
>> >
>> > I have attached a sample of the code.
>> > Please guide me here,what i'm doing wrong?
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://quantlib.10058.n7.nabble.com/dual-curve-bootstrapping-tp16940.
>> html
>> > Sent from the quantlib-users mailing list archive at Nabble.com.
>> >
>> >
>> ---------------------------------------------------------------------
>> ---------
>> > _______________________________________________
>> > QuantLib-users mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>>
>> ---------------------------------------------------------------------
>> --------- _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
> --
>
> <http://leanpub.com/implementingquantlib/>
> <http://implementingquantlib.com>
> <http://twitter.com/lballabio>
>


--
Thanks & regards
Ashwini kumar pal
09919169021

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


Agile Investment Servicing: Find out more in our latest annual report. <http://www.efa.eu/documents/10136/0/2014+Overview+-+UK>



Follow us:
<http://www.linkedin.com/company/european-fund-administration>  <https://twitter.com/EFA_tweet>



The information in this e-mail message and/ or its attachments is confidential and may be legally privileged, thus any disclosure, copying, distribution or any action taken or omitted to be taken in reliance thereon may be strictly prohibited and unlawful. If you are not the intended recipient, please notify us immediately and destroy this e-mail and its attachments. Considering the various risks involved when sending emails through the Internet, EFA will not be liable in any case for damages and claims due to the risks of this communication channel (e.g. non or late delivery, message corruption, inadvertent disclosure). Any views or opinions presented in this email and/or its attachments are solely those of the author and do not necessarily represent those of the company, consequently, EFA may not be held liable for its content unless confirmed subsequently in writing.



European Fund Administration SA | 2 rue d'Alsace, P.O. Box 1725,  L-1017 Luxembourg | Tel: +352 48 48 80 80 | www.efa.eu <http://www.efa.eu>



Please consider the environment before printing this e-mail
------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: dual curve bootstrapping

Peter Caspers-4
Sorry, I did not even notice these two arguments, my brain seems to
blank defaulted values by now ...

A common workaround are factory classes. You can also use the boost
parameter library

http://www.boost.org/doc/libs/1_59_0/libs/parameter/doc/html/index.html

The introduction to the library may be a good read in this context anyway.

Peter



On 5 October 2015 at 09:06, PORTOLAN Stefano <[hidden email]> wrote:

> Hello,
>
> If I am not mistaken you can leave the default arguments apart in a C++ call if (and only if) they are the last parameters of your call. Being in the middle in your case you do have to provide at least the default values as Luigi showed you.
>
> Cheers.
> Stefano
>
>
>
> -----Original Message-----
> From: ashwini pal [mailto:[hidden email]]
> Sent: lundi 5 octobre 2015 05:22
> To: Luigi Ballabio
> Cc: QuantLib users
> Subject: Re: [Quantlib-users] dual curve bootstrapping
>
> I'm using Handle<Quote> in my actual code,it is during asking that i missed the '<Quote>'.
> I'm sorry for that.
>
> Using Luigi solution, i'm able to compile it. I'm not a c++ champ, but shouldn't constructors work without providing parameters with default values.
>
> Thank you very much for help.
>
>
> On 10/4/15, Luigi Ballabio <[hidden email]> wrote:
>> Also, the constructor takes two other arguments between the index and
>> the discount curve. Using the default values for those, the complete
>> call should be:
>>
>>       boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>>         Handle<Quote>(s12mRate), 1*Years,
>>         calendar, swFixedLegFrequency,
>>         swFixedLegConvention, swFixedLegDayCounter,
>>         swFloatingLegIndex, Handle<Quote>(), 0*Days,
>>         Handle<YieldTermStructure>(OISwapTermStructure)));
>>
>> Luigi
>>
>>
>> On Sun, Oct 4, 2015 at 7:15 PM Peter Caspers <[hidden email]>
>> wrote:
>>
>>> Hi,
>>>
>>> the compiler is not able to match any of the four constructors. You
>>> are obviously trying to call the second one. In your code
>>>
>>> boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>>>         Handle(s12mRate), 1*Years,
>>>         calendar, swFixedLegFrequency,
>>>         swFixedLegConvention, swFixedLegDayCounter,
>>>
>>> swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)));
>>>
>>> you should write Handle<Quote>(s12mRate), and make sure, that
>>> s12mRate is of type boost::shared_ptr<Quote> and OISwapTermStructure
>>> is of type boost::shared_ptr<YieldTermStructure>.
>>>
>>> If you attach the full code we could have a more detailed look.
>>>
>>> Peter
>>>
>>>
>>>
>>>
>>> On 4 October 2015 at 16:44, ashwinids <[hidden email]> wrote:
>>> > I'm trying to learn dual curve bootstrapping by following the paper
>>> >            discouting.cpp
>>> > <http://quantlib.10058.n7.nabble.com/file/n16940/discouting.cpp>
>>> >
>>> https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad
>>> =rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%
>>> 2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVu
>>> aqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E
>>> > <
>>> https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad
>>> =rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A%
>>> 2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZVu
>>> aqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E
>>> >
>>> >
>>> > First I created full ois discounting curve,then supplied it to the
>>> > swapratehelper to bootstrap the forward curve.
>>> >
>>> > code for swapratehelper:
>>> >
>>> >       boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>>> >         Handle(s12mRate), 1*Years,
>>> >         calendar, swFixedLegFrequency,
>>> >         swFixedLegConvention, swFixedLegDayCounter,
>>> >
>>> > swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure))
>>> > );
>>> >
>>> > I'm getting compilation errors
>>> >   no known conversion for argument 1 from
>>> > ‘QuantLib::Handle<QuantLib::Quote>’ to ‘QuantLib::Rate {aka double}
>>> > no known conversion for argument 8 from
>>> > ‘QuantLib::Handle<QuantLib::YieldTermStructure>’ to ‘const
>>> > QuantLib::Handle<QuantLib::Quote>&
>>> >
>>> >
>>> > These compilation error start after addition of
>>> > QuantLib::Handle<QuantLib::YieldTermStructure> to swapratehelper
>>> > constructor.
>>> >
>>> > I have attached a sample of the code.
>>> > Please guide me here,what i'm doing wrong?
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > View this message in context:
>>> http://quantlib.10058.n7.nabble.com/dual-curve-bootstrapping-tp16940.
>>> html
>>> > Sent from the quantlib-users mailing list archive at Nabble.com.
>>> >
>>> >
>>> ---------------------------------------------------------------------
>>> ---------
>>> > _______________________________________________
>>> > QuantLib-users mailing list
>>> > [hidden email]
>>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>>>
>>> ---------------------------------------------------------------------
>>> --------- _______________________________________________
>>> QuantLib-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>> --
>>
>> <http://leanpub.com/implementingquantlib/>
>> <http://implementingquantlib.com>
>> <http://twitter.com/lballabio>
>>
>
>
> --
> Thanks & regards
> Ashwini kumar pal
> 09919169021
>
> ------------------------------------------------------------------------------
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
> Agile Investment Servicing: Find out more in our latest annual report. <http://www.efa.eu/documents/10136/0/2014+Overview+-+UK>
>
>
>
> Follow us:
> <http://www.linkedin.com/company/european-fund-administration>  <https://twitter.com/EFA_tweet>
>
>
>
> The information in this e-mail message and/ or its attachments is confidential and may be legally privileged, thus any disclosure, copying, distribution or any action taken or omitted to be taken in reliance thereon may be strictly prohibited and unlawful. If you are not the intended recipient, please notify us immediately and destroy this e-mail and its attachments. Considering the various risks involved when sending emails through the Internet, EFA will not be liable in any case for damages and claims due to the risks of this communication channel (e.g. non or late delivery, message corruption, inadvertent disclosure). Any views or opinions presented in this email and/or its attachments are solely those of the author and do not necessarily represent those of the company, consequently, EFA may not be held liable for its content unless confirmed subsequently in writing.
>
>
>
> European Fund Administration SA | 2 rue d'Alsace, P.O. Box 1725,  L-1017 Luxembourg | Tel: +352 48 48 80 80 | www.efa.eu <http://www.efa.eu>
>
>
>
> Please consider the environment before printing this e-mail
> ------------------------------------------------------------------------------
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: dual curve bootstrapping

Stefano Portolan
Hi Peter,

I didn't know this. Seems interesting.
 Thanks!

Stefano


-----Original Message-----
From: Peter Caspers [mailto:[hidden email]]
Sent: lundi 5 octobre 2015 10:15
To: PORTOLAN Stefano
Cc: ashwini pal; Luigi Ballabio; QuantLib users
Subject: Re: [Quantlib-users] dual curve bootstrapping

Sorry, I did not even notice these two arguments, my brain seems to blank defaulted values by now ...

A common workaround are factory classes. You can also use the boost parameter library

http://www.boost.org/doc/libs/1_59_0/libs/parameter/doc/html/index.html

The introduction to the library may be a good read in this context anyway.

Peter



On 5 October 2015 at 09:06, PORTOLAN Stefano <[hidden email]> wrote:

> Hello,
>
> If I am not mistaken you can leave the default arguments apart in a C++ call if (and only if) they are the last parameters of your call. Being in the middle in your case you do have to provide at least the default values as Luigi showed you.
>
> Cheers.
> Stefano
>
>
>
> -----Original Message-----
> From: ashwini pal [mailto:[hidden email]]
> Sent: lundi 5 octobre 2015 05:22
> To: Luigi Ballabio
> Cc: QuantLib users
> Subject: Re: [Quantlib-users] dual curve bootstrapping
>
> I'm using Handle<Quote> in my actual code,it is during asking that i missed the '<Quote>'.
> I'm sorry for that.
>
> Using Luigi solution, i'm able to compile it. I'm not a c++ champ, but shouldn't constructors work without providing parameters with default values.
>
> Thank you very much for help.
>
>
> On 10/4/15, Luigi Ballabio <[hidden email]> wrote:
>> Also, the constructor takes two other arguments between the index and
>> the discount curve. Using the default values for those, the complete
>> call should be:
>>
>>       boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>>         Handle<Quote>(s12mRate), 1*Years,
>>         calendar, swFixedLegFrequency,
>>         swFixedLegConvention, swFixedLegDayCounter,
>>         swFloatingLegIndex, Handle<Quote>(), 0*Days,
>>         Handle<YieldTermStructure>(OISwapTermStructure)));
>>
>> Luigi
>>
>>
>> On Sun, Oct 4, 2015 at 7:15 PM Peter Caspers <[hidden email]>
>> wrote:
>>
>>> Hi,
>>>
>>> the compiler is not able to match any of the four constructors. You
>>> are obviously trying to call the second one. In your code
>>>
>>> boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>>>         Handle(s12mRate), 1*Years,
>>>         calendar, swFixedLegFrequency,
>>>         swFixedLegConvention, swFixedLegDayCounter,
>>>
>>> swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)))
>>> ;
>>>
>>> you should write Handle<Quote>(s12mRate), and make sure, that
>>> s12mRate is of type boost::shared_ptr<Quote> and OISwapTermStructure
>>> is of type boost::shared_ptr<YieldTermStructure>.
>>>
>>> If you attach the full code we could have a more detailed look.
>>>
>>> Peter
>>>
>>>
>>>
>>>
>>> On 4 October 2015 at 16:44, ashwinids <[hidden email]> wrote:
>>> > I'm trying to learn dual curve bootstrapping by following the paper
>>> >            discouting.cpp
>>> > <http://quantlib.10058.n7.nabble.com/file/n16940/discouting.cpp>
>>> >
>>> https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ca
>>> d
>>> =rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A
>>> %
>>> 2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZV
>>> u aqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E
>>> > <
>>> https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ca
>>> d
>>> =rja&uact=8&ved=0CBwQFjAAahUKEwj6wLCEjKnIAhVYkY4KHXK0DWQ&url=http%3A
>>> %
>>> 2F%2Fssrn.com%2Fabstract%3D2219548&usg=AFQjCNGZ2tanuDrTuSxa_sYRNoRZV
>>> u aqyw&sig2=KLgOhmFSUYvZ7FcdKqI_2g&bvm=bv.104317490,d.c2E
>>> >
>>> >
>>> > First I created full ois discounting curve,then supplied it to the
>>> > swapratehelper to bootstrap the forward curve.
>>> >
>>> > code for swapratehelper:
>>> >
>>> >       boost::shared_ptr<RateHelper> s12m(new SwapRateHelper(
>>> >         Handle(s12mRate), 1*Years,
>>> >         calendar, swFixedLegFrequency,
>>> >         swFixedLegConvention, swFixedLegDayCounter,
>>> >
>>> > swFloatingLegIndex,Handle<YieldTermStructure>(OISwapTermStructure)
>>> > )
>>> > );
>>> >
>>> > I'm getting compilation errors
>>> >   no known conversion for argument 1 from
>>> > ‘QuantLib::Handle<QuantLib::Quote>’ to ‘QuantLib::Rate {aka
>>> > double} no known conversion for argument 8 from
>>> > ‘QuantLib::Handle<QuantLib::YieldTermStructure>’ to ‘const
>>> > QuantLib::Handle<QuantLib::Quote>&
>>> >
>>> >
>>> > These compilation error start after addition of
>>> > QuantLib::Handle<QuantLib::YieldTermStructure> to swapratehelper
>>> > constructor.
>>> >
>>> > I have attached a sample of the code.
>>> > Please guide me here,what i'm doing wrong?
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > View this message in context:
>>> http://quantlib.10058.n7.nabble.com/dual-curve-bootstrapping-tp16940.
>>> html
>>> > Sent from the quantlib-users mailing list archive at Nabble.com.
>>> >
>>> >
>>> --------------------------------------------------------------------
>>> -
>>> ---------
>>> > _______________________________________________
>>> > QuantLib-users mailing list
>>> > [hidden email]
>>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> --------- _______________________________________________
>>> QuantLib-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>> --
>>
>> <http://leanpub.com/implementingquantlib/>
>> <http://implementingquantlib.com>
>> <http://twitter.com/lballabio>
>>
>
>
> --
> Thanks & regards
> Ashwini kumar pal
> 09919169021
>
> ----------------------------------------------------------------------
> -------- _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
> Agile Investment Servicing: Find out more in our latest annual report.
> <http://www.efa.eu/documents/10136/0/2014+Overview+-+UK>
>
>
>
> Follow us:
> <http://www.linkedin.com/company/european-fund-administration>  
> <https://twitter.com/EFA_tweet>
>
>
>
> The information in this e-mail message and/ or its attachments is confidential and may be legally privileged, thus any disclosure, copying, distribution or any action taken or omitted to be taken in reliance thereon may be strictly prohibited and unlawful. If you are not the intended recipient, please notify us immediately and destroy this e-mail and its attachments. Considering the various risks involved when sending emails through the Internet, EFA will not be liable in any case for damages and claims due to the risks of this communication channel (e.g. non or late delivery, message corruption, inadvertent disclosure). Any views or opinions presented in this email and/or its attachments are solely those of the author and do not necessarily represent those of the company, consequently, EFA may not be held liable for its content unless confirmed subsequently in writing.
>
>
>
> European Fund Administration SA | 2 rue d'Alsace, P.O. Box 1725,  
> L-1017 Luxembourg | Tel: +352 48 48 80 80 | www.efa.eu
> <http://www.efa.eu>
>
>
>
> Please consider the environment before printing this e-mail
> ----------------------------------------------------------------------
> -------- _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users


Agile Investment Servicing: Find out more in our latest annual report. <http://www.efa.eu/documents/10136/0/2014+Overview+-+UK>



Follow us:
<http://www.linkedin.com/company/european-fund-administration>  <https://twitter.com/EFA_tweet>



The information in this e-mail message and/ or its attachments is confidential and may be legally privileged, thus any disclosure, copying, distribution or any action taken or omitted to be taken in reliance thereon may be strictly prohibited and unlawful. If you are not the intended recipient, please notify us immediately and destroy this e-mail and its attachments. Considering the various risks involved when sending emails through the Internet, EFA will not be liable in any case for damages and claims due to the risks of this communication channel (e.g. non or late delivery, message corruption, inadvertent disclosure). Any views or opinions presented in this email and/or its attachments are solely those of the author and do not necessarily represent those of the company, consequently, EFA may not be held liable for its content unless confirmed subsequently in writing.



European Fund Administration SA | 2 rue d'Alsace, P.O. Box 1725,  L-1017 Luxembourg | Tel: +352 48 48 80 80 | www.efa.eu <http://www.efa.eu>



Please consider the environment before printing this e-mail
------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users