Compounded schedule in IR/Compounded Swap

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

Compounded schedule in IR/Compounded Swap

Anne Noir

I am trying to model a compounded swap in quantlib. Theoretically, the index in the example below is monthly and the payment frequency is 6 monthly so there should be 6 fixings within one period. Why dont i see those fixings when printing the schedule? Or is the modelling of a compounding swap not possible in this way?

Thanks,

Anne

 

leg = 'Floating'

startdate = Date(20,January,2016)

fixingDays = 2

nominal = 5000000

forecastTermStructure = RelinkableYieldTermStructureHandle()

index = USDLibor(Period(1,Months),forecastTermStructure);

floatingLegDayCounter = index.dayCounter()

calendar = TARGET()

 

if leg == 'Floating':

    floatingSchedule = Schedule(startdate, Date(20,January,2021), Period(6,Months) , calendar, ModifiedFollowing, ModifiedFollowing, DateGeneration.Forward, False)

 

if leg=='Floating':

    fltSched = ""

    nominals1 =[nominal for x in floatingSchedule]

    nom = nominals1[:1

    

    floatingrates = IborLeg(nom,floatingSchedule,index,floatingLegDayCounter)·

    for c in floatingrates:

        if leg == 'Floating':

            qdat = c.date()

            coupon11 = as_floating_rate_coupon(c)·

            print "Fixing date: " + str(coupon11.fixingDate())

            tmp = str(startdate.dayOfMonth())+'.'+ str(startdate.month())+'.'+ str(startdate.year())+'-'+str(qdat.dayOfMonth())+'.'+ str(qdat.month())+'.'+ str(qdat.year())+':  TBD'+''

            print tmp

            startdate = calendar.advance(c.date(),0,Days);

 


------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Compounded schedule in IR/Compounded Swap

Luigi Ballabio
Hi Anne,
    as you saw, this way you'll get just one fixing per coupon.  For what you want to do, you'll need to use the classes in <ql/experimental/coupons/subperiodcoupons.hpp>; that is, SubPeriodsCoupon with CompoundingRatePricer.
Unfortunately, you'll also have to create the leg by yourself, as no function like IborLeg exist for that kind of coupon. Also, the coupons don't have a way to output the inner fixing dates (even though they use them).

Hope this helps,
    Luigi



On Wed, Jan 6, 2016 at 11:52 AM Anne Noir <[hidden email]> wrote:

I am trying to model a compounded swap in quantlib. Theoretically, the index in the example below is monthly and the payment frequency is 6 monthly so there should be 6 fixings within one period. Why dont i see those fixings when printing the schedule? Or is the modelling of a compounding swap not possible in this way?

Thanks,

Anne

 

leg = 'Floating'

startdate = Date(20,January,2016)

fixingDays = 2

nominal = 5000000

forecastTermStructure = RelinkableYieldTermStructureHandle()

index = USDLibor(Period(1,Months),forecastTermStructure);

floatingLegDayCounter = index.dayCounter()

calendar = TARGET()

 

if leg == 'Floating':

    floatingSchedule = Schedule(startdate, Date(20,January,2021), Period(6,Months) , calendar, ModifiedFollowing, ModifiedFollowing, DateGeneration.Forward, False)

 

if leg=='Floating':

    fltSched = ""

    nominals1 =[nominal for x in floatingSchedule]

    nom = nominals1[:1

    

    floatingrates = IborLeg(nom,floatingSchedule,index,floatingLegDayCounter)·

    for c in floatingrates:

        if leg == 'Floating':

            qdat = c.date()

            coupon11 = as_floating_rate_coupon(c)·

            print "Fixing date: " + str(coupon11.fixingDate())

            tmp = str(startdate.dayOfMonth())+'.'+ str(startdate.month())+'.'+ str(startdate.year())+'-'+str(qdat.dayOfMonth())+'.'+ str(qdat.month())+'.'+ str(qdat.year())+':  TBD'+''

            print tmp

            startdate = calendar.advance(c.date(),0,Days);

 

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users