楼主: niuniuyiwan
6536 1

[MATLAB] 在MATLAB中使用BS模型计算期权希腊值 [推广有奖]

  • 7关注
  • 91粉丝

VIP

已卖:1980份资源

学科带头人

91%

还不是VIP/贵宾

-

威望
0
论坛币
14446 个
通用积分
1962.3850
学术水平
1119 点
热心指数
1167 点
信用等级
1061 点
经验
8523 点
帖子
1629
精华
1
在线时间
2492 小时
注册时间
2010-10-10
最后登录
2025-12-19

楼主
niuniuyiwan 在职认证  发表于 2015-7-7 21:03:38 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
  1. function [DeltaCall, DeltaPut, Gamma, Vega] = FormulaBSGreeks( S, K, r, tau, sigma, yield)
  2. % Evaluation of the greeks (delta, gamma, vega) for call and put options
  3. % under the Black-Scholes model.
  4. %
  5. % Input: S: Actual price of the underlying asset (can be a vector);
  6. %        K: Strike price;
  7. %        r: (continuous) short-time interest rate for the period;
  8. %        tau: time to maturity;
  9. %        sigma: volatility in the B-S model;
  10. %        yield: continuous dividend rate.
  11. %
  12. % Output: DeltaCall: value of the delta for the European call option;
  13. %         DeltaPut : value of the delta for the European put option;
  14. %         Gamma    : value of the gamma for the European call option
  15. %                   (same value for put option);
  16. %         vega     : value of the vega for the European call option
  17. %                   (same value for put option).
  18. %
  19. % N.B.: The time and rate must be on the same scale as the one used for
  20. %       estimating sigma. For example, if sigma was estimated with daily
  21. %       prices, then tau should be in days, and r should be the interest
  22. %       rate for 1 day.
  23. if nargin < 6
  24.     yield =0;
  25. end

  26. s = S.*exp( -yield.* tau );
  27. d1 = ( log( s./ K )+ r.* tau + (sigma.^2).* tau / 2 )./ ( sigma.* sqrt( tau ) );

  28. z = normpdf(d1);

  29. DeltaCall = exp( -yield.* tau ).* normcdf(d1);
  30. DeltaPut  = DeltaCall - exp( -yield.* tau ); % By put-call parity

  31. Vega = s.*z.* sqrt( tau );

  32. Gamma = exp( -yield.* tau ).*( z./s)./(sigma.*sqrt(tau));
复制代码


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:MATLAB matla atlab Lab Atl 模型 希腊

已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
xddlovejiao1314 + 100 + 100 + 5 + 5 + 5 精彩帖子

总评分: 经验 + 100  论坛币 + 100  学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

沙发
xddlovejiao1314 学生认证  发表于 2015-7-24 14:12:09
好贴,谢谢分享。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-26 23:30