Question: You are a technology analyst automating the reporting process in an asset management company. You are tasked to build a reporting engine that will automate



You are a technology analyst automating the reporting process in an asset management company. You are tasked to build a reporting engine that will automate the entire process of month-end reporting. The setup of your reporting engine will be the daily closing prices of the stock universe for a selected period. import numpy as np import matplotlib.pyplot as plt start_dt - np.datetime 64('2018-01-01') end_dt = np.datetime64(2021-81-31') stock_universe - ['WMT', 'G', 'XOM', AAPL', IBM, 'X', 'CAT', 'MSFT', 'ERK.B', 'PM'] Figure 1: The setup of the reporting engine where the stock universe (stock_universe) is provided and the start date (start_dt) and end date (end_dt) of the selected period are defined. Question 3 Your reporting engine is used to calculate the monthly retum of selected stocks for a selected period. The monthly return of a stock at month i, nis defined as S; ri= Si-1 where Si and Si-a are the month-end stock prices at month i and i 1 respectively. The month- end stock price at month i is defined as the stock price on the last business date of month i. To use your reporting engine, the user needs to specify the following inputs: 1 selected stocks = ['a', 'PM'] reporting_start_ct = np.datetime64('2820-81-81) reporting_end_dt - np.datetime64(2028-02-29) Figure 3: User's inputs to reporting engine. The user must specify the selected stocks and the reporting period. Create a user defined function to obtain the last business date for every month specified by the date range reporting_start_dt and reporting_end_dt. Hence, apply your function and print clearly, the last business date for the first two (2) months of 2020. (15 marks) Create a user defined function that evaluate the monthly return of selected_ stocks in the reporting period. Hence, apply your function and print clearly, corrected to two (2) decimal points, the retums of GS and JPM in the first two (2) months of 2020. (20 marks) (6) For the given user's input: selected_stocks = ['XON', 'X', 'AAPL'] reporting_start_dt = np.datetime 64(2018-06-01') reporting_end_dt = np.datetime64("2018-12-31') Figure A1: User's input to the reporting engine The following report is generated for the user. Stock list : ["X", 'X', 'AAPL"] Raporting Period: 2813-80-81 to 2013-12-31 date 2018-06-29 2018-07-31 2018-08-31 2018-09-28 2018-12-31 2018-11-30 2018-12-31 XOM X AAPL 1.89 -0.51 -2.18 0.88 0.84 8.97 -0.18 0.14 -0.55 0.73 -0.12 -0.61 -2.48 2.07 2.23 1.ee -0.91 -2.52 -a.es Figure A2: Report generated for the first six months of 2018 for XOM, X and AAPL. The values of returns are reported to an accuracy of two (2) decimal points. Monthly retum MOM X AAPL 20 15 10 05 LLL -0.5 2018-05 2018-07 2018-08 2016-10 2018-11 2018-09 dete 2018-12 Figure A3: The monthly return information is represented using bar charts. You are a technology analyst automating the reporting process in an asset management company. You are tasked to build a reporting engine that will automate the entire process of month-end reporting. The setup of your reporting engine will be the daily closing prices of the stock universe for a selected period. import numpy as np import matplotlib.pyplot as plt start_dt - np.datetime 64('2018-01-01') end_dt = np.datetime64(2021-81-31') stock_universe - ['WMT', 'G', 'XOM', AAPL', IBM, 'X', 'CAT', 'MSFT', 'ERK.B', 'PM'] Figure 1: The setup of the reporting engine where the stock universe (stock_universe) is provided and the start date (start_dt) and end date (end_dt) of the selected period are defined. Question 3 Your reporting engine is used to calculate the monthly retum of selected stocks for a selected period. The monthly return of a stock at month i, nis defined as S; ri= Si-1 where Si and Si-a are the month-end stock prices at month i and i 1 respectively. The month- end stock price at month i is defined as the stock price on the last business date of month i. To use your reporting engine, the user needs to specify the following inputs: 1 selected stocks = ['a', 'PM'] reporting_start_ct = np.datetime64('2820-81-81) reporting_end_dt - np.datetime64(2028-02-29) Figure 3: User's inputs to reporting engine. The user must specify the selected stocks and the reporting period. Create a user defined function to obtain the last business date for every month specified by the date range reporting_start_dt and reporting_end_dt. Hence, apply your function and print clearly, the last business date for the first two (2) months of 2020. (15 marks) Create a user defined function that evaluate the monthly return of selected_ stocks in the reporting period. Hence, apply your function and print clearly, corrected to two (2) decimal points, the retums of GS and JPM in the first two (2) months of 2020. (20 marks) (6) For the given user's input: selected_stocks = ['XON', 'X', 'AAPL'] reporting_start_dt = np.datetime 64(2018-06-01') reporting_end_dt = np.datetime64("2018-12-31') Figure A1: User's input to the reporting engine The following report is generated for the user. Stock list : ["X", 'X', 'AAPL"] Raporting Period: 2813-80-81 to 2013-12-31 date 2018-06-29 2018-07-31 2018-08-31 2018-09-28 2018-12-31 2018-11-30 2018-12-31 XOM X AAPL 1.89 -0.51 -2.18 0.88 0.84 8.97 -0.18 0.14 -0.55 0.73 -0.12 -0.61 -2.48 2.07 2.23 1.ee -0.91 -2.52 -a.es Figure A2: Report generated for the first six months of 2018 for XOM, X and AAPL. The values of returns are reported to an accuracy of two (2) decimal points. Monthly retum MOM X AAPL 20 15 10 05 LLL -0.5 2018-05 2018-07 2018-08 2016-10 2018-11 2018-09 dete 2018-12 Figure A3: The monthly return information is represented using bar charts
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
