代写 C++ graph Project 1, 4CMP Spring Term 2018/19

Project 1, 4CMP Spring Term 2018/19
PROJECT 1
4CMP, SPRING TERM, PART 2: PROGRAMMING IN C++
Lecturer: Dr Fabian Spill (f.spill@bham.ac.uk)
Due Date: Saturday 9th March 2019 at 11.59 pm
Weighting: This project counts 30% to your final mark for the spring part of 4CMP.
INSTRUCTIONS FOR THE SUBMISSION:
Submit your code and the pdf by the deadline on Canvas. The program contains a main.cpp. Additional files should be logically named. Also submit one pdf document as described below.
The source files should compile without errors or warnings on Visual Studio 2015 as installed on the clusters in the learning centre, and the executable should run without problems.
Plagiarism: Note that obviously group work or copying solutions from other students or sources constitutes plagiarism and is not allowed. Please, each one of you, implement your own code!
Marking: The most important criteria for marking is the correctness of the code. It needs to compile and run correctly, and do what you were asked to do. However, style, efficiency, readability and formatting are also part of the evaluation criteria. In particular, if the code is so unreadable that one cannot evaluate if it is working correctly, then you risk losing many marks for that.
PROJECT 1:
Write a program for derivative pricing and risk management of portfolios with derivatives. The portfolio should be able to contain different types of shares, European Put and Call Options, Arithmetic Asian Put and Call Options, Barrier Options (Up and out/in or down and out/in put and call) – each of arbitrary quantities, including negative quantities (short selling). You can assume that the underlying do not pay a dividend. All path dependent options should be sampled daily, and you can ignore leap years so assume that each year has 365 days.
Reminder: The payoff of an arithmetic Asian call is
1𝑇 max⁡(𝑇∑𝑆𝑖(𝑡)−𝐾,0)
𝑡=1
A Up and In Barrier Call has the same Payoff as the Call provided that the Barrier was exceeded on any day up to expiry, whereas the corresponding Up and Out Barrier Call would be worthless is the Barrier is exceeded.
You should implement functionality that can price all assets with Monte Carlo methods, and, if possible, with an analytic formula. Implement functionality that can calculate the delta risk of the portfolio. Here, the delta risk should be calculated with respect to every individual underlying.
In main, create a portfolio that contains the following assets: Share 1: Price: 50, volatility 0.2
Share 2: Price: 40, volatility 0.3

3 x Call1: Based on Share 1, strike: 50, Expiry: 1 year
2 x Up and in Barrier Call 1: Based on Share 1, strike: 50, Barrier at 70, Expiry: 1 year 1 x Up and out Barrier Call 1: Based on Share 1, strike: 50, Barrier at 70, Expiry: 1 year 12 x Asian Call 1: Based on Share 1, strike: 50, Expiry: 1 year
5 x Call2: Based on Share 2, strike: 35, Expiry: 2 years
3 x Put1: Based on Share 2, strike: 35, Expiry: 2 years
7 x Put2: Based on Share 2, strike: 35, Expiry: 2 years
3 x Up and in Barrier Put 1: Based on Share 2, strike: 35, Barrier at 55, Expiry: 2 year
1 x Up and out Barrier Put 1: Based on Share 2, strike: 35, Barrier at 55, Expiry: 2 year
3 x Down and in Barrier Put 1: Based on Share 2, strike: 35, Barrier at 30, Expiry: 2 year 1 x Down and out Barrier Put 1: Based on Share 2, strike: 35, Barrier at 30, Expiry: 2 year 12 x Asian Put 1: Based on Share 2, strike: 35, Expiry: 2 year
The interest rate is: 0.01
Note that here (and in earlier problem sheets) all time-dependent quantities are based on years.
Calculate the value and delta risk of your portfolio. Output these quantities on the command line. Then, add so many shares of Share 1 and 2 to the portfolio that it is fully delta hedged. Output the number of shares you add and the final value and delta of the portfolio on the command line.
Document: Additionally, submit a pdf document that contains
a) an analysis of the error of the Monte Carlo methods you performed.
b) Explain the relations of the prices of European, Asian and Barrier options of the same type
with the same parameters. E.g. compare Call1 and Asian Call1 -> which one costs more, and why? What about Knock in Barrier Call 1 and Knock out Barrier Call 1? How do the two individually relate to the price of Call 1, and how do the two together relate to Call 1?
c) Plot the prices of comparable options (e.g. a European and Asian Call and a Knock in and knock out Barrier Call) in dependence on the share price. Vary the Barrier level. Explain how the prices of the different options relate to each other in dependence on the share price. To do this, export prices for different parameters into a graphics program. You can do this by writing the data into a text (or csv file and then import this file into e.g. excel). Export the figures into the pdf.