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 ]

  1. 2018.02.28
  2. 2018.03.07
  3. 2018.03.14
  4. 2018.03.21
  5. 2018.03.28
  6. 2018.04.04 & 1st assignment due
  7. 2018.04.11
  8. 2018.04.18
  9. 2018.04.25
  10. 2018.05.02 & 2nd assignment due
  11. 2018.05.09
  12. 2018.05.16
  13. 2018.05.23
  14. 2018.05.30 & 3rd assignment due
  15. 2018.06.06
  16. 2018.06.13
  17. 2018.06.20 & 4th 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 and its delta based on the CRR binomial tree. Inputs: (1) S (spot price), (2) X (strike price), (3) r (risk-free interest rate), (4) s (volatility), (5) T (years), (6) n (number of periods). Output: put price and delta. For example, assume S = 100, X = 105, r = 0.03, s = 0.25, T = 1, and n = 300. Then the put price is 11.4336 and the delta is −0.5066. 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 4, 2018. 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 call 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 too. 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 buckets). Output: call price and its delta. For example, assume S = 100, X = 100, H = 110, T = 1, r = 0.05, s = 0.30, and n = 200, and k = 100. Then the call price is 8.3514 and its delta is 0.5726. 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 9, 2018. 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.
  3. Write a least-squares Monte Carlo program to price American-style Asian puts. Note that the payoff is the same as the Asian put (of course, it is based on the running average if early exercised). Output its price and standard error. Inputs: (1) S (spot price), (2) X (strike price), (3) T (years), (4) r (risk-free interest rate), (5) s (volatility), (6) n (number of periods), (8) k (number of simulation paths). Output: put price and its standard error. For example, assume S = 100, X = 100, T = 1, r = 0.05, s = 0.30, n = 100, and k = 100000. Then the put price is 5.5126 and its standard error is 0.0251. 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 30, 2018. 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 European put options based on the GARCH model (Ritchken-Trevor algorithm). Output its price. Inputs: E (days before expiration), r (%) (interest rate), S (stock price at time 0), h0, b0, b1, b2, c, X (strike price), n1 (number of partitions per day), n2 (number of variances per node). For example, the option price is about 2.0163 when E = 30, r (%) = 5, S = 100, h0 = 0.010469, b0 = 0.000006575, b1 = 0.9, b2 = 0.04, c = 0, X = 100, n1 = 3, n2 = 3. 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 20, 2018. 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