Specifying Fixed Income Contracts

Overview

In order to do analytics on fixed income contracts, you need a way to specify the contract in code. Quantlib provides objects for specifying contracts, and the davinci fixed income desktop provides simple pydantic wrappers around the quantlib objects.

Forecasting Cash Flows

Once a fixed income contract has been specified, you can use the contracts script to forecast the cash flows specified by the contract.

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, coupons=0.05,schedule=schedule) flows = ct.cash_flows(bond)