getting the set of reset dates of a float leg

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

getting the set of reset dates of a float leg

mudcrab
Hi, there.  There was a posting with this same title back in Feb 2003,
as you can see from

http://www.nabble.com/getting-the-set-of-reset-dates-of-a-float-leg-td13771105.html#a13771105

and

http://www.nabble.com/RE%3A-getting-the-set-of-reset-dates-of-a-f-loat-leg-td13771106.html#a13771109 .

I tried everything listed therein, but nothing seemed to work.  In particular,
I could not convert the Leg to a Handle<Coupon> or boost:shared_ptr<Coupon>.

Could you please help me output the reset dates starting from

Leg fixedCF = MySwap.fixedLeg();


Thank you very much!





Reply | Threaded
Open this post in threaded view
|

Re: getting the set of reset dates of a float leg

Kim Kuen Tang
mudcrab schrieb:

> I tried everything listed therein, but nothing seemed to work.  In
> particular,
> I could not convert the Leg to a Handle<Coupon> or boost:shared_ptr<Coupon>.
>
> Could you please help me output the reset dates starting from
>
> Leg fixedCF = MySwap.fixedLeg();
>
>
>  
Not sure what you are trying to do. But if you want to cast from
Cashflow to Coupon, here is the code

const Leg& fixedCF=MySwap.fixedLeg();
std::vector<boost::shared_ptr<Coupon> > coupons(fixedCF.size());
        for (Size i=0; i<leg.size(); ++i) {
            coupons[i] =
boost::dynamic_pointer_cast<Coupon>(fixedCF[i]); // dont forget to
include shared_ptr.hpp
        }

Best regards,
Kim Tang


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users