Swap Fixed Leg

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

Swap Fixed Leg

simone pilozzi
Hi all,
I am trying to get the bpv of a swap fixed leg. I am using this syntax:

fixedleg = vanillaswap.fixedLeg();

dv01 =CashFlows::basisPointValue(fixedleg,yield,fixed_dc, Continuous,
                fixed_frequency,true,settlement_date);
In doing like this, the final notional repayment will not be included in the bpv isn' it ? If this is the case how can I include this ?

Thanks

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Swap Fixed Leg

Luigi Ballabio
Simone,
    take a copy of the vector and add the final payment:

vector<shared_ptr<CashFlow> > fixedleg = vanillaswap.fixedLeg();
shared_ptr<CashFlow> final_payment(new SimpleCashFlow(notional, maturity));
fixedLeg.push_back(final_payment);
dv01 = ...

Luigi

On Wed, Apr 18, 2012 at 5:25 PM, simone pilozzi <[hidden email]> wrote:

> Hi all,
> I am trying to get the bpv of a swap fixed leg. I am using this syntax:
>
> fixedleg = vanillaswap.fixedLeg();
>
> dv01 =CashFlows::basisPointValue(fixedleg,yield,fixed_dc, Continuous,
>                 fixed_frequency,true,settlement_date);
> In doing like this, the final notional repayment will not be included in the
> bpv isn' it ? If this is the case how can I include this ?
>
> Thanks
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Swap Fixed Leg

simone pilozzi
Thanks a lot Luigi !

On 18 April 2012 17:39, Luigi Ballabio <[hidden email]> wrote:
Simone,
   take a copy of the vector and add the final payment:

vector<shared_ptr<CashFlow> > fixedleg = vanillaswap.fixedLeg();
shared_ptr<CashFlow> final_payment(new SimpleCashFlow(notional, maturity));
fixedLeg.push_back(final_payment);
dv01 = ...

Luigi

On Wed, Apr 18, 2012 at 5:25 PM, simone pilozzi <[hidden email]> wrote:
> Hi all,
> I am trying to get the bpv of a swap fixed leg. I am using this syntax:
>
> fixedleg = vanillaswap.fixedLeg();
>
> dv01 =CashFlows::basisPointValue(fixedleg,yield,fixed_dc, Continuous,
>                 fixed_frequency,true,settlement_date);
> In doing like this, the final notional repayment will not be included in the
> bpv isn' it ? If this is the case how can I include this ?
>
> Thanks
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>


------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Swap Fixed Leg

Ferdinando M. Ametrano-3
In reply to this post by simone pilozzi
simone pilozzi <[hidden email]> wrote:
> I am trying to get the bpv of a swap fixed leg. I am using this syntax:
>
> fixedleg = vanillaswap.fixedLeg();
>
> dv01 =CashFlows::basisPointValue(fixedleg,yield,fixed_dc, Continuous,
>                 fixed_frequency,true,settlement_date);
> In doing like this, the final notional repayment will not be included in the
> bpv isn' it ? If this is the case how can I include this ?

it's much more effective to just obtain the result using

vanillaswap.fixedLegBPS()

everything relevant will be included...

ciao -- Nando

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Swap Fixed Leg

Luigi Ballabio
On Thu, Apr 19, 2012 at 6:06 PM, Ferdinando Ametrano <[hidden email]> wrote:

> simone pilozzi <[hidden email]> wrote:
>> I am trying to get the bpv of a swap fixed leg. I am using this syntax:
>>
>> fixedleg = vanillaswap.fixedLeg();
>>
>> dv01 =CashFlows::basisPointValue(fixedleg,yield,fixed_dc, Continuous,
>>                 fixed_frequency,true,settlement_date);
>> In doing like this, the final notional repayment will not be included in the
>> bpv isn' it ? If this is the case how can I include this ?
>
> it's much more effective to just obtain the result using
>
> vanillaswap.fixedLegBPS()
>
> everything relevant will be included...

He wanted to include the final notional payment, though.  I don't
think it's included in the above.  I'll leave it to you to discuss
whether he should :)

Luigi

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Swap Fixed Leg

Ferdinando M. Ametrano-3
On Thu, Apr 19, 2012 at 6:14 PM, Luigi Ballabio
<[hidden email]> wrote:
> On Thu, Apr 19, 2012 at 6:06 PM, Ferdinando Ametrano <[hidden email]> wrote:
>> everything relevant will be included...
>
> He wanted to include the final notional payment, though.  I don't
> think it's included in the above.  I'll leave it to you to discuss
> whether he should :)

isn't my hint enough ?

;-)

ciao -- Nando

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Swap Fixed Leg

simone pilozzi
Hi again,
I did not check the last hint of Ferdinando....
With the first suggestion it works and results match Bloomberg.
Thanks again!

On 19 April 2012 18:19, Ferdinando Ametrano <[hidden email]> wrote:
On Thu, Apr 19, 2012 at 6:14 PM, Luigi Ballabio
<[hidden email]> wrote:
> On Thu, Apr 19, 2012 at 6:06 PM, Ferdinando Ametrano <[hidden email]> wrote:
>> everything relevant will be included...
>
> He wanted to include the final notional payment, though.  I don't
> think it's included in the above.  I'll leave it to you to discuss
> whether he should :)

isn't my hint enough ?

;-)

ciao -- Nando


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users