Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ECOM055 Risk Management For Banking

Problem Set 5 - SOLUTIONS

Based on Book Chapter 12

L-questions are questions about the lecture and extra materials, H(ull)-questions are question from the book.

H12.13.

Suppose that each of two investments has a 4% chance of a loss of $10 million, a 2% chance of a loss of $1 million, and a 94% chance of a profit of $1 million. They are independent of each other.

(a) What is the VaRfor one of the investments when the confidence level is 95%?

(b) What is the expected shortfall (ES) when the confidence level is 95%?

(c) What is the VaRfor a portfolio consisting of the two investments when the confidence level is 95%?

(d) What is the expected shortfallfor a portfolio consisting of the two investments when the confidence level is 95%?

(e) Show that, in this example, VaR does not satisfy the subadditivity condition whereas expected shortfall does.

H12.16.

The change in the value of a portfolio in three months is normally distributed, with a mean of $500,000 and a standard deviation of $3 million. Calculate the VaR and ESfor a confidence level of 99.5% and a time horizon of three months.

Question 2: Currency momentum trading strategy

Question 2.a Explain when a trader who follows the momentum trading strategy buys (sells) a currency.

Question 2.b Read the introduction of Moskowitz et al. (JFE2012), Time Series Momentum. What could explain positive time series momentum according to the authors?

Question 2.b

Now we are going to implement this trading strategy in Python. Download the GBP/INR British Pounds to Indian Rupees Exchange Rate data from QMplus and load the data in Python (use the code of the previous tutorials). Create a time-series plot of the exchange rate. Did the GBP appreciate or depreciate?

Tip: To create a time series graph, you need to tell Python that the date variable is a date. You could use the following code:

data['Date'] = pd.to_datetime(data['Date'])

data.set_index('Date', inplace=True)

Question 2.c

Next, open Jupyter notebook and import the following packages:

import numpy as np

Calculate the daily log returns using the following command:

returns = np.log(data['Close'] / data['Close'].shift(1)).dropna()

Explain all elements of the function: np, log(), data['Close'], shift(1), dropna()

Question 2.d

In Python you could define a function, such asf(x) = x2 + 1 in the following way:

def function(x):

return x**2 + 1

You could type function(4)and you will see that Python returns the answer (17).  We will now define a 1-day Time Series Momentum Trading Strategy (TSMStrategy) which buys the currency if the returns ofthe previous day are positive. The function TSMStrategy uses the returns as input, and the performance of the strategy as output.

def TSMStrategy(returns, period=1):

position = returns.rolling(period).mean().map(

lambda x: -1 if x <= 0 else 1)

performance = position.shift(1) * returns

return performance

You could calculate the performance of the momentum trading strategy over the entire trading period using the following code:

performance = TSMStrategy(returns, period=1).dropna()

print(performance)

AskChatGPTto explain the TSMStrategy

Question 2.e

Use the following code to calculate the annual returns of the momentum strategy and the annual returns of the buy and hold strategy. Which strategy yields the highest returns? Which strategy

the highest Sharpe ratio? Assume a 2 percent risk free rate.

Code:

years = (performance.index.max() - performance.index.min()).days / 365

perf_cum = np.exp(performance.cumsum())

ann = perf_cum[- 1] ** (1 / years) - 1

vol = performance.std() * np.sqrt(252)

rfr = 0.01

sharpe = (ann - rfr) / vol

print(f"1-day TSM Strategy yields:" +

f"\n\t{ann*100:.2f}% annual returns" +

f"\n\t{sharpe:.2f} Sharpe Ratio")

gme_ret = np.exp(returns.cumsum())

b_ann = gme_ret[- 1] ** (1 / years) - 1

b_vol = returns.std() * np.sqrt(252)

b_sharpe = (b_ann - rfr) / b_vol

print(f"Baseline Buy-and-Hold Strategy yields:" +

f"\n\t{b_ann*100:.2f}% annual returns" +

f"\n\t{b_sharpe:.2f} Sharpe Ratio")