Yield to Maturity Function
import contracts as ct
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,
coupon=0.05,schedule=schedule)
ytm = vl.yield_to_maturity(contract=bond, curve=curve)
see
yield to maturity script