[Add]增加期权计算隐含波动率前对存续时间t的检查

This commit is contained in:
vn.py 2018-01-26 09:40:58 +08:00
parent b2fc3e5d84
commit 948f081441

View File

@ -206,7 +206,7 @@ class OmOption(OmInstrument):
def calculateOptionImpv(self): def calculateOptionImpv(self):
"""计算隐含波动率""" """计算隐含波动率"""
underlyingPrice = self.underlying.midPrice underlyingPrice = self.underlying.midPrice
if not underlyingPrice: if not underlyingPrice or not self.t:
return return
self.askImpv = self.calculateImpv(self.askPrice1, underlyingPrice, self.k, self.askImpv = self.calculateImpv(self.askPrice1, underlyingPrice, self.k,