From bd6447a7082ce4def2354bfc9640bbbe997121c3 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Fri, 12 Oct 2018 14:45:18 +0800 Subject: [PATCH] =?UTF-8?q?[Mod]=E8=B0=83=E6=95=B4DataService=E7=9B=B8?= =?UTF-8?q?=E5=85=B3Demo=E7=9A=84=E7=9B=AE=E5=BD=95=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => DataService}/CoinapiDataService/config.json | 0 .../CoinapiDataService/dataService.py | 7 ++++--- .../CoinapiDataService/downloadData.py | 0 .../CoinapiDataService/runService.py | 0 examples/{ => DataService}/FutuDataService/README.md | 0 .../{ => DataService}/FutuDataService/config.json | 0 .../{ => DataService}/FutuDataService/dataService.py | 0 .../{ => DataService}/FutuDataService/downloadData.py | 0 .../{ => DataService}/FutuDataService/runService.py | 0 examples/DataService/README.md | 11 +++++++++++ .../{ => DataService}/ShcifcoDataService/config.json | 0 .../ShcifcoDataService/dataService.py | 0 .../ShcifcoDataService/downloadData.py | 0 .../ShcifcoDataService/runService.py | 0 examples/{ => DataService}/TqDataService/README.md | 0 examples/{ => DataService}/TqDataService/config.json | 0 .../{ => DataService}/TqDataService/dataService.py | 0 .../{ => DataService}/TqDataService/downloadData.py | 0 .../{ => DataService}/TqDataService/runService.py | 0 .../{ => DataService}/TushareDataService/config.json | 0 .../TushareDataService/dataService.py | 0 .../TushareDataService/downloadData.py | 0 .../TushareDataService/runService.py | 0 examples/README.md | 10 +--------- 24 files changed, 16 insertions(+), 12 deletions(-) rename examples/{ => DataService}/CoinapiDataService/config.json (100%) rename examples/{ => DataService}/CoinapiDataService/dataService.py (95%) rename examples/{ => DataService}/CoinapiDataService/downloadData.py (100%) rename examples/{ => DataService}/CoinapiDataService/runService.py (100%) rename examples/{ => DataService}/FutuDataService/README.md (100%) rename examples/{ => DataService}/FutuDataService/config.json (100%) rename examples/{ => DataService}/FutuDataService/dataService.py (100%) rename examples/{ => DataService}/FutuDataService/downloadData.py (100%) rename examples/{ => DataService}/FutuDataService/runService.py (100%) create mode 100644 examples/DataService/README.md rename examples/{ => DataService}/ShcifcoDataService/config.json (100%) rename examples/{ => DataService}/ShcifcoDataService/dataService.py (100%) rename examples/{ => DataService}/ShcifcoDataService/downloadData.py (100%) rename examples/{ => DataService}/ShcifcoDataService/runService.py (100%) rename examples/{ => DataService}/TqDataService/README.md (100%) rename examples/{ => DataService}/TqDataService/config.json (100%) rename examples/{ => DataService}/TqDataService/dataService.py (100%) rename examples/{ => DataService}/TqDataService/downloadData.py (100%) rename examples/{ => DataService}/TqDataService/runService.py (100%) rename examples/{ => DataService}/TushareDataService/config.json (100%) rename examples/{ => DataService}/TushareDataService/dataService.py (100%) rename examples/{ => DataService}/TushareDataService/downloadData.py (100%) rename examples/{ => DataService}/TushareDataService/runService.py (100%) diff --git a/examples/CoinapiDataService/config.json b/examples/DataService/CoinapiDataService/config.json similarity index 100% rename from examples/CoinapiDataService/config.json rename to examples/DataService/CoinapiDataService/config.json diff --git a/examples/CoinapiDataService/dataService.py b/examples/DataService/CoinapiDataService/dataService.py similarity index 95% rename from examples/CoinapiDataService/dataService.py rename to examples/DataService/CoinapiDataService/dataService.py index 21e52138..5b65ea56 100644 --- a/examples/CoinapiDataService/dataService.py +++ b/examples/DataService/CoinapiDataService/dataService.py @@ -31,10 +31,11 @@ headers = {'X-CoinAPI-Key': APIKEY} #---------------------------------------------------------------------- def generateVtBar(symbol, d): """生成K线""" + l = symbol.split('_') bar = VtBarData() - - bar.symbol = symbol - bar.vtSymbol = symbol + bar.symbol = l[-2] + l[-1] + bar.exchange = l[0] + bar.vtSymbol = '/'.join([bar.symbol, bar.exchange]) bar.datetime = datetime.datetime.strptime(d['time_open'], '%Y-%m-%dT%H:%M:%S.%f0Z') bar.date = bar.datetime.strftime('%Y%m%d') bar.time = bar.datetime.strftime('%H:%M:%S') diff --git a/examples/CoinapiDataService/downloadData.py b/examples/DataService/CoinapiDataService/downloadData.py similarity index 100% rename from examples/CoinapiDataService/downloadData.py rename to examples/DataService/CoinapiDataService/downloadData.py diff --git a/examples/CoinapiDataService/runService.py b/examples/DataService/CoinapiDataService/runService.py similarity index 100% rename from examples/CoinapiDataService/runService.py rename to examples/DataService/CoinapiDataService/runService.py diff --git a/examples/FutuDataService/README.md b/examples/DataService/FutuDataService/README.md similarity index 100% rename from examples/FutuDataService/README.md rename to examples/DataService/FutuDataService/README.md diff --git a/examples/FutuDataService/config.json b/examples/DataService/FutuDataService/config.json similarity index 100% rename from examples/FutuDataService/config.json rename to examples/DataService/FutuDataService/config.json diff --git a/examples/FutuDataService/dataService.py b/examples/DataService/FutuDataService/dataService.py similarity index 100% rename from examples/FutuDataService/dataService.py rename to examples/DataService/FutuDataService/dataService.py diff --git a/examples/FutuDataService/downloadData.py b/examples/DataService/FutuDataService/downloadData.py similarity index 100% rename from examples/FutuDataService/downloadData.py rename to examples/DataService/FutuDataService/downloadData.py diff --git a/examples/FutuDataService/runService.py b/examples/DataService/FutuDataService/runService.py similarity index 100% rename from examples/FutuDataService/runService.py rename to examples/DataService/FutuDataService/runService.py diff --git a/examples/DataService/README.md b/examples/DataService/README.md new file mode 100644 index 00000000..ee4f0a7c --- /dev/null +++ b/examples/DataService/README.md @@ -0,0 +1,11 @@ +# DataService说明 + +* ShcifcoDataService:上海中期历史行情服务(期货) + +* TqDataService:天勤历史行情服务(期货) + +* TushareDataService:TuShare历史行情服务(A股) + +* FutuDataService:富途证券历史行情服务(美股、港股) + +* CoinapiDataService:CoinAPI.io历史行情服务(数字货币) \ No newline at end of file diff --git a/examples/ShcifcoDataService/config.json b/examples/DataService/ShcifcoDataService/config.json similarity index 100% rename from examples/ShcifcoDataService/config.json rename to examples/DataService/ShcifcoDataService/config.json diff --git a/examples/ShcifcoDataService/dataService.py b/examples/DataService/ShcifcoDataService/dataService.py similarity index 100% rename from examples/ShcifcoDataService/dataService.py rename to examples/DataService/ShcifcoDataService/dataService.py diff --git a/examples/ShcifcoDataService/downloadData.py b/examples/DataService/ShcifcoDataService/downloadData.py similarity index 100% rename from examples/ShcifcoDataService/downloadData.py rename to examples/DataService/ShcifcoDataService/downloadData.py diff --git a/examples/ShcifcoDataService/runService.py b/examples/DataService/ShcifcoDataService/runService.py similarity index 100% rename from examples/ShcifcoDataService/runService.py rename to examples/DataService/ShcifcoDataService/runService.py diff --git a/examples/TqDataService/README.md b/examples/DataService/TqDataService/README.md similarity index 100% rename from examples/TqDataService/README.md rename to examples/DataService/TqDataService/README.md diff --git a/examples/TqDataService/config.json b/examples/DataService/TqDataService/config.json similarity index 100% rename from examples/TqDataService/config.json rename to examples/DataService/TqDataService/config.json diff --git a/examples/TqDataService/dataService.py b/examples/DataService/TqDataService/dataService.py similarity index 100% rename from examples/TqDataService/dataService.py rename to examples/DataService/TqDataService/dataService.py diff --git a/examples/TqDataService/downloadData.py b/examples/DataService/TqDataService/downloadData.py similarity index 100% rename from examples/TqDataService/downloadData.py rename to examples/DataService/TqDataService/downloadData.py diff --git a/examples/TqDataService/runService.py b/examples/DataService/TqDataService/runService.py similarity index 100% rename from examples/TqDataService/runService.py rename to examples/DataService/TqDataService/runService.py diff --git a/examples/TushareDataService/config.json b/examples/DataService/TushareDataService/config.json similarity index 100% rename from examples/TushareDataService/config.json rename to examples/DataService/TushareDataService/config.json diff --git a/examples/TushareDataService/dataService.py b/examples/DataService/TushareDataService/dataService.py similarity index 100% rename from examples/TushareDataService/dataService.py rename to examples/DataService/TushareDataService/dataService.py diff --git a/examples/TushareDataService/downloadData.py b/examples/DataService/TushareDataService/downloadData.py similarity index 100% rename from examples/TushareDataService/downloadData.py rename to examples/DataService/TushareDataService/downloadData.py diff --git a/examples/TushareDataService/runService.py b/examples/DataService/TushareDataService/runService.py similarity index 100% rename from examples/TushareDataService/runService.py rename to examples/DataService/TushareDataService/runService.py diff --git a/examples/README.md b/examples/README.md index f42ddc5a..cd55637b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -20,12 +20,4 @@ * ServerClient:服务端(业务逻辑)和客户端(GUI界面)分离的VnTrader -* ShcifcoDataService:上海中期历史行情服务(期货) - -* TqDataService:天勤历史行情服务(期货) - -* TushareDataService:TuShare历史行情服务(A股) - -* FutuDataService:富途证券历史行情服务(美股、港股) - -* CoinapiDataService:CoinAPI.io历史行情服务(数字货币) \ No newline at end of file +* DataService:用于下载历史行情数据以及每日数据自动更新的数据服务 \ No newline at end of file