[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值"""
price1 = calculatePrice(f, k, r, t*STEP_UP, 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
#----------------------------------------------------------------------
@ -76,7 +76,7 @@ def calculateVega(f, k, r, t, v, cp):
"""计算Vega值"""
price1 = calculatePrice(f, k, r, t, v*STEP_UP, 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
#----------------------------------------------------------------------

View File

@ -7,4 +7,4 @@ appName = 'OptionMaster'
appDisplayName = u'OptionMaster'
appEngine = 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