Duration: ~1 hour | Instructor: Dr. Raymond Lee
This self-contained session covers the core foundations of computational finance: securities, interest calculations, stocks, options basics, and a short Python lab. No PPT needed.
Securities are negotiable financial instruments representing value. Three main categories:
Most securities trade on organised exchanges (NYSE, Nasdaq, HKSE, LSE, SSE, Euronext, etc.).
Bonds are long-term loan contracts. The issuer (borrower) receives principal and pays interest (coupons) until maturity. The holder (lender) receives the principal back plus interest.
For principal P0, annual rate r, n years:
With m compounding periods per year:
Taking the limit as m → infinity:
Example: P0 = 100, r = 0.1, τ = 1 year → P1 ≈ 110.52
Relationship between discrete rate R and continuous rate r:
Market capitalisation = shares outstanding × price per share.
Risk-adjusted profit of one share (continuous compounding, no dividends/costs):
Including dividends D_τ and transaction costs C:
Profit = S_T + D_τ − C − S0 × e^(r × τ)
An option gives the right (but not the obligation) to buy (Call) or sell (Put) an asset at a fixed strike price K by (or on) the expiration date.
Option premium is quoted per share; one contract usually covers 100 shares. Call payoff at expiration: max(S_T − K, 0). Profit = payoff − premium paid.
pip install yfinance pandas numpy matplotlib
import numpy as np
import yfinance as yf
# Continuous compounding
P0, r, tau = 100, 0.1, 1
print("Continuous value:", P0 * np.exp(r * tau))
# Fetch stock data (example: Apple)
data = yf.download("AAPL", start="2024-01-01", end="2024-12-31", progress=False)
print(data["Close"].tail())
print("Mean close:", data["Close"].mean())
discrete_compound(P0, r, m, n) that returns P_n = P0 × (1 + r/m)^(n × m). Test it with P0=1000, r=0.06, m=4, n=5.Submit your Python code (as a .py or Jupyter notebook) + written answers.
QF Workshop #1 – Computational Finance | Dr. Raymond Lee