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

Introduction to Quantitative Finance

Final Project

Required:

Complete the following tasks by providing your code in a single Python file (.py). Summarize your answers and/or discussions question by question in a separate Word or PDF file for submission.

Case Study 1

1.1. Load SP500 stock price data (sp500.csv) and generate the monthly price return, 50-year compounded return, and annualized return (using the natural logarithm method) between 1970-01-01 and 2020-01-01.

Note: Think about which price you should use, Open Price, High Price, Low Price, Close Price, or Adjusted Close Price to give a fair investment return.          [10 points]

Note: The natural logarithm method is commonly employed for annualizing returns, referring to the average annualized rate of return calculated using logarithmic or continuously compounded returns, and the formula is:

Where ln is the natural logarithm function and Compounded Return is the product of (1+periodic returns) over the entire period.

1.2.Generated the moving average of SP500 index with window sizes of 5 months and 30 months, respectively. Plot the stock price and the moving average lines together.        [10 points]

1.3.Explain why moving averages are widely used in stock market analysis to assist investors in making informed investment decisions, and provide an example based on your data. Further discuss alternative strategies that can be employed in stock market analysis.           [10 points]

Case Study 2

2.1.Given monthly data of a market portfolio comprising 30 industries in the US market, we have data for each industry, including the number of stocks (stock_number_shares.csv), the average market capitalization (or market cap) (stock_size.csv), and the returns (stock_returns.csv). The total market cap for each industry can be estimated as the product of average market cap and the number of stocks in the specific industry. Construct a total market capitalization-weighted index of returns for the US market from the 30 industry portfolios by weighting each industry portfolio proportionally to its market capitalization.            [10 points]

2.2.Assume the constructed index in 2.1 has an initial price level of 1000 and an initial trade date in July 1926. Write a Python function or script to generate the index price between July 1926 and December 1998. Calculate the drawdown, plot the index price and drawdown, and calculate the maximum drawdown value during that period.            [15 points]

Note: A drawdown, typically quoted as a percentage, refers to how much an investment or trading account is down from the peak before it recovers back to the peak. For example, if you have $1,000 in your trading account, and then the funds drop to $900 (before moving back above $1,000), then the trading account witnessed a 10% drawdown.

You may use some or all of the below functions:

cumsum() computes the cumulative sum of elements in an array or along a specified axis.

cumprod() calculates the cumulative product of elements along a specified axis in an array.

cummax() computes the cumulative maximum of elements in an array or along a specified axis.

2.3.Suppose an investor has $5000 in cash to invest by the end of each year (i.e., December) from 2000 (as per the available data). The investor is considering the basic Dollar-Cost Averaging Strategy, intending to invest the entire $5000 in an asset at the end of each year. The investor can choose between the S&P 500 or the total market capitalization-weighted index price (as discussed in Question 2.2). Please calculate the total Profit and Loss (PnL) and maximum drawdown for each asset. Additionally, explain your investment decision considering the trade-off between risk and rewards, and specify which one you would choose and why.          [15 points]

Case Study 3

3.1.As an analyst with extensive experience in option trading, you have noticed that your new interns are confused about the characteristics of American and European call/put options and how early exercise impacts option prices. To provide clarification, use Python to create two figures with the given parameters. Take a range of stock prices, S, [50, 55, …, 150] and set the number of time steps, N, to 100 using the Binomial tree method.

Other parameters:

K = 100            # option strike price

T = 1               # time to maturity (in years)

r = 0.05           # risk-free interest rate

sigma = 0.2     # volatility of the underlying stock

• Figure 1:

a. Plot the payoff function for a Call option at different stock prices.

b. Plot the American Call option price at t = 0 for different stock prices.

c. Plot the European Call option price at t = 0 for different stock prices.

• Figure 2: Similar to Figure 1, but for Put options.                      [10 points]

3.2.Explain the relationship among American Call value, European Call value, and the Payoff, as well as the relationship among American Put value, European Put value, and Payoff, assuming no dividends are paid for the stock.                  [10 points]

3.3.Further discuss the relationship mentioned above in the scenario where the underlying stock pays a known dividend yield at a rate of q.              [10 points]