Question
1)Create a function called assess_portfolio() that takes as input an asset allocation of a cryptocurrency asset portfolio and computes important statistics about the portfolio. You
1)Create a function called assess_portfolio() that takes as input an asset allocation of a cryptocurrency asset portfolio and computes important statistics about the portfolio. You are given the following inputs for analysing a portfolio:
A date range to select the historical data to use (specified by a start and end date). You should consider performance from close of the start date to close of the end date on a daily basis, if you choose intraday data then please use daily median price.
Symbols for each cryptocurrency asset (e.g., BTC, ETH, XRP, LTC).
Portfolio allocations for each asset at the beginning of the simulation (e.g., 0.2,
0.3, 0.4, 0.1) which should sum to 1.0.
Total starting value of the portfolio (e.g. $1,000,000)
Your goal is to create a programme to compute and visualise the daily portfolio value over the given date range within a sample period from: February 15, 2018 to February 15, 2020, and then the following statistics for the overall portfolio:
Cumulative return for the chosen date range from the sample period
Plot the average period return (if sampling frequency == 252 trading days then
this is average daily return for the portfolio)
Calculate the standard deviation of daily returns
Calculate the annualised Sharpe ratio of the daily returns of the portfolio, given daily risk-free rate (usually average of overnight LIBOR rate), and yearly sampling frequency (usually 252 days, the number of trading days in a year)
Plot the moving historical volatility with a minimum rolling period of 30 days (i.e. moving historical standard deviation of the log returns)
Ending value of the portfolio
Are these returns all positive? Or not? What is your explanation for what you observe, and can you
derive some market insight from these results?
[20]
2) Create an event study profile of a specific market event in the Cryptocurrency market, and compare its impact on two relatively liquid cryptocurrencies: BTC and ETH. The event for this question is defined as when the daily median price / daily close price of the cryptocurrency is 10% lower than the previous day for both currencies. Evaluate this event for the time period: February 15, 2018 to February 15, 2020. Create and describe your own trading strategy based on the findings, to include writing the code for your trading strategy and execution of the strategy with relevant visual output in plots for this sample period to see overall portfolio valuations.
[20]
3)Now that you've got your trading strategy at hand, it's a good idea to also backtest it and optimise its performance. However, when you're backtesting, it's a good idea to keep in mind that there are some pitfalls. For example, external events such as market regime shifts, which are regulatory changes or macroeconomic events. Also, liquidity constraints, could affect your backtesting heavily. To backtest, please define your own market event in the report and your code, for example: heightened negative returns for atleast 5 trading days. Use your own 'market event' and experiment with it using re-calibrated trading strategy to consider answering these questions:
Explain why the event chosen is a relevant 'market event' for cryptocurrency assets?
Is it possible to make money using your event?
If it is possible, what is your trading strategy? Think about details of entry (buy), exit
(sell) and how many days would you hold?
Is this a risky strategy?
How much do you expect to make on each trade?
How many times do you expect to be able to act on this opportunity each year?
Is there some way to reduce the risk?
[20]
For questions 1, 2 and 3, you will need to write code in Python 3.6 using Python functions, libraries and classes. Only external python platforms allowed are for Q2 and Q3 to execute / backtest your trading strategy on a virtual market platform (not real time). You will need to respect the good programming practices such as commenting your code so that it is clear (to you and other programmers that might read it) as to what it attempts to execute.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started