本次Python代写金融编程的主要内容是期权相关计算

Homework 2

FE621 Computational Methods in Finance

due 23:55ET, Sunday March 14, 2021

问题1(40分)。二叉树。

(a)构造代码以使用加法二叉树计算选项值。对于这一部分,您需要四个版本:欧洲和美洲以及看跌期权和看跌期权。您可以对所有选项使用相同的树结构(和函数)。

(b)下载3个不同期限(1个月,2个月和3个月)的期权价格(您可以使用Bloomberg Terminal,Yahoo!Financial等)购买股票,并获得接近该价格的20个执行价格在钱上。如果不存在3个月,请使用下一个。请在交易日(美国东部时间上午9:00至下午4:30)下载数据。否则,您的价值观将会偏离。不要忘记下载基础价值。对于数据中的每个执行价格,请使用作业1中的隐含vol值(请参阅问题1c)和当前的短期利率(美联储基金的利率是一个不错的选择)。使用二叉树计算期权价格(欧洲看涨期权和看跌期权),并将结果与​​布莱克-斯科尔斯价格进行比较。在树形结构中至少使用200个步骤。也将选项视为美国选项,并将这些值与欧洲和Black Scholes值并排绘制。创建图时,请不要忘记也绘制出价值。如果您下载了DATA 2以作最后一次分配,则可以将其用作数据集。

(c)上一部分表格的注释。

(d)考虑N∈{10,20,30,40,50,100,150,200,250,300,350,400}。计算

并绘制出欧洲看跌期权εN的绝对误差,作为

1个

N∈N *树中的步数:
ε=􏰃PBSM(S,K,T,r;σ)−PBinomTree(S,K,T,r;σ)􏰃,

N􏰃0N0􏰃
其中PBSM(S0,K,T,r;σ)和PBinomTree(S0,K,T,r;σ)是Black–

ñ

斯科尔斯·默顿价格和使用带有N步的二叉树计算的价格。你观察到什么?

问题2(30分)。使用三叉树定价异国期权。

在这里,我们将使用一个综合示例来说明如何使用树来定价与路径相关的期权。请阅读[1]中的2.10节以及[2]中的1节和5.1节(在此处可用),并解决以下问题。

a)构造三叉树以计算欧洲Up-Up-Out认购期权的价格。使用S0 = 10,行使价K = 10,到期时间T = 0.3,波动率σ= 0.2,短期利率r = 0.01,股息δ= 0和势垒H =11。有关三叉树的构造,请参见[1]中的第3章。根据需要在树中使用尽可能多的步骤。暗示。对于期权定价,您可以参考本书[1]中的算法,并尝试找出如何修改代码以与新期权和新树一起使用的方法。请注意,本书详细介绍了使用二叉树的计算,而我们要求您在此处使用三叉树。

b)对于欧洲打出电话选项,存在明确的公式。例如,执行[2]中的公式(5.2),然后将结果与(a)部分进行比较。使用与以前相同的参数。您的结果匹配吗?请注意,论文以“定价障碍选项”的名称上传到了课程外壳。

c)使用与之前相同的参数为欧式上门认购期权定价。暗示。可以采用两种方法:(5.1)中的解析解或In-Out奇偶校验。使用这两种方法来验证您的结果。

d)计算美利坚合众国期权的价格

问题3(30分)。股息假设的影响

为了计算6个月的美国看涨期权的价格,标的股票的未来价格以2周期的二项式树和3个月的周期建模。您得到:(i)在每个期间,股票价格乘以1.2或乘以0.9(ii)初始股票价格为40。 (iii)连续复利无风险利率为4%。

a)如果股票支付与其价格成正比的连续股息,并且股息收益率为2%,则应确定最佳行使价的可能行使价范围。提示:讨论行使价的所有可能情况。

2个

b)如果股票在3个月时支付了一次离散股息,并且股息支付与相应的股票价格成比例,且比例为3%,则应确定最适合提前行使的可能的执行价格范围。

奖励问题1(30分)。 Heston模型的二维树。 Beliaeva和Nawalkha(2010)在文献[7]中为Heston模型开发了与路径无关的二维树。在他们的方法中,使用单独的树作为股票价格

Instructions. For all the problems in this assignment you need to write com- puter programs and analyze data. All results need to be presented in clearly formatted tables and figures. You may use any programming language you want. Please submit an archive containing the code with comments. You will be graded based on the report you produce. The report should be in a pdf for- mat and should contain relevant code as appropriate included in the Appendix and referenced throughout the text.

