vnpy/beta/quantos/QuantosDataService/downloadData.py

23 lines
506 B
Python
Raw Normal View History

2017-12-05 04:48:25 +00:00
# encoding: UTF-8
"""
立即下载数据到数据库中用于手动执行更新操作
"""
2018-05-07 16:37:09 +00:00
from __future__ import print_function
2017-12-05 04:48:25 +00:00
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:
2018-05-07 16:37:09 +00:00
print(u'数据服务器登录失败,原因:%s' %msg)
2017-12-05 04:48:25 +00:00
# 下载数据
2017-12-08 13:23:42 +00:00
downloadAllMinuteBar(api, 100)