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