-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFinTech_Task_Pricing.py
More file actions
30 lines (20 loc) · 871 Bytes
/
Copy pathFinTech_Task_Pricing.py
File metadata and controls
30 lines (20 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
'''
Task: Provide Simple Pricing Functions
FINS3648
License: ""
'''
'''Payments = r(PV)/(1-(1+yield)^-T)'''
notional = PV = 4000000000 #in cash currency
cash_yield = r = 0.03 #% per annum
timeToMaturity = n = 1 #in years
def loan_payment(notional, cash_yield, timeToMaturity):
P = cash_yield*(notional)/(1-(1+cash_yield)**(-timeToMaturity))
return P
print(loan_payment(notional, cash_yield, timeToMaturity)*timeToMaturity)
def zero_coupon_bond(notional, cash_yield, timeToMaturity):
return notional / (1 + cash_yield) ** timeToMaturity
print(zero_coupon_bond(1000000, 0.009, 5))
print(zero_coupon_bond(notional, cash_yield, timeToMaturity))
print(loan_payment(notional, cash_yield, timeToMaturity))
print(loan_payment(notional, cash_yield, timeToMaturity)*timeToMaturity)