代做Strategy Analysis 、代写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)
加QQ:99515681 邮箱:99515681@qq.com WX:codinghelp
- 俞敏洪又找到一位“头部主播”
- Instagram采集指定地区 - ins接粉软件/ig打粉软件/ins私信软件/引流神器
- ws/WhatsApp营销引流群发工具,ws精准群发技巧/ws拉群效果/ws协议号使用
- Ig群控神器,Instagram营销群发软件,ins批量私信工具
- 代写RISC-V、代做C++程序设计
- COM6521代做、代写c/c++编程设计
- 在生意的旅程中 与客户分享的喜悦时刻 都是通过WhatsApp拉群工具创造的美好回忆
- 高合丁磊准确分析市场,积极创新引领汽车发展新方向
- 隆恒钢绞线:优质品质,铸就行业传奇
- FIT1047代做、Python/c++程序语言代写
- Instagram自动登录 - ins自动登录/ig采集指定地区/ins群发软件
- 小米汽车计划2月量产,预计7月可月产万辆
- Instagram私信软件 - ins引流神器/ig接粉软件/ins打粉软件/新引流
- Instagram自动登录 - ins群发工具/ig营销助手/ins引流神器/引领潮流
- 中囤律商信用管理有限公司:引领企业信用修复与ISO体系认证的新篇章
- Ins引流工具全新升级,Instagram群发工具助你实现营销突破!
- 商业焦点 WhatsApp拉群营销工具新功能为何引发好奇 揭秘答案的工具来了
- Instagram群发软件 - ins自动登录/ig采集指定地区/ins群发助手/ig采集神器
- Telegram加群炒群营销软件,TG自动群组活跃软件,电报脚本炒群工具
- 专家质疑 WhatsApp拉群营销工具是否真的能在提升业务效果上做到事半功倍
- 电报最佳群发工具推荐,Telegram全能群发助手,TG拉群发策略
- 嘉盛环境在宁德国际新能源电池大会发表演讲,电池安全升级与节能降本引发关注
- 我与WhatsApp拉群工具的故事:从迷茫到坚定,从平凡到不平凡的蜕变之路
- Ins/Instagram群发私信打粉软件推荐,ins好用的营销利器!
- 代做CS 455、C++编程语言代写
- 世贸通美国EB5投资移民:揭秘美国爆红风景公路旁抢手项目
- WhatsApp协议号注册器,智能推广工具,带您走向网络通信的新高度
- instagram多功能自动群发引流营销软件,ins出海营销必备神器
- 代写Operations Analytics、代做Python程序设计
- 数字幻境之夜 科技魔法师的WhatsApp拉群营销工具分享 业务如梦如幻
推荐
- 苹果罕见大降价,华为的压力给到了? 1、苹果官网罕见大降价冲上热搜。原因是苹 科技
- 疫情期间 这个品牌实现了疯狂扩张 记得第一次喝瑞幸,还是2017年底去北京出差的 科技
- 智慧驱动 共创未来| 东芝硬盘创新数据存储技术 为期三天的第五届中国(昆明)南亚社会公共安 科技
- 丰田章男称未来依然需要内燃机 已经启动电动机新项目 尽管电动车在全球范围内持续崛起,但丰田章男 科技
- 如何经营一家好企业,需要具备什么要素特点 我们大多数人刚开始创办一家企业都遇到经营 科技
- B站更新决策机构名单:共有 29 名掌权管理者,包括陈睿、徐逸、李旎、樊欣等人 1 月 15 日消息,据界面新闻,B站上周发布内部 科技
- 升级的脉脉,正在以招聘业务铺开商业化版图 长久以来,求职信息流不对称、单向的信息传递 科技
- 全力打造中国“创业之都”名片,第十届中国创业者大会将在郑州召开 北京创业科创科技中心主办的第十届中国创业 科技
- 老杨第一次再度抓握住一瓶水,他由此产生了新的憧憬 瘫痪十四年后,老杨第一次再度抓握住一瓶水,他 科技
- 创意驱动增长,Adobe护城河够深吗? Adobe通过其Creative Cloud订阅捆绑包具有 科技