I am trying to construct and price the zero coupon swap. However its giving me the AttributeError: module 'Quantlib' has no attribute 'ZeroCouponSwap'. Please let me know how to price the zero coupon swap using below details.
# construct discount curve and libor curve
maturity = []
discountfactor = []
day_count = ql.Actual360()
calendar = ql.JointCalendar(ql.UnitedStates(), ql.UnitedKingdom())
yield_curve = ql.DiscountCurve(maturity, discountfactor, day_count, calendar)
yield_curve.enableExtrapolation()
curve_handle = ql.YieldTermStructureHandle(yield_curve)
# BRL index
BRL_index = ql.OvernightIndex('cdi', 0, ql.BRLCurrency(), ql.Brazil(), ql.Business252())
notional = 10000000
fixed_rate = 0.025
fixed_leg_daycount = ql.Business252()
float_spread = 0.0
float_leg_daycount = ql.Business252()
payment frequency = ql.Once
# creating schedule for zero coupon swap
fixed_schedule = ql.MakeSchedule(EffectiveDate, terminationDate, ql.Once)
float_schedule = ql.MakeSchedule (EffectiveDate, terminationDate, ql.Once, calendar, ql.ModifiedFollowing, False)
swap = ql.ZeroCouponSwap(ql.Receiver, 1000000, fixed_schedule,
fixed_rate, fixed_leg_daycount, curve_handle)
engine = ql.DiscountingSwapEngine(yield_curve)
swap.setPricingEngine(engine)
ql.ZeroCouponSwap
because it doesn't exist as an object. Have you got the wrong class? Is it an error in QL that it is not a publicly exposed class? $\endgroup$