Davinci Quantlib Wrapper - Present Value

Sample

import valuation as vl #specify the bond contract schedule = ct.Schedule(start_date='2000-01-01', end_date='2030-01-01', frequency= ct.Frequency.Annual, calendar= cl.Calendar.USGovernmentBond, convention=ct.Convention.Following, dateroll=ct.DateRoll.Forward) bond = ct.FixedRateBond(settlement_days=2,face_value=10000, day_count=ct.DayCount.Actual360, coupons=0.05,schedule=schedule) flows = ct.cash_flows(bond) #pull the treasury rates and construct a discount curve item,stack = ty.current() treasury_curve1 = cv.TreasuryCurve(data = [[x['period'], x['value']/100] for x in stack]) pv = vl.present_value(cash_flows=flows, discount_curve=treasury_curve1)