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);
Free forum by Nabble | Disable Popup Ads | Edit this page |