Flatten builtin pages, add third-party and platform scopes, and import financial and data warehouse references. Keep the existing generated index without rebuilding after signature normalization.
3.5 KiB
3.5 KiB
金融 / 金融工程 / 期权定价
b_sOfCoin(option_type, s, x, r, rf, std, t)
声明:function
对外汇期权使用 BS方法进行定价
| 参数 | 类型 | 说明 |
|---|---|---|
option_type |
int | 期权类型,整数类型;0:看涨;1:看跌 |
s |
float | 标的现价,实数类型 |
x |
float | 期权的行权价,实数类型 |
r |
float | 无风险年利率(%),实数类型 |
rf |
float | 货币无风险年利率(%),实数类型 |
std |
float | 年波动率(%),实数类型 |
t |
float | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
返回:array
示例
范例01:用B-S 对外汇看跌期权进行定价
// 用B-S 对外汇看跌期权进行定价
Return B_SOfCoin(1, 1.61, 1.6, 5, 3, 10, 5);
b_sOfStock_iv(option_type, s, x, r, close, t)
声明:function
由股票期权交易价格依据 BS定价模型倒推出股票的隐含波动率
| 参数 | 类型 | 说明 |
|---|---|---|
option_type |
int | 期权类型,整数类型;0:看涨;1:看跌 |
s |
float | 标的现价,实数类型 |
x |
float | 期权的行权价,实数类型 |
r |
float | 无风险年利率(%),实数类型 |
close |
float | 期权实际交易价格,实数类型 |
t |
float | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
返回:float
示例
范例01:用 B-S 计算股票期权的隐含波动率
// 用 B-S 计算股票期权的隐含波动率
Return B_SOfStock_IV(0, 4.62, 4.5, 5, 0.68, 12);
// 输出:27.8
binomialTreeOfFuture(option_type, s, x, r, std, t, return_type)
声明:function
对美式期货期权使用二叉树方法进行定价(期货期权没有欧式)
| 参数 | 类型 | 说明 |
|---|---|---|
option_type |
int | 期权类型,整数类型 |
s |
real | 标的现价,实数类型 |
x |
real | 期权的行权价,实数类型 |
r |
real | 无风险年利率(%),实数类型 |
std |
real | 年波动率(%),实数类型 |
t |
real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
return_type |
int | 返回类型,整数 |
返回:array
示例
范例01:调用函数
// 用二叉树对期货美式看涨期权进行定价
return binomialTreeOfFuture(0, 300, 350, 5, 10, 5, 3);
结果如截图: