From f0c56d42dd0e5a568bc79878b1aec518d9245cb7 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Sat, 6 Oct 2018 08:56:16 +0800 Subject: [PATCH] =?UTF-8?q?[Mod]=E7=A7=BB=E9=99=A4CryptoTrader=E5=AF=B9?= =?UTF-8?q?=E4=BA=8E=E6=93=8D=E4=BD=9C=E7=B3=BB=E7=BB=9F=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/CoinapiDataService/dataService.py | 4 ++-- examples/CryptoTrader/run.py | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/CoinapiDataService/dataService.py b/examples/CoinapiDataService/dataService.py index 50279b75..21e52138 100644 --- a/examples/CoinapiDataService/dataService.py +++ b/examples/CoinapiDataService/dataService.py @@ -51,8 +51,8 @@ def downMinuteBarBySymbol(symbol, period, start, end): """下载某一合约的分钟线数据""" startTime = time.time() - cl = db[symbol] # 集合 - cl.ensure_index([('datetime', ASCENDING)], unique=True) # 添加索引 + cl = db[symbol] + cl.ensure_index([('datetime', ASCENDING)], unique=True) startDt = datetime.datetime.strptime(start, '%Y%m%d') endDt = datetime.datetime.strptime(end, '%Y%m%d') diff --git a/examples/CryptoTrader/run.py b/examples/CryptoTrader/run.py index ab6bdb77..240b8272 100644 --- a/examples/CryptoTrader/run.py +++ b/examples/CryptoTrader/run.py @@ -9,10 +9,6 @@ import sys reload(sys) sys.setdefaultencoding('utf8') -# 判断操作系统 -import platform -system = platform.system() - # vn.trader模块 from vnpy.event import EventEngine from vnpy.trader.vtEngine import MainEngine