I am trying to calculate a single currency basis swap by using the Quantlib floatfloatswap function.
Please advice if I am doing wrongly.
float3m=floatingSchedule1
float6m=floatingSchedule2
index3m=index1
index6m=index2
spread=0
notional=100e6
basisSwap=ql.FloatFloatSwap(ql.VanillaSwap.Payer,
[notional] * (len(float3m)-1),
[notional] * (len(float6m)-1),
float3m,
index3m,
ql.Actual360(),
float6m,
index6m,
ql.Actual360(), False, False,
[] * (len(float3m)-1),
[] * (len(float3m)-1))
swapEngine = DiscountingSwapEngine(discount_curve)
basisSwap.setPricingEngine(swapEngine)
basisSwap.spread1()
Trying not to be too length, the input arguments are not copied here.
After setting up, I try to use floatfloatswap.spread1() to obtain the fair spread. It returns an error message:
'AttributeError: 'FloatFloatSwap' object has no attribute 'spread1''