[Add]增加DataEngine的成交数据缓存

This commit is contained in:
vn.py 2018-02-14 21:29:05 +08:00
parent 378cb8d482
commit 8b27eaa494
2 changed files with 5 additions and 2 deletions

View File

@ -7,6 +7,7 @@
3. 增加从通达信导出的历史数据载入到MongoDB中的函数
"""
import csv
from datetime import datetime, timedelta
from time import time
@ -208,10 +209,10 @@ def loadTdxCsv(fileName, dbName, symbol):
print bar.date, bar.time
print u'插入完毕,耗时:%s' % (time()-start)
#----------------------------------------------------------------------
def loadOKEXCsv(fileName, dbName, symbol):
"""将OKEX导出的csv格式的历史分钟数据插入到Mongo数据库中"""
import csv
start = time()
print u'开始读取CSV文件%s中的数据插入到%s%s' %(fileName, dbName, symbol)

View File

@ -454,6 +454,8 @@ class DataEngine(object):
def processTradeEvent(self, event):
"""处理成交事件"""
trade = event.dict_['data']
self.tradeDict[trade.vtTradeID] = trade
# 更新到持仓细节中
detail = self.getPositionDetail(trade.vtSymbol)