vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 2
声望: 0

10:55:39 初始化CTA回测引擎
10:55:39 策略文件加载完成
10:55:39 RQData数据接口初始化成功
10:58:09 ----------------------------------------
10:58:09 IF2001.CFFEX-1m开始下载历史数据
10:58:10 数据下载失败,触发异常:
Traceback (most recent call last):
File "D:\vnstudio\lib\site-packages\peewee.py", line 3005, in execute_sql
cursor.execute(sql, params or ())
sqlite3.OperationalError: table dbbardata has no column named open_interest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 384, in run_downloading
database_manager.save_bar_data(data)
File "D:\vnstudio\lib\site-packages\vnpy\trader\database\database_sql.py", line 374, in save_bar_data
self.class_bar.save_all(ds)
File "D:\vnstudio\lib\site-packages\vnpy\trader\database\database_sql.py", line 149, in save_all
c).on_conflict_replace().execute()
File "D:\vnstudio\lib\site-packages\peewee.py", line 1812, in inner
return method(self, database, args, **kwargs)
File "D:\vnstudio\lib\site-packages\peewee.py", line 1883, in execute
return self._execute(database)
File "D:\vnstudio\lib\site-packages\peewee.py", line 2623, in _execute
return super(Insert, self)._execute(database)
File "D:\vnstudio\lib\site-packages\peewee.py", line 2360, in _execute
cursor = database.execute(self)
File "D:\vnstudio\lib\site-packages\peewee.py", line 3018, in execute
return self.execute_sql(sql, params, commit=commit)
File "D:\vnstudio\lib\site-packages\peewee.py", line 3012, in execute_sql
self.commit()
File "D:\vnstudio\lib\site-packages\peewee.py", line 2783, in exit
reraise(new_type, new_type(
exc_args), traceback)
File "D:\vnstudio\lib\site-packages\peewee.py", line 183, in reraise
raise value.with_traceback(tb)
File "D:\vnstudio\lib\site-packages\peewee.py", line 3005, in execute_sql
cursor.execute(sql, params or ())
peewee.OperationalError: table dbbardata has no column named open_interest
请问群里的大大,为什么会提示“数据库表中无开仓兴趣的列”
需要怎么样才能解决这个问题?

Administrator
avatar
加入于:
帖子: 4130
声望: 230

这是因为vn.py版本老导致的,请删除C:\users\administrator.vntrader\database.db文件,然后重启即可

Member
avatar
加入于:
帖子: 2
声望: 0

用Python的交易员 wrote:

这是因为vn.py版本老导致的,请删除C:\users\administrator.vntrader\database.db文件,然后重启即可
按照这办法,问题已得到解决。 十分感谢
但又有一个新的问题,即在回测时我换为非1m频率的数据进行回测,为什么策略不能产生交易信号呢? 是不是策略里面的bar数据处理函数需要进行相应合成调整?

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