早期写的python障碍式期权的定价脚本,供大家参考,具体内容如下
#coding:utf-8
'''
障碍期权
q=x/s
H = h/x H 障碍价格
[1] Down-and-in call cdi
[2] Up-and-in call cui
[3] Down-and-in put pdi
[4] Up-and-in put pui
[5] Down-and-out call cdo
[6] Up-and-out call cuo
[7] Down-and-out put pdo
[8] Up-and-out put puo
'''
from math import log,sqrt