Problem 1 (40 points). The Binomial Tree.

  1. (a)  Construct code to calculate option values using an additive binomial tree. For this part you need four versions: European and American as well as Call and Put. You may use the same tree construction (and function) for all options.
  2. (b)  Download Option prices (you can use the Bloomberg Terminal, Yahoo! Fi- nance, etc.) for an equity, for 3 different maturities (1 month, 2 months, and 3 months) and 20 strike prices close to the value at the money. If 3 months does not exist use next one available. Please download the data DURING THE TRADING DAY (9:00am to 4:30pm ET). Otherwise your values will be way off. Do not forget to download the value of the underlying. For each strike price in the data, use the implied vol values in Homework 1 (see Problem 1c) and the current short-term interest rate (the Feds Fund rate is a good choice). Calculate the option price (European Calls and Puts) using the binomial tree, and compare the results with the Black–Scholes price. Use at least 200 steps in your tree construction. Treat the options as American as well and plot these values side by side with the European and Black Scholes values. When you create the plot do not forget to plot the bid-ask values as well. If you downloaded DATA 2 for last assignment you can use that as your data set.
  3. (c)  Comment of the table in the previous part.
  4. (d)  Consider N ∈ {10, 20, 30, 40, 50, 100, 150, 200, 250, 300, 350, 400}. Compute

    and plot the absolute error for the European Put εN for as a function of

    1

N ∈ N∗ the number of steps in the tree:
ε =􏰃PBSM(S ,K,T,r;σ)−PBinomTree(S ,K,T,r;σ)􏰃,

N􏰃0N0􏰃
where PBSM(S0,K,T,r;σ) and PBinomTree(S0,K,T,r;σ) are the Black–

N

Scholes–Merton price and the price calculated using a binomial tree with N steps, respectively. What do you observe?

Problem 2 (30 points). Pricing Exotic Options using Trinomial Trees.

We will use here a synthetic example to illustrate using trees to price path dependent options. Please read Section 2.10 in [1] and Sections 1 and 5.1 in [2] (available here), and solve the following problems.

  1. a)  Construct a trinomial tree to calculate the price of an European Up-and-Out call option. Use S0 = 10, strike K = 10, maturity T = 0.3, volatility σ = 0.2, short rate r = 0.01, dividends δ = 0 and barrier H = 11. See Chapter 3 in [1] for the trinomial tree construction. Use as many steps in your tree as you think are necessary. Hint. For the option pricing you may consult the algorithm in the book [1] and try and figure out how to modify the code there to work with the new option and the new tree. Note the book details the computation using a binomial tree while we ask you to use a trinomial tree here.
  2. b)  For the European Up-and-Out Call option explicit formulas exist. For exam- ple, implement the formula (5.2) from [2] and compare your results with part (a). Use the same parameters as before. Are your results matching? Note the paper is uploaded to the course shell under the name “Pricing Barrier Options”.
  3. c)  Price an European Up-and-In call option, using the same parameters as before. Hint. Two methods can be employed: the analytical solution in (5.1) or the In-Out parity. Use both methods in order to verify your results.
  4. d)  Calculate the price of an AMERICAN Up and In Put option

Problem 3 (30 points). Effects of dividend assumptions

To compute prices of a 6 -month American call option, future prices of the underlying stock are modeled with a 2 -period binomial tree with 3 month periods. You are given: (i) In each period, the price of the stock are either multiplied by 1.2 or multiplied by 0.9 (ii) The initial stock price is 40 . (iii) The continuously compounded risk-free interest rate is 4%.

a) If the stock pays continuous dividends proportional to its price, and the dividend yield is 2%, then determine the range of possible strike prices for which early exercise is optimal. Hint: discuss all possible situations for the strike prices.

2

b) If the stock pays one-time discrete dividends at 3 months time, and the dividend payment is proportional to the corresponding stock price with the proportion being 3%, then determine the range of possible strike prices for which early exercise is optimal.

Bonus Problem 1 (30 points). A two-dimensional tree for the Heston model. Beliaeva and Nawalkha (2010) have developed in [7] a path-independent two-dimensional tree for the Heston model. In their approach, separate trees for the stock price and for the variance are constructed independently of one another, and then recombined, please see Chapter 8 in [5] for a detailed presen- tation.

  1. (a)  Price an American Put Option using the Beliaeva and Nawalkha method. Please note that the code provided in the book is incomplete (marked with ”…”). Consider the same numerical values for the parameters of interest as in [6].
  2. (b)  Price an European Call Option using the Beliaeva and Nawalkha method. Compare this result with the prices obtained in Homework 1, Problem 3 via the analytical formula. Consider the same numerical values as in [6]. What can you observe?

Bonus Problem 2 (30 points). Pricing variance swaps using trinomial trees. In the paper [8] the authors demonstrate how approximate the price of Variance Swaps using trees. THe model they demonstrate pricing is a stochastic volatility model as it makes little sense to price variance and volatility derivatives in models where the volatility is constant. However, in this bonus problem we will perform this nonsensical approach. Specifically, first construct the trinomial tree in Problem 2. We will use this tree with the same parameters: Use S0 = 10, strike K = 10, maturity T = 0.3, volatility σ = 0.2, short rate r = 0.01, dividends δ = 0 to price a variance swap calculated using log returns. To do this please read the paper. You will need to implement the appropriate function g in formula (15). Please price a 60 day variance swap using a 60 steps tree (i.e., n = 60 and l = 1). The calculation is detailed in formulas (16).


EasyDue™ 支持PayPal, AliPay, WechatPay, Taobao等各种付款方式!

E-mail: easydue@outlook.com  微信:easydue


EasyDue™是一个服务全球中国留学生的专业代写公司
专注提供稳定可靠的北美、澳洲、英国代写服务
专注提供CS、统计、金融、经济、数学等覆盖100+专业的作业代写服务