ask help on swapratehelper earilst date

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

ask help on swapratehelper earilst date

elton wang
Sorry for asking stupid questions: Could anybody help
me on the use of SwapRateHelper? In the relavant code
below, the evaluation date is 01/17, settlement date
is 01/22, but the swapratehelper s1y gives an earilest
datet 01/21 so the bootstrap fails.

Thanks a lot!

Calendar calendar =UnitedStates();
Date todaysDate(17,Jan,2008);
Integer fixingDays = 2;
Date settlementDate = calendar.advance(todaysDate,
fixingDays, Days);
     
Settings::instance().evaluationDate() = todaysDate;


        Frequency swFixedLegFrequency = Semiannual;
        BusinessDayConvention swFixedLegConvention =
ModifiedFollowing;
        DayCounter swFixedLegDayCounter =
Thirty360(Thirty360::USA);
        boost::shared_ptr<IborIndex>
swFloatingLegIndex(new USDLibor(Period(3,Months)));

        boost::shared_ptr<RateHelper> s1y(new
SwapRateHelper(
            Handle<Quote>(s1yRate), 1*Years,
            calendar, swFixedLegFrequency,
            swFixedLegConvention,
swFixedLegDayCounter,
            swFloatingLegIndex));


      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ask help on swapratehelper earilst date

Li, Peter
Hi, Elton:
Seems no problem to me with QL 0.8
I added two line to output the dates
std::cout << " settlementDate=" << settlementDate << std::endl;

std::cout << " s1y->earliestDate()=" << s1y->earliestDate() <<
std::endl;

The output is:

settlementDate=January 22nd, 2008
s1y->earliestDate()=January 22nd, 2008

Your code
        boost::shared_ptr<RateHelper> s1y(new
SwapRateHelper(
            Handle<Quote>(s1yRate), 1*Years, //need fixingDays,

            calendar, swFixedLegFrequency,
            swFixedLegConvention,
swFixedLegDayCounter,
            swFloatingLegIndex));
misses one argument and should not compile.

Good Luck.
------------------------------------
Peter Li
 
-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of elton
wang
Sent: Thursday, January 17, 2008 9:53 AM
To: [hidden email]
Subject: [Quantlib-users] ask help on swapratehelper earilst date

Sorry for asking stupid questions: Could anybody help
me on the use of SwapRateHelper? In the relavant code
below, the evaluation date is 01/17, settlement date
is 01/22, but the swapratehelper s1y gives an earilest
datet 01/21 so the bootstrap fails.

Thanks a lot!

Calendar calendar =UnitedStates();
Date todaysDate(17,Jan,2008);
Integer fixingDays = 2;
Date settlementDate = calendar.advance(todaysDate,
fixingDays, Days);
     
Settings::instance().evaluationDate() = todaysDate;


        Frequency swFixedLegFrequency = Semiannual;
        BusinessDayConvention swFixedLegConvention =
ModifiedFollowing;
        DayCounter swFixedLegDayCounter =
Thirty360(Thirty360::USA);
        boost::shared_ptr<IborIndex>
swFloatingLegIndex(new USDLibor(Period(3,Months)));

        boost::shared_ptr<RateHelper> s1y(new
SwapRateHelper(
            Handle<Quote>(s1yRate), 1*Years,
            calendar, swFixedLegFrequency,
            swFixedLegConvention,
swFixedLegDayCounter,
            swFloatingLegIndex));


 
________________________________________________________________________
____________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ask help on swapratehelper earilst date

elton wang
Thanks Peter,
I am using ver 0.9. for the constructor below, there
is no need to place fixingDays?


SwapRateHelper (const Handle< Quote > &rate, const
Period &tenor, const Calendar &calendar, Frequency
fixedFrequency, BusinessDayConvention fixedConvention,
const DayCounter &fixedDayCount, const
boost::shared_ptr< IborIndex > &iborIndex, const
Handle< Quote > &spread=Handle< Quote >(), const
Period &fwdStart=0 *Days)

http://quantlib.org/reference/class_quant_lib_1_1_swap_rate_helper.html

--- "Li, Peter" <[hidden email]> wrote:

> Hi, Elton:
> Seems no problem to me with QL 0.8
> I added two line to output the dates
> std::cout << " settlementDate=" << settlementDate <<
> std::endl;
>
> std::cout << " s1y->earliestDate()=" <<
> s1y->earliestDate() <<
> std::endl;
>
> The output is:
>
> settlementDate=January 22nd, 2008
> s1y->earliestDate()=January 22nd, 2008
>
> Your code
>         boost::shared_ptr<RateHelper> s1y(new
> SwapRateHelper(
>             Handle<Quote>(s1yRate), 1*Years, //need
> fixingDays,
>
>             calendar, swFixedLegFrequency,
>             swFixedLegConvention,
> swFixedLegDayCounter,
>             swFloatingLegIndex));
> misses one argument and should not compile.
>
> Good Luck.
> ------------------------------------
> Peter Li
>  
> -----Original Message-----
> From: [hidden email]
>
[mailto:[hidden email]]

