首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代做program、代写c/c++,Python编程
项目预算:
开发周期:
发布时间:
要求地区:
Part A: Q2: Strategy Analysis (25 marks)
You are a research analyst for AlphaMasterFOF a ‘fund of funds’. This is a type of fund that invests in other
hedge funds.
Your fund is considering investing in a strategy that has been trading for several years.
The live performance record of the strategy is in the file ‘Strategy_returns.xlsx’.
The returns of the S&P 500, are in ‘SP 500 returns.xlsx’.
The values of a relevant index, the HFRI Macro CTA index, are in ‘hfri_index.xlsx’.
The mandate for the allocation is as follows:
• Strategy Annual Sharpe Ratio over 0.8
• Low correlation with the S&P 500
• Low Beta and high Alpha compared to the S&P 500
• High correlation with the CTA index
• Strategy Annual return standard deviation volatility between 15% and 25%
• Strategy employing good risk management, evidenced by a stable annual volatility year on year (YoY).
9
Part A: Q2: Strategy Analysis (25 marks)
a) Load the "strategy_returns.xlsx” file in Q2_data folder . Save this as a DataFrame variable called strat_ret (0.5 marks)
b) Calculate the skew and kurtosis on the strategy returns. Print results to screen. Plot a histogram of returns and comment on the strategy returns distribution.
Round results to four decimal places. (1.5 marks)
c) Calculate the daily mean, standard deviation and Sharpe Ratio. Assume daily risk free is zero. Print results to screen. Format outputs to correct units. Round results
to four decimal places. (1.5 marks)
d) Calculate the annual mean, standard deviation and Sharpe Ratio. Assume annual risk free is zero. Assume 252 days per year. Print results to screen. Format
outputs to correct units. Round results to four decimal places. (1.5 marks)
e) Calculate the daily rolling volatility starting from day 252.Then extract this statistic on the 2nd January each year from 2015 to 2021. Then annualise this value.
Assume 252 days per year. Create a DataFrame. The Index as 2nd January each year 2015 to 2021 as Dates, daily rolling volatility on that date, third column annual
volatility. Print DataFrame to screen. (4 marks)
f) Plot a well formatted displayed bar graph of the Annual Volatility from part e. Show the y axis range from 15% to 20%. Add the data point above each bar on the
chart. (2 marks)
g) Complete an if statement to check if the average annual volatility between 2015 and 2021 from part e is between the lower 15% and upper 25% standard
deviation thresholds as specified by mandate. (1 mark)
h) Load the "SP500_returns.xlsx” file in Q2_data folder. Create a new DataFrame called returns_2 and match the returns of the strategy and S&P500 returns using
the dates from the strategy as the index. Set S&P 500 returns that are nan as zero. (1 marks)
i) Run an OLS regression between the strategy returns and S&P500 market benchmark returns. State which is the dependent and independent variable in a
comment. Save all model results to a DataFrame. Extract Beta, Alpha and R-Squared from regression results to variables. Annualise the alpha. N = 252 days.
Calculate the correlation. Round result values to four decimal places and print to screen. Save all regression results to a csv or xlsx file. (3 marks)
j) Load the "hfri_index.xlsx” file in Q2_data folder. Calculate the HFRI simple percentage returns. Calculate the cumulative strategy daily returns and rebase this so
begins with 1. Create a new DataFrame called returns_3 and match the index of the rebased cumulative strategy returns to the HFRI index returns using the
monthly dates from the HFRI. Note: There should be no NaN’s in the matched DataFrame. Hint: If the strategy rebased dates do not match the HFRI monthly dates
exactly in the DataFrame index you will need to get the last monthly value return from the strategy cumulative rebased returns dates. (4 marks)
k) Run an OLS regression between strategy returns and HFRI market benchmark returns. State which is the dependent and independent variable in a comment. Save
model results to a DataFrame. Extract Beta, Alpha and R-Squared from regression results to variables. Annualise the alpha. N = 252 days. Calculate the correlation.
Round result values to four decimal places and print to screen. Note: HFRI price indexes are monthly. Save all regression results to an cs or xlsx file. (3 marks)
l) Discuss the difference in results between part i and k in a comment. Is the strategy meeting the mandate requirements? Maximum 300 words. (2 marks) 10
Part A: Question 3: Wilder’s Smoothing Relative Strength Index
(RSI) and Statistics1 (25 marks)
11
• Do not use libraries for the RSI technical indicator.
• Write the mathematics for the Wilder Smoothing RSI indicator yourself.
• Write the functions and mathematics for portfolio metrics
• Use log returns
a) Load the FB data from the excel file provided in folder Q3_Data. (0.5 mark)
b) Load the SPY (benchmark) data from the excel file provided in folder Q3_Data. (0.5 mark)
c) Extract FB Adjusted Close and create a new DataFrame called close. (0.5 mark)
d) Write a function to calculate Wilder’s smoothing RSI on the FB Adjusted Close (See Screenshot
to right for mathematics). Use N = 14. Save these results to the DataFrame called close. (4
marks)
e) Calculate the signals based off the below condition: (2 marks)
• RSI < 30 = BUY
• RSI > 70 = SELL
*Note: 30 & 70 are the default parameters.
N = 14 (setting default window)
f) Plot the RSI signal and graph adjusted stock close price in separate plots. Save graph. (2 marks)
Part A: Question 3: Wilder’s Smoothing Relative Strength Index (RSI)
and Statistics2 (25 marks)
g) Calculate the log returns for adjusted close for the stock (FB) and the benchmark (SPY). (0.5 mark)
h) Calculate the strategy returns. The basic idea is that the algorithm can only set up a position in the stock given today’s market data (e.g., just before the close). The position then earns tomorrow’s return. (0.5 mark)
i) Calculate cumulative returns for buy and hold the stock, the strategy and the benchmark. Double check your result with various approaches and print the final
cumulative returns to screen. (1 mark)
j) Plot cumulative returns from the log returns for buy and hold the stock, the strategy and the benchmark. (0.5 mark)
k) Calculate descriptive statistics on the stock, the strategy and benchmark returns. Save to a DataFrame. (0.5 mark)
l) Optimise the RSI with the below condition ranges: (3 marks)
• rsi_buy between 0 and 30 with increment 1
• rsi_sell between 70 and 100 with increment 1
• n_window between 2 and 21 with increment 1
• Hint: Due to computational time, test optimal parameters with increment 10 first.
• Time the optimisation in seconds and minutes and print to screen.
• The optimised results should generate a DataFrame showing the RSI Buy, RSI Sell, N Window, market returns, strategy returns and outperformance.
• Note: Outperformance is Strategy Returns – Market Returns
m) Sort the optimised parameter results on outperformance. Save results to an excel file. (0.5 mark)
n) Extract the optimal parameters (0.5 mark)
o) Rerun the optimal parameter strategy. Plot the RSI and signals and cumulative return graphs. Re-calculate the cumulative performances using the optimal
parameters. (2 marks)
12
Part A: Question 3: Wilder’s Smoothing Relative Strength Index (RSI)
and Statistics3 (25 marks)
p) Isolate the optimal strategy returns and calculate the below performance statistics on this strategy and the benchmark: Assume risk free =
0 and 252 days per year. Format to 2 decimal places. Write functions and store all results in a DataFrame and save to excel. Do not use a
library. (4 marks)
i. Sharpe Ratio
ii. Sortino Ratio
iii. Compound Annual Growth Rate (CAGR)
iv. Annual Volatility
v. Calmar Ratio
vi. Maximum Drawdown
vii. Skewness (4dp)
viii. Kurtosis (4dp)
q) Calculate the number of total trades, long trades and short trades for the optimal strategy. Save as a DataFrame. (2 marks)
r) Plot a histogram of the optimal strategy returns vs benchmark returns. (0.5 mark)
13
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!