Principles of Financial Computing Course

Principles of Financial Computing

Time: 9:10 ~ 12:10 Wednesday (Spring Semester)
Location: Room 107 of the CSIE Building


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.


The major topics covered in the course, time permitting, are listed below for your reference.


Notes [ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 ]

  1. 2019.02.20
  2. 2019.02.27
  3. 2019.03.06
  4. 2019.03.13
  5. 2019.03.20 & 1st assignment due
  6. 2019.03.27
  7. 2019.04.03 holiday
  8. 2019.04.10
  9. 2019.04.17
  10. 2019.04.24 & 2nd assignment due
  11. 2019.05.01
  12. 2019.05.08
  13. 2019.05.15
  14. 2019.05.22 & 3rd assignment due
  15. 2019.05.29
  16. 2019.06.05
  17. 2019.06.12
  18. 2019.06.19
  19. 2019.06.214th assignment due

Programming Exercises

Homework should be turned in on time. No late homework will be accepted without legitimate reasons. There will be four to six programming assignments.
Treat each homework as an examination.
  1. Write a program to price the American put with the spot rate curve 0.08 - 0.05 * exp(-0.18 * t) continuously compounded. Output the put price with its delta based on the CRR binomial tree. Inputs: (1) S (spot price), (2) K (strike price), (3) s (volatility), (4) T (years), (5) n (number of periods). Output: (1) put price and (2) delta. For example, assume S = 100, K = 100, s = 0.3, T = 1, and n = 300. Then the put price is 10.3488 and the delta is −0.4147. Please send your source code, executable code, and a brief explanation file if necessary (e.g., how to run it?) using the CEIBA system (CSIE 7134) before 08:00 AM of March 20, 2019. No late submissions will be accepted. Compress your files into a single file and name it StudentID_HW_1 for easy reference. Example: R91922054_HW_1. Even if you need to make an appointment with 盧政良 for demonstration because of the unusual software you use, you still have to submit the files before the deadline.
  2. Write a program to price the European arithmetic average-rate knock-in put on a non-dividend-paying stock; calculate its delta too. Note that the payoff is the same as the Asian call, and the knock-in barrier is triggered by the average price. Inputs: (1) S (spot price), (2) X (strike price), (3) H (barrier price), (4) T (years), (5) r (risk-free interest rate), (6) s (annualized volatility), (7) n (number of periods), (8) k (number of buckets). Output: put price and its delta. For example, assume that S = 100, X = 105, H = 95, T = 1, r = 0.05, s = 0.30, n = 160, and k = 160. Then the put price is 7.746 and its delta −0.5423. Please send your source code, executable code, and a brief explanation file if necessary (e.g., how to run it?) using the CEIBA system (CSIE 7134) before 08:00 AM of April 24, 2019. No late submissions will be accepted. Compress your files into a single file and name it StudentID_HW_2 for easy reference. Example: R91922054_HW_2. Even if you need to make an appointment with 盧政良 for demonstration because of the unusual software you use, you still have to submit the files before the deadline.
  3. Write a least-squares Monte Carlo program to price up-and-in American-style Asian puts. Note that the payoff is the same as the Asian put, and the knock-in barrier is triggered by the average price. Output its price and standard error. Inputs: (1) S (spot price), (2) X (strike price), (3) H (barrier price), (4) T (years), (5) r (risk-free interest rate), (6) s (volatility), (7) n (number of periods), (8) k (number of simulation paths). Output: put price and its standard error. For example, assume S = 100, X = 100, H = 105, T = 1, r = 0.05, s = 0.30, n = 252, and k = 100000. Then the put price is 0.6146 and its standard error is 0.0111. Please send your source code, executable code, and a brief explanation file if necessary (e.g., how to run it?) using the CEIBA system (CSIE 7134) before 08:00 AM of May 22, 2019. No late submissions will be accepted. Compress your files into a single file and name it StudentID_HW_3 for easy reference. Example: R91922054_HW_3. Even if you need to make an appointment with 盧政良 for demonstration because of the unusual software you use, you still have to submit the files before the deadline.
  4. Write a program to price an x-year American-style put option on a zero coupon bond that matures at year y with a par value of 1 dollar. Use binomial trees for the CIR model. Inputs: x (year), y (year), r (%) (initial short rate), b (%), m (%), s (%) and number of partitions during the option's life n, and strike price X (% of par). For example, the option price is about 21.7750 (% of par) when x = 1, y = 10, r = 4 (%), b = 20 (%), m = 4 (%), s = 10 (%), n = 30 and X = 90 (%). As another example, the option price is about 48.8973 (% of par) when x = 1, y = 30, r = 10 (%), b = 10 (%), m = 3 (%), s = 20 (%), n = 10 and X = 90 (%). Please send your source code, executable code, and a brief explanation file if necessary (e.g., how to run it?) using the CEIBA system (CSIE 7134) before 08:00 AM of June 21, 2019. No late submissions will be accepted. Compress your files into a single file and name it StudentID_HW_4 for easy reference. Example: R91922054_HW_4. Even if you need to make an appointment with 盧政良 for demonstration because of the unusual software you use, you still have to submit the files before the deadline.

Enrollments