Obtain data for the S&P 500 index (Yahoo ticker ^GSPC
) for the period Jan 1, 2015 - Dec 31, 2017. Plot the time series of prices and compute (and report) the mean and standard deviation of daily returns.
library(Quandl)
library(quantmod)
getSymbols("^GSPC", from="2015-01-01", to="2017-12-31")
## [1] "GSPC"
plot(GSPC$GSPC.Adj)
spRets = dailyReturn(Cl(GSPC))
mu = mean(spRets)
sigma = sd(spRets)
The mean and standard deviation of daily returns are \(\mu = 0.000377\) and \(\sigma = 0.007767\).
where \(\varepsilon_t \sim N(0,1)\). Derive the resulting process for \(P_t\).
The returns process says that returns are distributed as \(N(\mu,\sigma)\). This means that, conditional on knowing \(P_{t-1}\), \(\log(P_t)\) is distributed as \(N(\mu+\log(P_{t-1}),\sigma)\) - that is, the mean of log price in each time period is \(\mu\) plus the log price in the period before. Finally, if \(\log(P_t)\) is Normally distributed, \(P_t\) is lognormally distributed, by definition.
Use the price process from part (b) to simulate S&P 500 prices for the 51 trading days between Jan 1, 2018 and Mar 16, 2018. Assume that \(\mu\) and \(\sigma\) are the values you estimated in part (a), and set \(P_0\) equal to the last value of the S&P 500 in December 2017. Plot your simulated prices on a plot with the actual S&P 500 prices for the same period.
The last trading day of 2017 was Dec 29, and the closing value of the S&P500 on that day was \(P_0 = 2673.61\). Using this and the perviously estimated values of \(\mu\) and \(\sigma\), we can simulate a price series and plot with the actual S&P 500 prices.
nDays = 51
P0 = 2673.61
pricesSim = rep(0,length=nDays)
eps = rnorm(nDays)
pricesSim[1] = exp(mu+log(P0)+sigma*eps[1])
for(ix in 2:nDays){
pricesSim[ix] = exp(mu+log(pricesSim[ix-1])+sigma*eps[ix])
}
getSymbols("^GSPC", from="2018-01-01", to="2018-03-16")
## [1] "GSPC"
pricesTrue = Cl(GSPC)
plot(as.matrix(pricesTrue),type="l")
lines(pricesSim,lty=2)
Obtain 3-month U.S. Treasury bill rates for Jan 1, 2018 - Mar 16, 2018, and use these rates and your simulated index prices to compute futures prices for the index. Assume the expiry of the contract is Mar 16, 2018 and that the index has a dividend yield of 1.7% per year. Plot your simulated futures prices with the actualy E-mini S&P 500 futures prices for the same period.
where \(r\) is the risk-free interest rate (we will use the annualized 3-month U.S. T-bill), \(q\) is the annualized dividend yield (which we assume is 0.017), and \(T\) is time to maturity (in years, assuming Mar 16, 2018 expiry).
tbill = Quandl("FRED/DTB3",start_date="2018-01-01",end_date="2018-03-15",type="xts")
es1 = Quandl("CHRIS/CME_ES1",start_date="2018-01-01",end_date="2018-03-15",type="xts")
dates = index(es1)
timeToExpiry = as.double(difftime("2018-03-15",dates,units="days")/365)
futuresSim = pricesSim*exp((tbill/100-0.017)*timeToExpiry)
futuresTrue = es1$Settle
plot(futuresTrue)
lines(futuresSim,lty=2)
Plot histograms of the true and simulated futures prices in part (d). Offer some comparative discussion.
par(mfrow=c(1,2))
hist(futuresTrue,breaks=20)
hist(futuresSim,breaks=20)
The histogram of the true prices is slightly left skewed whereas the histogram of the simulated data is strongly right skewed. Further, for my particular simulation the mean and variance of the data are much larger.
Suppose you would like to sell lean hog futures on the CME Group exchange.
What are the price units and size for a contract? What is the minimum price increment?
According to the CME group website, lean hog futures are quoted cents per pound, with a minimum price increment of 0.00025 USD (0.025 cents), and each contract comprises 40,000 pounds of lean hogs.
What was the settlement price of lean hog futures on Apr 10, 2018 and what was the resulting value of a single contract on that day?
Using Quandl, we obtain the futures price for Apr 10, 2018:
ln1 = Quandl("CHRIS/CME_LN1",start_date="2018-04-10",end_date="2018-04-10")
The settlement price is 53.5 cents per pound, or 0.5350 USD, implying a contract value of 21,400 USD.
Suppose that the lean hogs contract has an initial margin of 1320 USD. If the price of the contract decreases by 1% in the next day, what will be your percentage loss (on the original base of 1320 USD)? If the price increases by 1%, what would be your percentage gain?
If the price falls by 1% over the next day, the futures settlement price on Apr 11, 2018 will be \(21,400 \times 0.99 = 21,186\) USD, resulting in a loss of \(21,400 - 21,186 = 214\) USD, or a percentage loss of \(\frac{214}{1320} \times 100 = 16.2%\). If the price rises by 1% over the next day, the cocoa futures settlement price on Apr 11, 2018 will be \(21,400 \times 1.01 = 21,614\) USD, resulting in a gain of \(21,614 - 21,400 = 214\) USD, or a percentage gain of \(\frac{214}{1320} \times 100 = 16.2%\)
Calculate the leverage ratio and explain the relationship between the leverage ratio and percentage gain.
Leverage ratio is the value of asset over the value of equity. In this case, the leverage ratio is \(\frac{21,400}{1320}=16.2\). A 1% increase (decrease) in the price leads to the same percentage gain (loss) as the leverage ratio.
What settlement price will result in a margin call?
The contract page for lean hog futures on the CME Group website lists the maintain margin as 1200 USD. Since you are short the contract, every 0.00025 USD increase in settlement price reduces margin balance by 10 USD. Thus, the margin balance attains maintenance margin when the settlement price decreases by \(\frac{1320-1200}{10}=12\) price increments. A a result, when the settlement price rises by \(12\times 0.00025 = 0.003\) USD (0.3 cents per pound) to 53.8 cents, there will be a margin call.
Suppose \(APR = 3\%\) and it is monthly compounded. What is EAR?
When \(APR=0.03\) and \(n=12\), \(EAR \approx 0.0304\).
Suppose \(APR = 3\%\) and it is continuously compounded. What is EAR?
When \(APR=0.03\), \(EAR \approx 0.0305\).
Suppose \(APR = 3\%\) and it is semi-annually compounded. What is the equivalent APR with conutinuous compounding?
Denote APR with compounding \(n\) times per annum as \(APR_{n}\) and APR with continuous compounding as \(APR_{\infty}\). Using the above two relationships between APR and EAR, when \(n=2\) and \(APR_{2} = 0.03\),
\[\begin{align} APR_{\infty} = 2 \ln\left(1+\frac{APR_{2}}{2}\right) \approx 0.0298. \end{align}\]Suppose \(APR = 3\%\) and it is continuously compounded, using an actual/actual day count convention. What is the equivalent APR with quarterly compounding, using an actual/360 day count convention?
Therefore,
\[\begin{align} APR_{4} = 4\left( e^{\frac{0.03}{4}\frac{360}{365}} -1 \right) = 0.0297. \end{align}\] Alternatively, you can first calculate APR with quarterly compounding using actual/actual day count and adjust it to actual/360 later. \[\begin{align} APR_{4} = 4\left( e^{\frac{0.03}{4}} -1 \right)*\frac{360}{365} = 0.0297. \end{align}\]Consider an asset currently worth $100. An investor plans to sell it in one year and is concerned that the price may have fallen significantly by then. To hedge this risk, the investor enters into a forward contract to sell the asset in one year. Assume that the risk-free rate is 5 percent.
Calculate the appropriate price at which this investor can contract to sell the asset in one year.
The compounding convention (EAR vs. continuous APR) for the stated risk-free rate in this problem is ambiguous. The solutions will provide both sets of results.
\(\mathbf{\text{EAR}}\): \[\begin{align*} F_0 = S_0(1+r) = \$100 \times 1.05 = \$105. \end{align*}\] \(\mathbf{\text{APR}}\): \[\begin{align*} F_0 = S_0e^r = \$100 e^{0.05} = \$105.13. \end{align*}\]Three months into the contract, the price of the asset is $90. Calculate the gain or loss that has accrued to the forward contract.
The solutions for EAR and APR separately follow.
\(\mathbf{\text{EAR}}\): The value of the forward contract is now \(\$90 - \$105 \times 1.05^{-(1-0.25)} = -\$11.23\). The value has decreased by \(\$0 - (-\$11.23) = \$11.23\) which is a to the investor since he/she is short.
\(\mathbf{\text{APR}}\): The value of the forward contract is now \(\$90 - \$105.13 \times e^{-0.75\times 0.05} = -\$11.26\). The value has decreased by \(\$0 - (-\$11.26) = \$11.26\) which is a to the investor since he/she is short.
Assume that five months into the contract, the price of the asset is $107. Calculate the gain or loss on the forward contract.
The solutions for EAR and APR separately follow.
\(\mathbf{\text{EAR}}\): The value of the contract is now \(\$107 - \$105 \times 1.05^{-(1-\frac{5}{12})} = \$4.95\). Therefore, compared to part (a) the contract has gained $4.95 in value which is a loss to the investor.
\(\mathbf{\text{APR}}\): The value of the contract is now \(\$107 - \$105.13 \times e^{-(1-\frac{5}{12})\times 0.05} = \$4.89\). Therefore, compared to part (a) the contract has gained $4.89 in value which is a loss to the investor.
Suppose that at expiration, the price of the asset is $98. Calculate the value of the forward contract at expiration. Also indicate the overall gain or loss to the investor on the whole transaction.
The solutions for EAR and APR separately follow.
\(\mathbf{\text{EAR}}\): At expiration, the contract is worth \(\$98 - \$105 \times 1.05^{-(1-\frac{12}{12})} = -\$7\). This is a gain to the investor of $7. However, the asset has gone down by \(\$100 - \$98 = \$2\) so the net gain is $5. This is unsurprising since we contracted to sell our $100 asset at a price of $105 so our net gain must be $5 no matter what happens to the underlying asset.
\(\mathbf{\text{APR}}\): At expiration, the contract is worth \(\$98 - \$105.13 \times e^{-(1-\frac{12}{12})\times 0.05} = -\$7.13\). This is a gain to the investor of $7.13. However, the asset has gone down by \(\$100 - \$98 = \$2\) so the net gain is $5.13. This is unsurprising since we contracted to sell our $100 asset at a price of $105.13 so our net gain must be $5.13 no matter what happens to the underlying asset.
Now calculate the value of the forward contract at expiration assuming that at expiration, the price of the asset is $110. Indicate the overall gain or loss to the investor on the whole transaction. Is this amount more or less than the overall gain or loss from the previous part?
The solutions for EAR and APR separately follow.
\(\mathbf{\text{EAR}}\): At expiration, the contract is worth \(\$110 - \$105 \times 1.05^{-(1-\frac{12}{12})} = \$5\). This is a loss of $5 for the investor but the asset has gone up by \(\$110 - \$100 = \$10\) so the net gain is still $5.
\(\mathbf{\text{APR}}\): At expiration, the contract is worth \(\$110 - \$105.13 \times e^{-(1-\frac{12}{12})\times 0.05} = \$4.87\). This is a loss of $4.87 for the investor but the asset has gone up by \(\$110 - \$100 = \$10\) so the net gain is still $5.13.
Assume that a security is currently priced at $200. The risk-free rate is 5 percent.
A dealer offers you a contract in which the forward price of the security with delivery in three months is $205. Explain the transactions you would undertake to take advantage of the situation.
This means that an arbitrage opportunity is available. When taking advantage of an arbitrage, one should always buy the cheap asset and sell the expensive. In this case, the cheap asset is the security itself and the expensive asset is the forward contract on the security. To accomplish the strategy, you could borrow $200 at the risk-free rate, purchase the security, and simultaneously enter into a short forward contract. At maturity you deliver the security, receive $205 and repay your loan, now valued at $202.51. The total profit is $205 - $202.51 = $2.49.
Suppose the dealer were to offer you a contract in which the forward price of the security with delivery in three months is $198. How would you take advantage of the situation?
We can short sell the security, invest the proceeds at the risk-free rate, and enter into a forward contract to buy the security at $198. After selling the security and investing the proceeds, we would have $202.51 after 3 months. We would use $198 of that to repurchase the security and close out the short sale. This leaves us with gains of \(\$202.51 - \$198 = \$4.51\) which again is in excess of the risk-free gains.