|
From: Ferdinando A. <na...@am...> - 2008-03-07 11:15:16
|
Hi Chris,
not sure I get your point.
Couldn't you obtain the same result just using the standard constructor:
MakeCapFloor(CapFloor::Type capFloorType,
const Period& capFloorTenor,
const boost::shared_ptr<IborIndex>& iborIndex,
Rate strike = Null<Rate>(),
const Period& forwardStart = 0*Days);
E.g. let's assume you want the last caplet in a 3Y cap on 6M ibor rate:
MakeCapFloor(Cap, 6*Months, my6mIborIndex, myStrike, 30*Months);
If this is not equivalent because of market conventions used in the 30M fwd
start swap calculation, then I still have another point.
To obtain the sequence of distinct caplets contained in a standard cap, we
could have something like CapFloor::optionlet(Size i) instead: this would
allow to create just one single cap and to extract all caplets from it,
avoiding multiple redundant cap creations
I look forward to your feedback
ciao -- Nando
On Fri, Mar 7, 2008 at 11:35 AM, Chris Kenyon <chr...@ya...>
wrote:
>
> Hi,
>
> this would make life easier. Effect: only the last cashflow is returned.
> The extra code could be something like:
>
> In .hpp after line 66
>
> //! Only get last coupon, i.e. get caplet version of cap
> //! or floorlet version of floor, etc.
> MakeCapFloor& asOptionlet();
>
> Also before closing };
>
> bool asOptionlet_;
>
> In .cpp after line 38 in constructor (and before {}):
>
> asOptionlet_(false)
>
> after new line 53
>
> //! only leaves the last coupon
> if (asOptionlet_ && leg.size()>1)
> leg.erase(leg.begin(), --leg.end());
>
> Best regards,
> Chris
>
>
> -------------------------------------------------------------------------
> 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-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>
>
|