通胀
CPI债券
- ql.CPIBond(settlementDays, notional, growthOnly, baseCPI, contractObservationLag, inflationIndex, observationInterpolation, fixedSchedule, fixedRates, fixedDayCounter, fixedPaymentConvention)
calendar = ql.UnitedKingdom()
today = ql.Date(5,3,2008)
evaluationDate = calendar.adjust(today)
issue_date = calendar.advance(evaluationDate,-1, ql.Years)
maturity_date = ql.Date(2,9,2052)
settlementDays = 3
notional = 1000000
growthOnly = False
baseCPI = 206.1
contractObservationLag = ql.Period(3, ql.Months)
inflationIndex = ql.UKRPI(False)
observationInterpolation = ql.CPI.Flat
fixedSchedule = ql.MakeSchedule(issue_date, maturity_date, ql.Period(ql.Semiannual))
fixedRates = [0.1]
fixedDayCounter = ql.Actual365Fixed()
fixedPaymentConvention = ql.ModifiedFollowing
bond = ql.CPIBond(settlementDays,
notional,
growthOnly,
baseCPI,
contractObservationLag,
inflationIndex,
observationInterpolation,
fixedSchedule,
fixedRates,
fixedDayCounter,
fixedPaymentConvention)
CPISwap
- ql.CPISwap(swapType, nominal, subtractInflationNominal, spread, floatDayCount, schedule, floatPaymentConvention, fixingDays, floatIndex, fixedRate, baseCPI, fixedDayCount, schedule, fixedPaymentConvention, contractObservationLag, fixedIndex, observationInterpolation)
swapType = ql.CPISwap.Payer
nominal = 1e6
subtractInflationNominal = True
spread = 0.0
floatDayCount = ql.Actual365Fixed()
floatPaymentConvention = ql.ModifiedFollowing
fixingDays = 0;
floatIndex = ql.GBPLibor(ql.Period('6M'))
fixedRate = 0.1;
baseCPI = 206.1;
fixedDayCount = ql.Actual365Fixed()
fixedPaymentConvention = ql.ModifiedFollowing;
fixedIndex = ql.UKRPI(False);
contractObservationLag = ql.Period('3M')
observationInterpolation = ql.CPI.Linear
startDate = ql.Date(2,10,2007)
endDate = ql.Date(2,10,2052)
schedule = ql.MakeSchedule(startDate, endDate, ql.Period('6m'))
zisV = ql.CPISwap(
swapType, nominal, subtractInflationNominal, spread,
floatDayCount, schedule, floatPaymentConvention, fixingDays, floatIndex,
fixedRate, baseCPI, fixedDayCount, schedule, fixedPaymentConvention,
contractObservationLag, fixedIndex, observationInterpolation)
零息通胀互换
- ql.ZeroCouponInflationSwap(swapType, notional, start, maturity, calendar, BusinessDayConvention, DayCounter, fixedRate, ZeroInflationIndex, observationLag)
swapType = ql.ZeroCouponInflationSwap.Payer
calendar = ql.TARGET()
nominal = 1e6
startDate = ql.Date(11,1,2022)
endDate = ql.Date(11,1,2023)
fixedRate = 0.1;
dc = ql.Actual365Fixed()
inflationIndex = ql.EUHICPXT(True)
contractObservationLag = ql.Period(3, ql.Months)
bdc = ql.ModifiedFollowing
swap = ql.ZeroCouponInflationSwap(swapType, nominal, startDate, endDate, calendar, bdc, dc, fixedRate, inflationIndex, contractObservationLag)
年度通胀互换
- ql.YearOnYearInflationSwap(swapType, nominal, fixedSchedule, fixedRate, fixedDayCounter, yoySchedule, index, lag, spread, yoyDayCounter, paymentCalendar)
swapType = ql.YearOnYearInflationSwap.Payer
nominal = 1e6
startDate = ql.Date(2,10,2007)
endDate = ql.Date(2,10,2052)
fixedSchedule = ql.MakeSchedule(startDate, endDate, ql.Period('6m'))
fixedRate = 0.1;
fixedDayCounter = ql.Actual365Fixed()
yoySchedule = ql.MakeSchedule(startDate, endDate, ql.Period('6m'))
index = ql.YYEUHICP(False)
lag = ql.Period('3m')
spread = 0.0
yoyDayCounter = ql.Actual365Fixed()
paymentCalendar = ql.TARGET()
swap = ql.YearOnYearInflationSwap(swapType, nominal, fixedSchedule, fixedRate, fixedDayCounter, yoySchedule, index, lag, spread, yoyDayCounter, paymentCalendar)