数学|Algorithmic Trading, COMP0051, 2022/23

Algorithmic Trading, COMP0051, 2022/23
Coursework 2. Cohort 2022/23. This assignment is worth 60% of the overall mark.
All reports will be checked for plagiarism and plagiarism cases will be thoroughly investigated,
do not include non-original material (text, images, tables) without clearly stating the source.
Standard and non-standard calculators are permitted
1. Time Series Prep [30 Points]
(a) Download S&P 500 ETF (called SPDR or Spider, ticker SPY Equity1
) at end-of-day
prices for the period of time between 1 Jan 2014 to 31 December 2019. Download
the Effective Fed Funds Rate (EFFR Index) 2
as the risk-free rate. Adjust annual
risk-free rate to make it a daily rate, i.e., rt
f = EF F R(t) · dc, where dc is a day_x005f count. You can use dc ≈ (1/252).
A unit of SPDR will cost pt at time t, which we have to finance at the risk-free rate.
The daily excess return per unit of SPDR reads,
rt
e =
pt
pt
rt
f
.
(b) Plot the SPDR return time series, the EFFR, and the excess return per unit of SPDR,
starting from t = 0 corresponding to 1 Jan 2014.
2. Trading Strategies [45 Points]
Definition. In a leveraged strategy, the (leveraged) book size is the available capital times
the leverage amount. By a leveraged strategy we mean a sequence {θt}
T
t=1 of dollar values
of SPDR which can be long or short such that
|θt
| ≤ Vt
· L
where Vt
is the total value of the holdings, and L is the leverage.
(a) Define three leveraged trading strategies for the SPDR with initial capital V0 =
$200, 000. For all strategies, set the leverage L = 5. Use the first 70% of days as
1https://finance.yahoo.com/quote/SPY/
2https://www.newyorkfed.org/markets/reference-rates/effr
COMP0051 1 TURN OVER
training set and the remaining 30% as test set. The daily trading PnL, which we
define as the excess return of each strategy {θt}
T
t=1, is given by the equation:
Vt =