__author__ = 'Lily Zheng' from numpy import * from scipy.stats import* import matplotlib.pyplot as plt ''' ####################################################################################################### ####################################################################################################### ''' ### clean lines ### clear = "\n"*1 print clear ''' ####################################################################################################### ####################################################################################################### ''' # temp input given parameters ''' given parameters ''' Aim = 0.0 # Accurate interest rate for the bond at tm (given) / Am Pm = 0.0 #Spot bond price(given) Rmc = 0.0580 # interset rate of coupon (given) Rme = 0.0555 # interest rate to delivery (given) Cb = 11.0# coupon bond (given)/Cme dirtyP = 115.380 #Pm + Aim ''' Calculated ''' Aie = 0.0 #Accurate interest rate at delivery(Calculated!) tme = 75.0 #days to delivery (calculated!) tmc = 18.0 # days to next coupon date(calculated!) Fme = 0.0 #Forward clean price (calculated!) ''' Accurate interest rate at delivery ''' Aie = ( Cb*(tme-tmc)/360) print "Accurate interest rate at delivery: ", Aie Fme = (dirtyP - Cb*(1/(1+tmc/360*Rmc)))*(1+tme/360*Rme)-Aie print "Forward clean price: ", Fme