From 6a832eac4d6a288b8c3ff920a8eb9d1ac5706efe Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 13 Feb 2018 08:03:59 +0800 Subject: [PATCH] =?UTF-8?q?[Mod]=E5=A2=9E=E5=8A=A0=E9=9A=90=E5=90=AB?= =?UTF-8?q?=E6=B3=A2=E5=8A=A8=E7=8E=87=E5=BC=82=E5=B8=B8=E6=A3=80=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/app/optionMaster/etf_portfolio.json | 6 ++---- vnpy/trader/app/optionMaster/omBase.py | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/vnpy/trader/app/optionMaster/etf_portfolio.json b/vnpy/trader/app/optionMaster/etf_portfolio.json index fe2ea449..8de8b975 100644 --- a/vnpy/trader/app/optionMaster/etf_portfolio.json +++ b/vnpy/trader/app/optionMaster/etf_portfolio.json @@ -8,10 +8,8 @@ { "underlyingSymbol": "510050", "chainSymbol": "510050-1802", - "r": 0.03 - } - ], - "other": [ + "r": 0.04 + }, { "underlyingSymbol": "510050", "chainSymbol": "510050-1803", diff --git a/vnpy/trader/app/optionMaster/omBase.py b/vnpy/trader/app/optionMaster/omBase.py index bf96d0b9..116b652b 100644 --- a/vnpy/trader/app/optionMaster/omBase.py +++ b/vnpy/trader/app/optionMaster/omBase.py @@ -211,8 +211,13 @@ class OmOption(OmInstrument): self.askImpv = self.calculateImpv(self.askPrice1, underlyingPrice, self.k, 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.r, self.t, self.cp) + if self.bidImpv > 1: + self.bidImpv = 0.01 self.midImpv = (self.askImpv + self.bidImpv) / 2 #----------------------------------------------------------------------