vnpy/examples/QuantosDataService/downloadData.py

22 lines
467 B
Python
Raw Normal View History

2017-12-05 04:48:25 +00:00
# encoding: UTF-8
"""
立即下载数据到数据库中用于手动执行更新操作
"""
import json
from vnpy.trader.gateway.tkproGateway.DataApi import DataApi
from dataService import *
if __name__ == '__main__':
# 创建API对象
api = DataApi(DATA_SERVER)
info, msg = api.login(USERNAME, TOKEN)
if not info:
print u'数据服务器登录失败,原因:%s' %msg
# 下载数据
2017-12-08 13:23:42 +00:00
downloadAllMinuteBar(api, 100)