> On Behalf Of elton
> wang
> Sent: Thursday, January 17, 2008 9:53 AM
> To: [hidden email]
> Subject: [Quantlib-users] ask help on swapratehelper
> earilst date
>
> Sorry for asking stupid questions: Could anybody
> help
> me on the use of SwapRateHelper? In the relavant
> code
> below, the evaluation date is 01/17, settlement date
> is 01/22, but the swapratehelper s1y gives an
> earilest
> datet 01/21 so the bootstrap fails.
>
> Thanks a lot!
>
> Calendar calendar =UnitedStates();
> Date todaysDate(17,Jan,2008);
> Integer fixingDays = 2;
> Date settlementDate = calendar.advance(todaysDate,
> fixingDays, Days);
>      
> Settings::instance().evaluationDate() = todaysDate;
>
>
>         Frequency swFixedLegFrequency = Semiannual;
>         BusinessDayConvention swFixedLegConvention =
> ModifiedFollowing;
>         DayCounter swFixedLegDayCounter =
> Thirty360(Thirty360::USA);
>         boost::shared_ptr<IborIndex>
> swFloatingLegIndex(new USDLibor(Period(3,Months)));
>
>         boost::shared_ptr<RateHelper> s1y(new
> SwapRateHelper(
>             Handle<Quote>(s1yRate), 1*Years,
>             calendar, swFixedLegFrequency,
>             swFixedLegConvention,
> swFixedLegDayCounter,
>             swFloatingLegIndex));
>
>
>  
>
________________________________________________________________________
> ____________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search.
>
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>
>
------------------------------------------------------------------------
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio
> 2008.
>
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ask help on swapratehelper earilst date

elton wang
In reply to this post by elton wang
cput from the code below. I am using QL ver 0.9. s1y
rate helper gives 01/21/08(ML King day) as the swap
start date. anything I did wrong? Many thanks to Peter
and all of you.

Today: Thursday, January 17th, 2008
Settlement date: Tuesday, January 22nd, 2008
 s1y->earliestDate()=January 21st, 2008


--- elton wang <[hidden email]> wrote:

> Sorry for asking stupid questions: Could anybody
> help
> me on the use of SwapRateHelper? In the relavant
> code
> below, the evaluation date is 01/17, settlement date
> is 01/22, but the swapratehelper s1y gives an
> earilest
> datet 01/21 so the bootstrap fails.
>
> Thanks a lot!
>
> Calendar calendar =UnitedStates();
> Date todaysDate(17,Jan,2008);
> Integer fixingDays = 2;
> Date settlementDate = calendar.advance(todaysDate,
> fixingDays, Days);
>      
> Settings::instance().evaluationDate() = todaysDate;
>
>
>         Frequency swFixedLegFrequency = Semiannual;
>         BusinessDayConvention swFixedLegConvention =
> ModifiedFollowing;
>         DayCounter swFixedLegDayCounter =
> Thirty360(Thirty360::USA);
>         boost::shared_ptr<IborIndex>
> swFloatingLegIndex(new USDLibor(Period(3,Months)));
>
>         boost::shared_ptr<RateHelper> s1y(new
> SwapRateHelper(
>             Handle<Quote>(s1yRate), 1*Years,
>             calendar, swFixedLegFrequency,
>             swFixedLegConvention,
> swFixedLegDayCounter,
>             swFloatingLegIndex));
>
>
>      
>
____________________________________________________________________________________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search.
>
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio
> 2008.
>
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ask help on swapratehelper earilst date

Li, Peter
Hello, Elton:
The answer is:

The swap in SwapRateHelper uses USDLibor-> fixingCalendar(), which is
London stock exchange, to construct the floating and fixed leg but you
used
Calendar calendar =UnitedStates() to get the settlement date.

------------------------------------
Peter
 

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of elton
wang
Sent: Thursday, January 17, 2008 10:54 AM
To: [hidden email]
Subject: Re: [Quantlib-users] ask help on swapratehelper earilst date

cput from the code below. I am using QL ver 0.9. s1y
rate helper gives 01/21/08(ML King day) as the swap
start date. anything I did wrong? Many thanks to Peter
and all of you.

Today: Thursday, January 17th, 2008
Settlement date: Tuesday, January 22nd, 2008
 s1y->earliestDate()=January 21st, 2008


--- elton wang <[hidden email]> wrote:

> Sorry for asking stupid questions: Could anybody
> help
> me on the use of SwapRateHelper? In the relavant
> code
> below, the evaluation date is 01/17, settlement date
> is 01/22, but the swapratehelper s1y gives an
> earilest
> datet 01/21 so the bootstrap fails.
>
> Thanks a lot!
>
> Calendar calendar =UnitedStates();
> Date todaysDate(17,Jan,2008);
> Integer fixingDays = 2;
> Date settlementDate = calendar.advance(todaysDate,
> fixingDays, Days);
>      
> Settings::instance().evaluationDate() = todaysDate;
>
>
>         Frequency swFixedLegFrequency = Semiannual;
>         BusinessDayConvention swFixedLegConvention =
> ModifiedFollowing;
>         DayCounter swFixedLegDayCounter =
> Thirty360(Thirty360::USA);
>         boost::shared_ptr<IborIndex>
> swFloatingLegIndex(new USDLibor(Period(3,Months)));
>
>         boost::shared_ptr<RateHelper> s1y(new
> SwapRateHelper(
>             Handle<Quote>(s1yRate), 1*Years,
>             calendar, swFixedLegFrequency,
>             swFixedLegConvention,
> swFixedLegDayCounter,
>             swFloatingLegIndex));
>
>
>      
>
________________________________________________________________________
____________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search.
>
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>
>
------------------------------------------------------------------------
-
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio
> 2008.
>
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



 
________________________________________________________________________
____________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users