联系我们: 手动添加方式: 微信>添加朋友>企业微信联系人>13262280223 或者 QQ: 1483266981
Algorithmic Trading, COMP0051, 2023/24
Coursework 2. Cohort 2023/24. 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 SPTL ETF (1
) 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-count. You can use dc ≈ (1/252).
A unit of SPTL will cost pt at time t, which we have to finance at the risk-free rate.
The daily excess return per unit of SPTL reads,
rt
e =
pt
pt
rt
f
.
(b) Plot the SPTL return time series, the EFFR, and the excess return per unit of SPTL,
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 SPTL 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 SPTL with initial capital V0 =
$200, 000. For all strategies, set the leverage L = 10. Use the first 70% of days
as 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 =
pt
pt
rt
f
θt
1https://finance.yahoo.com/quote/SPTL/
2https://www.newyorkfed.org/markets/reference-rates/effr
COMP0051 1 TURN OVER
where θt
is the dollar value of SPTL held at time t (i.e., θt = units(t) × pt).
(b) Plot the position of the strategies θt
together with the upper and lower bounds [ Vt
·
L, Vt
· L]. Calculate the turnover in dollar value traded over time
Turnoverdollars =
T
X
0
| θt
|.
Additionally calculate the turnover in number of units traded over time
Turnoverunits =
T
X
0
θt+1
pt+1
θt
pt
. Plot a moving average of the turnover. Is it higher during certain periods than in
other periods How is it related to the volatility of SPTL
(c) Create a total PnL series for the strategies, where we assume that unused capital
will be put in a money-market and grow at the same risk-free rate, i.e., the value of
your account changes by the trading PnL ( V ) and the change in the growth of the
money-market capital account ( V
cap).
Vt
total
+1 Vt
total = Vt
total
= Vt + Vt
cap
=
pt
pt
rt
f
θt + (Vt
total Mt)rt
f
where Mt =
|θt|
L
is the total margin used and V0 was as above. Plot Vt
, Vt
cap, and
Vt
total and plot their accumulated values (i.e., cumsum() of each). The return of
your strategy may be leveraged several times, and so is dependent on funding costs.
Can you describe what would happen if the funding costs rt
f
increased What if
they went up by 150% (i.e., using 150% × rt
f
)
3. Performance Indicators [25 Points]
(a) Define the excess return of a trading strategy as the daily trading PnL, P nLt =
Vt
. Use this quantity to compute the Sharpe Ratio (SR), Sortino Ratio, Maximum
Drawdown and the Calmar ratio of your strategies. For each of them provide two
independent measurements: one within the training set and one within the test set.
COMP0051 2 CONTINUED
(b) Plot the rolling Sharpe ratio for your strategy both in the train-set and in the test-set.
How does the SR behave when you move from train-set to test-set Why do you
think it has changed Can you describe a method or methods which can be used to
prevent such a change
(c) Plot the Drawdown chart over time for all of the strategies separately
DDt = max
s≤t
[P nLs] P nLt
and plot the historic rolling 90-day volatility of the underlying asset (pt) on each
chart.
(d) Discuss the Drawdown chart. When are the biggest drawdowns Are they related to
the historic volatility Could you see safer strategies involving using more or less
margin based on the underlying market volatility
Written report A single written report in pdf (12 pages maximum) structured into:
Introduction
Methodology
Results
Discussion
Bibliography
will need to be submitted to Moodle before the deadline of 19/03/2024.
Coding and Editing Students are allowed to use any programming language and any editing
software for the report. For transparency, the code will need to be uploaded as well (preferably
as one zip file).
Marking The marking will be based on the following criteria:
Clarity of presentation and explanations;
Justification of the methodology, i.e. the trading strategies;
COMP0051 3 TURN OVER
Validity of results;
Consistency of language and mathematical notation;
Critical interpretation of results.
COMP0051 4 END OF PAPER


发表评论