[Mod]修改black模型的calculateTheta实现

This commit is contained in:
vn.py 2017-11-06 22:26:21 +08:00
parent b5357c4d7d
commit 0bbb321306
4 changed files with 6 additions and 3 deletions

View File

@ -68,7 +68,7 @@ def calculateTheta(f, k, r, t, v, cp):
"""计算Theta值""" """计算Theta值"""
price1 = calculatePrice(f, k, r, t*STEP_UP, v, cp) price1 = calculatePrice(f, k, r, t*STEP_UP, v, cp)
price2 = calculatePrice(f, k, r, t*STEP_DOWN, v, cp) price2 = calculatePrice(f, k, r, t*STEP_DOWN, v, cp)
theta = (price1 - price2) * (t * STEP_DIFF * 240) theta = -(price1 - price2) / (t * STEP_DIFF * 240)
return theta return theta
#---------------------------------------------------------------------- #----------------------------------------------------------------------
@ -76,7 +76,7 @@ def calculateVega(f, k, r, t, v, cp):
"""计算Vega值""" """计算Vega值"""
price1 = calculatePrice(f, k, r, t, v*STEP_UP, cp) price1 = calculatePrice(f, k, r, t, v*STEP_UP, cp)
price2 = calculatePrice(f, k, r, t, v*STEP_DOWN, cp) price2 = calculatePrice(f, k, r, t, v*STEP_DOWN, cp)
vega = (price1 - price2) / (v * STEP_DIFF * 100) vega = (price1 - price2) / (v * STEP_DIFF * 100)
return vega return vega
#---------------------------------------------------------------------- #----------------------------------------------------------------------

View File

@ -7,4 +7,4 @@ appName = 'OptionMaster'
appDisplayName = u'OptionMaster' appDisplayName = u'OptionMaster'
appEngine = None appEngine = None
appWidget = None appWidget = None
appIco = 'rm.ico' appIco = 'om.ico'

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -0,0 +1,3 @@
# encoding: UTF-8