← 返回题库
中级

Black-Scholes方程

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve(____):
    import math
    d1 = (math.log(____) + (____) * T) / (sigma * math.sqrt(____))
    d2 = d1 - sigma * math.sqrt(____)
    from math import erf
    N = lambda x: ____ * (____ + erf(x / math.sqrt(____)))
    call = S * N(____) - K * math.exp(____) * N(____)
    put = K * math.exp(____) * N(____) - S * N(____)
    return {"____": round(____), "____": round(____), "____": round(____), "____": round(____)}

示例

输入
solve(100, 100, 0.05, 0.2, 1)
期望输出
{'d1': 0.35, 'd2': 0.15, '看涨期权': 10.45, '看跌期权': 5.57}
Python 代码 🔒 登录后使用
🔒

登录后即可练习

注册免费账号,在浏览器中直接运行 Python 代码