楼主: niuniuyiwan
19182 7

[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:01:35 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
  1. function [Call, Put] = FormulaBS( S, K, r, tau, sigma, yield)
  2. % Evaluation of the call and put values using Black-Scholes formula
  3. %
  4. % Input
  5. %        S: Current price of the underlying asset;
  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. % N.B. All parameters can be vectors. If there is more than one, then they
  13. % must have the same dimension.
  14. %
  15. % Output
  16. %         Call: value of the European call,
  17. %         Put : value of the European put.
  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 is 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. d1 = (log(S./K)+ (r-yield).*tau + (sigma.^2).* tau / 2)./ ( sigma.* sqrt( tau ) );
  27. d2 = d1 - sigma.* sqrt( tau );

  28. Call    =  exp( -yield.* tau ).*S.* normcdf( d1 ) -  exp( -r.* tau ).* K.* normcdf( d2 );
  29. Put     =  Call - S.* exp( -yield.* tau ) + K.* exp( -r.* tau ); % Put-Call parity
复制代码


二维码

扫码加我 拉你入群

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

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

关键词:MATLAB matla atlab Lab Atl 价值 模型

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

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

沙发
syslon 发表于 2015-7-7 21:07:13
谢谢楼主分享
已有 1 人评分经验 论坛币 收起 理由
xddlovejiao1314 + 10 + 3 鼓励积极发帖讨论

总评分: 经验 + 10  论坛币 + 3   查看全部评分

藤椅
juheqi 发表于 2015-9-30 10:28:58
非常赞 楼主!
已有 1 人评分经验 论坛币 收起 理由
xddlovejiao1314 + 10 + 3 鼓励积极发帖讨论

总评分: 经验 + 10  论坛币 + 3   查看全部评分

板凳
xddlovejiao1314 学生认证  发表于 2015-9-30 20:55:43
谢谢分享。
已有 1 人评分论坛币 热心指数 收起 理由
niuniuyiwan + 10 + 3 精彩帖子

总评分: 论坛币 + 10  热心指数 + 3   查看全部评分

报纸
袜子和栗子233 发表于 2017-3-6 17:01:31
非常感谢!

地板
hushuchangc 发表于 2019-3-7 22:15:03 来自手机
为何看不到代码了呢

7
德意志元帅 发表于 2020-6-4 22:44:46
感谢楼主分享,简单实用的代码真是帮了不少忙!

8
miechen1979 发表于 2022-11-9 21:10:15
谢谢分享!

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

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