# Set evaluation date
todaysDate = Date(13, 09, 2019)
todaysDate = calendar.adjust(todaysDate)  # business day adjustment
Settings.instance().evaluationDate = todaysDate

spotRates = [6.34,  6.65,   6.808,  6.524375,   6.44125,    6.3575, 6.565003,   6.85,   7.5475,  
            7.895,  7.94625,    7.785,  7.79,   7.79]

spotPeriod = [1w ,1m,   3m  ,6m, 9m ,1y ,3y, 5y, 10y ,15y,  20y, 30y,   40y , 50y]

issue_date = 18-Apr-2018
maturity_date = 18-Apr-2028
Settlement days = 2
compounding = compounded
business convention = modified following
end of the day = False
calendar = SouthAfrica
notional = 1000000000
Fixed rate = .07569
fix_payment frequency = Annual
float_payment frequency = Quarterly
day_count = ActualFixed365
currency = ZAR

Please suggest how to achieve the maximum accuracy. The actual reported value of the swap is '17784176.3' and my calculation says '24104875.57'. I dont know from where the difference is coming from. Rest of my other records swaps are having 92% accuracy compared to reported value. Above are the actual values of one of my record and not sample. Please suggest.

  • $\begingroup$ does anyone have suggestions ? $\endgroup$ – Rahul Mar 16 at 12:27

Very likely an issue with the accrued interest (unfortunately I don't see a breakdown of your accrued vs Quantlib).

Bear in mind that swaps are usually valued a bit different than bonds (where the price is clean of accrued) and the convention is to include the accrued in the valuation which you seem to have done, but Quantlib may have calculated a clean price.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.