Homework 6
Due October 20th by 11:59 PM
Submit assignments as last_first_hw6.py
Notation for financial mathematics
- Denote the spot price and logarithmic price as 𝑆𝑡 and 𝑋𝑡 = log(𝑆𝑡 ), respectively
▪ Logarithmic return at time 𝑡 is then defined as 𝑟𝑡 = 𝑋𝑡 − 𝑋𝑡−1
- Denote continuous time as 𝑡 ∈ [0, 𝑇]
- Denote the discretization of 𝑇 into a grid of 𝑛 ∈ [0, 𝑁] steps (indexes) as 𝑡𝑛
𝑇
▪ The step size is then Δ𝑡 =
𝑁
▪ The time of the initial observation occurs at 𝑛 = 0, i.e. 𝑡 = 𝑡0.
▪ In our setting, 𝑇 = 23400, 𝑁 = 4680, and Δ𝑡 = 5
Homework Instructions:
Start with a fresh Python script:
1. Download daily stock prices for Adobe (ADBE), Netflix (NFLX) and Tesla (TSLA)
from WRDS for the date range Jan 1, 2018 – Dec 31, 2018 as a CSV.
2. Read the price series, 𝑆𝑡 , for the stocks into Python.
3. Approximate the following in discrete time Δ𝑡 = 1 day for each stock, as well as for all
three stocks combined:
a. 𝑄𝑢𝑎𝑑𝑟𝑎𝑡𝑖𝑐𝑉𝑎𝑟𝑖𝑎𝑡𝑖𝑜𝑛 = ∑𝑛𝑖=1 𝑟𝑖,𝑛
2
b. Probability of up movements / down movements
c. Average daily return
d. Plot a histogram of the daily returns
e.
Grading Process
I will award points according the rubric in the syllabus. To determine whether the script
is correct and efficient, the program will be run on a separate stock-day file. The script, if
done correctly, will report accurate results for a random stock day file.
If you are unable to complete all the tasks above, at a minimum make sure your script can
run and produce some output. A script that doesn’t run receives the least amount of points.