ICM142 – Programming for Finance - Spring 2019 Jaidev Singh – Sessional Lecturer in Finance, ICMA Centre, Henley Business School, University of Reading email@example.com Deliverables This course is graded based on an individual Programming and Empirical Finance assignment. You should prepare a report using your knowledge from the course. The report should contain up to 2500 words (the word limit does not include references and tables) and it must be submitted electronically. Exceeding the word limit may be penalised; where any words past the limit would not be reviewed. Please submit a single report file. The output from any software you use to perform your calculation should be presented in the report and not submitted as a separate file. Also, include your programming code in an Appendix. The deadline for electronic submission of the assignment on Blackboard is 12pm, Friday 24th May 2019. Extensions to the deadline will only be given in very exceptional circumstances. Any such request for an extension must be agreed by the ICMA Centre’s Senior Tutor and must be accompanied by a completed extenuating circumstances form available from:http://www.reading.ac.uk/internal/exams/student/exa-circumstances.aspx Late submissions will be penalised according to University policy:https://www.reading.ac.uk/web/files/qualitysupport/penaltiesforlatesubmission.pdf. As part of the submission process for the assignment, you are required to upload an electronic version of your work to the Blackboard site. Reports must be submitted in one of the following formats: Word or PDF files. Follow the procedure below to submit your project, which must be submitted as one single file.
1.Go to http://www.bb.reading.ac.uk
2.Enter your login and password and click login.
3.Click on Programming for Finance (2018/19)
4.From the left-hand menu, go to Assignments.
5.Click on View/ Complete under PFF Assignment
6.You will see a box on the screen, as shown below:
First name Your first name will automatically default through Last name (Family name) Your Last name will automatically default through Submission Title Enter your submission title.
Please note that your title must include your full name followed by PFF_Project, e.g. FirstName_LastName_PFF_Project
7.Click the browse button and select the file for your assignment on your computer (Rememberthat this must be one file only).
8.Click the submit button.
The beginning of your assignment work will be shown on screen. Please check at this stage thatyou are submitting the correct file, as you are only allowed to submit one file.
Note: All the formatting of your assignment is temporarily removed by Turn-It-In from theversion shown on screen, and any Greek symbols and diagrams will disappear. Yourassignment appears as a simple text file. Click the yes, submit button.
9.You will see on the screen a submission confirmation. You will also receive an e-mail fromTurn-It-In UK confirming the receipt of your submission. Please keep this safe. This e-mail isalso your proof of submission.
10.Log off. Click log out at the top of the screen.
Please note that only authorised ICMA Centre staff will be able to view the Turn-It-In report.
Answer all parts of the following question. Marks allocated to each part in square brackets.
Data source for Questions 2 through 5 needs to be the same, and has to be mentioned at the beginning of your report
1)Many people find it difficult to understand blockchain because it requires thecoordination of many components for it to function, and it's hard to see the full pictureuntil all the individual components are fully understood. In brief, please explain thefollowing from a technological standpoint: What are the basics of interaction ofcryptography and economics? What is your fundamental understanding of blockchaintechnology? 2)What were the key events for Cryptocurrencies from January 31, 2018 till January 31,2019? Create and present a graphical timeline with the key dates and the key events.What was the reaction in Bitcoin trading (BTC) on these dates? Did the BTC price go upor down? By how much? What was the mean return on key events dates? What was themedian return? What was the standard deviation? Plot the distribution of the dailypercentage change on key events dates. Create a variable that takes the value 0 on dayswithout key events and 1 on days with key events. Calculate the correlation matrix on keyevents dates and non-key events dates between the behaviour of Bitcoin, Ethereum(ETH), Ripple (XRP) and Nasdaq. Perform a regression analysis between the previousvariables and briefly comment on the results.3)Create a function called assess_portfolio() that takes as input an asset allocation of acryptocurrency asset portfolio and computes important statistics about the portfolio. Youare 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 enddate on a daily basis, if you choose intraday data then please use daily medianprice.•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, 2017 to February 15, 2019, 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 thenthis 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, givendaily risk-free rate (usually average of overnight LIBOR rate), and yearlysampling 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?
4)Create an event study profile of a specific market event in the Cryptocurrency market,and compare its impact on two relatively liquid cryptocurrencies. The event is defined aswhen the daily median price / daily close price of the cryptocurrency is 10% lower thanthe previous day. Evaluate this event for the time period: February 15, 2017 to February15, 2019. Create and describe your own trading strategy based on the findings, to includewriting the code for your trading strategy and execution of the strategy with relevantvisual output in plots for this sample period. 
5)Now that you’ve got your trading strategy at hand, it’s a good idea to also backtest it andoptimise its performance. However, when you’re backtesting, it’s a good idea to keep inmind that there are some pitfalls. For example, external events such as market regimeshifts, which are regulatory changes or macroeconomic events. Also, liquidity constraints,could affect your backtesting heavily. Create your own ‘market event’ and experimentwith it using your trading strategy developed in the previous question for acryptocurrency portfolio. 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? 
For questions 2, 3, 4 and 5, you will need to write code in Python 3.6 using Python functions, libraries and classes. 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.
Your work will be assessed in terms of how well you have carried out the various parts of the assignment, in terms of: appropriate understanding of key concepts / principles discussed in class (programming code, functions, classes, commenting); correctness, clarity, completeness and relevance of your interpretations and commentaries.
The marks assigned to each part of the assignment are given in square brackets at the end of each part.