Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MTH116

2nd SEMESTER 2022/23 ASSIGNMENT 1

BACHELOR DEGREE  Year 2

Foundations of Financial Computing

Project 1

 

This project provides 15-day closing prices of stock A and B below.

 

Price_A = [234 239 229 220 222 224 218 225 238 246 249 257 251 243 235];

Price_B = [221 218 210 209 207 205 204 202 205 209 212 210 213 217 224];

(1) Find the days that the price of A is more than 20 RMB higher than that of B, as well as the price difference.

(2) Given an investment strategy that holds 1000 shares of A at the             beginning of the 15 days, 100 shares will be sold on days that A is more    than 20 RMB higher than B. The sold amount will be used to buy the         relevant number of stock B shares. Use a for loop to find the numbers of A and B shares at the end of 15 days.

(3) Solve the problem above without using a loop.

(4) Find the net increase of the portfolio at the end of 15 days.

After you have understood/solved the above problems, go to LMO to attempt the online questions (Questions 1-8, Page 1).

50

Project 2

The present value of cash  Ct received at a future year  t  could be computed using the zero-rate  Tt    of that year:

PV Ct   = Ct e *+t*t

where  PV Ct     is the present value of Ct .

1. Write a user-defined function PresentValue(Cash,          ZeroRates, Years) that computes the present values of Cash paid   at Years with ZeroRates. Note that the inputs of the function should be 1-D arrays of the same size.

2. Holding a zero-coupon bond that matures in T years implies receiving    the face value at the end of year T. The bond price is hence the present       value of the face value. Use your function to find the price of the following bond:

Bond A matures in 6 years with a face value of 1000RMB. The zero rate for that year is 4%.

50

 

3. Holding a coupon-bearing bond that matures in T years implies receiving C amounts of coupon at the end of each year on or before T, as well as the  face value at the end of T. The bond price is hence the sum of the present    value of the future cash payments until the maturity time T. Use your          function to find the price of the following bond:

Bond B matures in 5 years with a face value of 1000RMB. The bond pays a 50RMB coupon at the end of each year.

The zero rates for year 1 to 5 are [3.5%, 3.4%, 3.6%, 3.6%, 3.8%].

 

After you have understood/solved the above problems, go to LMO to attempt the online questions (Questions 9-18, Page 2).