Suppose we have already known the dates and rates of a spot rate curve, and I passed the data to the ZeroCurve class to construct a discount curve for bond pricing. What I wanna find is how to change the referenceDate of the discount curve without changing the original dates and rates data. I have tried like below:
Settings.instance().evaluationDate = Date(11, 12, 2017)
fake_dates = [Date(8, 5, 2017+i) for i in range(5)]
fake_rates = [(1+i)/100 for i in range(5)]
day_counter = ActualActual()
spot_curve = ZeroCurve(fake_dates, fake_rates, day_counter, China(), Linear(), Compounded, Semiannual)
discount_curve = YieldTermStructureHandle(spot_curve)
print(discount_curve.referenceDate())
# Reset the evaluation date
Settings.instance().evaluationDate = Date(12, 12, 2017)
print(discount_curve.referenceDate())
But, this doesn't work! It returns the same result of Date(11, 12, 2017)
I am a newbie to QuantLib-Python, it would be appreciated if anyone could do me a favor. Many thanks!