[Mod]增加隐含波动率异常检验

This commit is contained in:
vn.py 2018-02-13 08:03:59 +08:00
parent 5e03feef29
commit 6a832eac4d
2 changed files with 7 additions and 4 deletions

View File

@ -8,10 +8,8 @@
{ {
"underlyingSymbol": "510050", "underlyingSymbol": "510050",
"chainSymbol": "510050-1802", "chainSymbol": "510050-1802",
"r": 0.03 "r": 0.04
} },
],
"other": [
{ {
"underlyingSymbol": "510050", "underlyingSymbol": "510050",
"chainSymbol": "510050-1803", "chainSymbol": "510050-1803",

View File

@ -211,8 +211,13 @@ class OmOption(OmInstrument):
self.askImpv = self.calculateImpv(self.askPrice1, underlyingPrice, self.k, self.askImpv = self.calculateImpv(self.askPrice1, underlyingPrice, self.k,
self.r, self.t, self.cp) self.r, self.t, self.cp)
if self.askImpv > 1: # 正常情况下波动率不应该超过100%
self.askImpv = 0.01 # 若超过则大概率为溢出调整为1%
self.bidImpv = self.calculateImpv(self.bidPrice1, underlyingPrice, self.k, self.bidImpv = self.calculateImpv(self.bidPrice1, underlyingPrice, self.k,
self.r, self.t, self.cp) self.r, self.t, self.cp)
if self.bidImpv > 1:
self.bidImpv = 0.01
self.midImpv = (self.askImpv + self.bidImpv) / 2 self.midImpv = (self.askImpv + self.bidImpv) / 2
#---------------------------------------------------------------------- #----------------------------------------------------------------------