VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 97
声望: 4

我的CTP已经能够连接服务器,配置里已经将tushare数据源和token,以及arctic数据库设置好,
在vscode里运行这个示范https://gitee.com/vnpy/vnpy/blob/master/examples/cta_backtesting/backtesting_demo.ipynb
结果失败,不知道哪里设置有问题?提示没有数据:
2021-11-06 16:37:29.359454 开始加载历史数据
2021-11-06 16:37:29.362412 加载进度:# [0%]
/home/yinxiuqu/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/arctic/store/_pandas_ndarray_store.py:8: FutureWarning: The Panel class is removed from pandas. Accessing it from the top-level namespace will also be removed in the next version
from pandas import Panel
Library created, but couldn't enable sharding: no such command: 'enablesharding', full error: {'ok': 0.0, 'errmsg': "no such command: 'enablesharding'", 'code': 59, 'codeName': 'CommandNotFound'}. This is OK if you're not 'admin'
Library created, but couldn't enable sharding: no such command: 'enablesharding', full error: {'ok': 0.0, 'errmsg': "no such command: 'enablesharding'", 'code': 59, 'codeName': 'CommandNotFound'}. This is OK if you're not 'admin'
Collection data_overview already exists
NoDataFoundException Traceback (most recent call last)
/tmp/ipykernel_80158/2657180459.py in <module>
1 #%%
----> 2 engine.load_data()
3 engine.run_backtesting()
4 df = engine.calculate_result()
5 engine.calculate_statistics()

~/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/vnpy_ctastrategy/backtesting.py in load_data(self)
184 self.interval,
185 start,
--> 186 end
187 )
188 else:

~/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/vnpy_ctastrategy/backtesting.py in load_bar_data(symbol, exchange, interval, start, end)
1051
1052 return database.load_bar_data(
-> 1053 symbol, exchange, interval, start, end
1054 )
1055

~/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/vnpy_arctic/arctic_database.py in load_bar_data(self, symbol, exchange, interval, start, end)
167 table_name = generate_table_name(symbol, exchange, interval)
168 df = self.bar_library.read(
--> 169 table_name, chunk_range=DateRange(start, end))
170
171 df.set_index("date", inplace=True)

~/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/arctic/chunkstore/chunkstore.py in read(self, symbol, chunk_range, filter_data, **kwargs)
254 sym = self._get_symbol_info(symbol)
255 if not sym:
--> 256 raise NoDataFoundException('No data found for %s' % (symbol))
257
258 spec = {SYMBOL: {'$in': symbol}}

NoDataFoundException: No data found for ['IF888_CFFEX_1m']

Member
avatar
加入于:
帖子: 97
声望: 4

回测界面下载数据,提示如下错误:
21:05:40 初始化CTA回测引擎
21:05:40 策略文件加载完成
21:05:40 数据服务初始化成功
21:09:16 ----------------------------------------
21:09:16 IF88.CFFEX-1m开始下载历史数据
21:09:43 数据下载失败,触发异常:
Traceback (most recent call last):
File "/home/yinxiuqu/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/vnpy_ctabacktester/engine.py", line 404, in run_downloading
data = self.datafeed.query_bar_history(req)
File "/home/yinxiuqu/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/vnpy_tushare/tushare_datafeed.py", line 175, in query_bar_history
freq=ts_interval
File "/home/yinxiuqu/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/tushare/pro/data_pro.py", line 196, in pro_bar
raise IOError('ERROR.')
OSError: ERROR.

21:10:29 ----------------------------------------
21:10:29 IF88.CFFEX-1m开始下载历史数据
21:10:56 数据下载失败,触发异常:
Traceback (most recent call last):
File "/home/yinxiuqu/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/vnpy_ctabacktester/engine.py", line 404, in run_downloading
data = self.datafeed.query_bar_history(req)
File "/home/yinxiuqu/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/vnpy_tushare/tushare_datafeed.py", line 175, in query_bar_history
freq=ts_interval
File "/home/yinxiuqu/anaconda3/envs/vnpy2.7/lib/python3.7/site-packages/tushare/pro/data_pro.py", line 196, in pro_bar
rai
终端后台提示下列错误:
Library created, but couldn't enable sharding: no such command: 'enablesharding', full error: {'ok': 0.0, 'errmsg': "no such command: 'enablesharding'", 'code': 59, 'codeName': 'CommandNotFound'}. This is OK if you're not 'admin'
Library created, but couldn't enable sharding: no such command: 'enablesharding', full error: {'ok': 0.0, 'errmsg': "no such command: 'enablesharding'", 'code': 59, 'codeName': 'CommandNotFound'}. This is OK if you're not 'admin'

Member
avatar
加入于:
帖子: 716
声望: 63

Library created, but couldn't enable sharding: no such command: 'enablesharding', full error: {'ok': 0.0, 'errmsg': "no such command: 'enablesharding'", 'code': 59, 'codeName': 'CommandNotFound'}. This is OK if you're not 'admin'
Library created, but couldn't enable sharding: no such command: 'enablesharding', full error: {'ok': 0.0, 'errmsg': "no such command: 'enablesharding'", 'code': 59, 'codeName': 'CommandNotFound'}. This is OK if you're not 'admin
这个是使用arctic正常打印,不影响使用。IF88是米筐的合约,不是市场上的合约,在tushare中无法使用。可以先尝试使用vnpy_datamanager来测试数据源和数据库是否正常使用。

Member
avatar
加入于:
帖子: 97
声望: 4

谢谢了,用tushare那边的合约代码成功了。非常感谢。

© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】