MATH40082 Mini Task 1
Version 10747214
A trader has asked you to price the value of the financial contract Π(S, t)
at time t = 0 which has the formula
d1 = tan((S/X) − 1) + r(T − t)e1−(σ2/q)
cos(σ2(T − t))
d2 = tan((S/X) − 1) − q(T − t)e1−(σ2/q)
cos(σ2(T − t))
Π(S,t) = Se1+σ2(T−t)e−r(T−t)N(d1) − X?1 + (X/S)e−q(T−t)N(d2)
where T = 1, X = 25000, r = 0.0248, q = 0.0424, σ = 0.2744. Here N(x) is the standard normal cummulative distribution function.
Tasks
1. Using the formula and the parameters provided write a program to calculate Π and output the results to the screen. You must generate four columns of data:
• the value of S,
• the value of d1,
• the value of d2,
• and the value of Π(S,t = 0).
Output each of the values when the stock price is
S ∈ {18750, 20000, 21250, 22500, 23750, 25000, 26250, 27500, 28750, 30000, 31250}.
You should use a for loop to generate the data.
Instructions
This coursework should not take more than 2 hours or so to complete. You may use any codes that I have provided in Lab Classes or Support Classes as part of your solution (any codes/examples will be uploaded to the forum). Please write your own code and final solution, you may work together but do not transfer codes or solution files (via email/USB etc.).
For the solution you should create a document (accepted formats are
doc/docx/pdf) containing
* A title with your student id number (9******) – do not mention
your name;
* a table of your results - it must be a formatted table (not a screen-
shot or plain text) within the document, numbered, captioned and
labelled correctly as if it were in a technical report (2 marks);
* your full program - it doesn’t need annotations but you could add a small number of comments within the code (3 marks);
* NO text or accompanying comment is required. This exercise is worth 5% of the total mark for the course.