Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / 1) Building a Trading Strategy

1) Building a Trading Strategy

Computer Science

1) Building a Trading Strategy. In class we showed that market volatility has a neg-ative correlation with market returns. In this exercise we construct a trading strategy that tries to take advantage of this relationship. (a) All data you will need is contained in the file, "monthlyretsvols.csv". This dataset contains monthly S&P 500 returns and two measures of volatility - one that is based on monthly realized returns ("Vo1SP") and the other that is option-implied VIX ("VIXCLS"). (b) Tabulate Summary Statistics and Plot: i. Report means, medians, standard deviations, and the correlation matrix for all 3 series. ii. Graph the three series against each other and put them in the same units. iii. How do the volatility series compare? Are they similar? Should they be similar? Answer this question in words, not code. (c) Building a Strategy: i. Investment managers like to take advantage of this relationship and seek to decrease their positions when the overall level of volatility is higher. Let's build two such position measures: (1) based on VIX and (2) based on the past month's actual returns. Suppose the monthly volatility at time t, based on VIX is called crifix,t and the one based on actual returns is called ani,t. These are both contained in the dataset. 
Build two weighting measures and store them in the monthly data frame: 1 1 /Du =  W2,t = 0-VI X,t Cfm,t The monthly data frame should now contain 5 main columns (returns, VIX, realized vol, and the above weights). ii. Let's create a new monthly data frame in which the first column has the monthly S&P returns - let's call them Rt. Let's add two more columns where a return is given by: 1?1,t = wi,t-i x Rt R2,t = W2,t-1 X -Rt Notice the 1 month difference between the weights and the return - this is critical. 
.10 
iii. One last step before we summarize. Scale R1 and R2 such that each column has the same volatility as R. For example: suppose RI has a volatility of 20% and the original S&P returns have a volatility of 10%, multiply all elements in RI by 1. Do the same for R2. (d) Summarize the 3 sets of returns from the new monthly data frame, by computing the mean, standard deviation, and Sharpe ratio. Do the two returns involving a dynamic trading strategy beat the market alone, in terms of Sharpe? You should find that all 3 have the same standard deviation as you have adjusted them in the last step. 
(e) Using the newly constructed returns, we will also examine if they beat the orig-inal returns (the S&P returns) on a risk-adjusted basis. That is, run the two regressions: 
kit = al + Pi& + sit Ra = a2 + P2Rt + e2t 
What values do you receive for a1 and a2? Are they positive and statistically significant? (f) Based on your answers for parts (d) & (e), does implementing a dynamic volatility-based strategy beat out simply holding onto the S&P? Answer this question in words, not code. 

2. Stock Summary in Seconds. Write a program (an explicit Python function) that takes 3 inputs: a stock ticker, start date, and end date. Using the inputs it provides summary statistics and a plot of cumulative returns over that exact period. 
The printed summary statistics should include the annualized mean, standard devia-tion, Sharpe ratio, alpha, and market beta. 
To be very clear, for a series of daily returns on a ticker, 14, these will be: Annualized Mean = 252 x p (Rt) Annualized Std. Deviation = '‘/252 x a (Re) Annualized Sharpe = 252 x P (Rt)  a (Rt) and the alpha and market beta will be estimates of & and # from the univariate regression: 
Rt — Rft = a + # (Rmt — Rft) + Et Note: that this program should not load data by reading in a saved data file (such as a csv). 
 

To accurately answer question #2: Need to install the following in anaconda:

  1. pip install yfinance
  2. pip install pandas-datareader
  3. see lecture support notes provided

Option 1

Low Cost Option
Download this past answer in few clicks

15.99 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions