On Wall Street, being right on the fundamentals and
wrong on the timing is the same as just being wrong.
---Jonathan Cohen
Where is the risk management at J.P. Morgan Chase?
--- Bloomberg News, January 16, 2002
10. Of course, I make a lot investing.
I only teach
so I can help young people.
--- Top Ten Lies Finance Professors Tell Their Students
To Students,
You will learn a perhaps different perspective on finance, especially as it pertains to pricing and software engineering. Our emphasis on computation should add a new dimension and toolbox to your existing knowledge and financial sense. (But see Enrollments below.) It is your responsibility to learn to write in high-level programming languages. We cannot impart that skill in the class. If the mathematics proves hard going, you are expected to fill in the gap by self-reading. The technicalities are not beyond a motivated graduate student's reach.
Consider a commercial property loan of amount V with a total duration of n3 years and m compounding payments per year at annual interest rate r1. In the first n1 years, payments only cover interest (the interest-only grace period, with no principal amortization). In the next n3 − n1 years, equal periodic amortizing payments repay the loan.
After a duration of n2 years from loan inception (where n1 < n2 < n3), immediately after making the year-end payment, the borrower has an option to refinance the remaining loan balance B into a new loan at annual interest rate r2 for the remaining n3 − n2 years again with m payments per year. Refinancing incurs a fixed upfront fee F and a prepayment penalty fraction α on the remaining balance B, both paid out-of-pocket in cash by the borrower at year n2.
Write a program to calculate:
The annualized net IRR is defined as m × y, where the periodic IRR y is the unique rate satisfying:
Inputs:
Outputs:
Example:
If V = 10000000, m = 12, n1 = 3, n2 = 5, n3 = 20, r1 = 0.025, r2 = 0.018, F = 50000, and α = 0.01:
Please submit your source (and executable) code and a brief explanation text file (if the code is not written in Python, describe how to compile and run it) via Gradescope in NTU COOL before 08:00 AM (GMT+8) 2026 Oct 8. No late submissions will be accepted. Compress all files into a single zip file named ID_HW_i.zip, where ID is your student ID in uppercase and i is the homework number (e.g., D13922016_HW_1.zip). If the code is not written in Python, you may be asked to demonstrate your code to the TA.
Write a program to price a structured note and calculate its key financial metrics. Consider an investor who deposits a domestic principal amount D into a structured note that pays an enhanced coupon rate c (annualized) at maturity T. Let St denote the FX spot rate at time t, expressed as domestic currency per unit of foreign currency. At maturity T, the investor receives the guaranteed coupon payment D × c × T in the domestic currency. If the terminal FX spot rate ST ≥ X, the investor receives their full principal D back in domestic currency. If ST < X, the principal D is converted into foreign currency at the conversion strike rate X (yielding D / X units of foreign currency, worth (D / X) · ST in domestic terms). Your goal is to compute the fair value of the note at t = 0 (in domestic currency), the delta of the note with respect to the initial FX spot rate S0, the breakeven spot rate at maturity (ST* such that total terminal payout equals initial principal D).
Inputs:
Outputs:
For Example, if D = 1000000, T = 1.0, c = 0.06, S0 = 32.0, X = 31.5, rd = 0.015, rf = 0.005, σ = 0.12, the outputs are 1006065.998257, 13119.408633, 29.716981. Input Format (for Python codes, replace the student ID with uppercase): "python3 D13922016_HW_2.py 1000000 1.0 0.06 32.0 31.5 0.015 0.005 0.12". Output Format: "1006065.998257, 13119.408633, 29.716981". Please submit your source (and executable) code and a brief explanation text file (if the code is not written in Python, describe how to compile and run it) via Gradescope in NTU COOL before 08:00 AM (GMT+8) 2026 Nov 5. No late submissions will be accepted. Compress all files into a single zip file named ID_HW_i.zip, where ID is your student ID in uppercase and i is the homework number (e.g., D13922016_HW_2.zip). If the code is not written in Python, you may be asked to demonstrate your code to the TA.