diff --git a/.travis.yml b/.travis.yml index fd330019..5db367a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,15 @@ cache: pip python: - 2.7 - 3.6 +before_install: + - sudo apt install build-essential + - wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz + - tar -xzf ta-lib-0.4.0-src.tar.gz + - cd ta-lib/ + - ./configure --prefix=/usr + - make + - sudo make install + - cd .. install: - pip install -r requirements.txt - pip install flake8 # pytest # add another testing frameworks later diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index d6cfff21..3d726019 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -376,9 +376,33 @@ class CtpMdApi(MdApi): tick.askVolume1 = data['AskVolume1'] # 大商所日期转换 - if tick.exchange is EXCHANGE_DCE: + if tick.exchange == EXCHANGE_DCE: tick.date = datetime.now().strftime('%Y%m%d') - + + # 上交所,SEE,股票期权相关 + if tick.exchange == EXCHANGE_SSE: + tick.bidPrice2 = data['BidPrice2'] + tick.bidVolume2 = data['BidVolume2'] + tick.askPrice2 = data['AskPrice2'] + tick.askVolume2 = data['AskVolume2'] + + tick.bidPrice3 = data['BidPrice3'] + tick.bidVolume3 = data['BidVolume3'] + tick.askPrice3 = data['AskPrice3'] + tick.askVolume3 = data['AskVolume3'] + + tick.bidPrice4 = data['BidPrice4'] + tick.bidVolume4 = data['BidVolume4'] + tick.askPrice4 = data['AskPrice4'] + tick.askVolume4 = data['AskVolume4'] + + tick.bidPrice5 = data['BidPrice5'] + tick.bidVolume5 = data['BidVolume5'] + tick.askPrice5 = data['AskPrice5'] + tick.askVolume5 = data['AskVolume5'] + + tick.date = data['TradingDay'] + self.gateway.onTick(tick) #----------------------------------------------------------------------