Re: ask help on swapratehelper earilst date

Posted by elton wang on
URL: http://quantlib.414.s1.nabble.com/ask-help-on-swapratehelper-earilst-date-tp5432p5436.html

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