vn.py官网
开源量化社区
Member
avatar
加入于:
帖子: 18
声望: 0

如下图,下载后测试,报错,这个应该去哪里查看该错误呢
description

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

报错信息如下
[test] 触发异常已停止
Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\peewee.py", line 3144, in execute_sql
cursor.execute(sql, params or ())
File "c:\vnstudio\lib\site-packages\pymysql\cursors.py", line 148, in execute
result = self._query(query)
File "c:\vnstudio\lib\site-packages\pymysql\cursors.py", line 310, in _query
conn.query(q)
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
result.read()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
packet.raise_for_error()
File "c:\vnstudio\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "c:\vnstudio\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 't1.turnover' in 'field list'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnpy_ctastrategy\engine.py", line 706, in call_strategy_func
func()
File "c:\vnstudio\lib\site-packages\vnpy_ctastrategy\strategies\atr_rsi_strategy.py", line 66, in on_init
self.load_bar(10)
File "c:\vnstudio\lib\site-packages\vnpy_ctastrategy\template.py", line 306, in load_bar
use_database
File "c:\vnstudio\lib\site-packages\vnpy_ctastrategy\engine.py", line 588, in load_bar
end=end,
File "c:\vnstudio\lib\site-packages\vnpy\database\mysql\mysql_database.py", line 234, in load_bar_data
for db_bar in s:
File "c:\vnstudio\lib\site-packages\peewee.py", line 6874, in iter
self.execute()
File "c:\vnstudio\lib\site-packages\peewee.py", line 1907, in inner
return method(self, database, args, **kwargs)
File "c:\vnstudio\lib\site-packages\peewee.py", line 1978, in execute
return self._execute(database)
File "c:\vnstudio\lib\site-packages\peewee.py", line 2150, in _execute
cursor = database.execute(self)
File "c:\vnstudio\lib\site-packages\peewee.py", line 3157, in execute
return self.execute_sql(sql, params, commit=commit)
File "c:\vnstudio\lib\site-packages\peewee.py", line 3151, in execute_sql
self.commit()
File "c:\vnstudio\lib\site-packages\peewee.py", line 2917, in exit
reraise(new_type, new_type(exc_value,
exc_args), traceback)
File "c:\vnstudio\lib\site-packages\peewee.py", line 190, in reraise
raise value.with_traceback(tb)
File "c:\vnstudio\lib\site-packages\peewee.py", line 3144, in execute_sql
cursor.execute(sql, params or ())
File "c:\vnstudio\lib\site-packages\pymysql\cursors.py", line 148, in execute
result = self._query(query)
File "c:\vnstudio\lib\site-packages\pymysql\cursors.py", line 310, in _query
conn.query(q)
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
result.read()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
packet.raise_for_error()
File "c:\vnstudio\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "c:\vnstudio\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
peewee.OperationalError: (1054, "Unknown column 't1.turnover' in 'field list'")

Member
avatar
加入于:
帖子: 1
声望: 1

因为升级到2.5后,bar行情数据要求多一个turnover字段。需要对数据进行迁移升级,见升级公告数据库升级迁移部分。

或者用简单办法:

直接在数据库中加turnover字段默认0,比如对于关系型数据库sqlite,mysql这种,用任一数据库连接工具执行如下sql语句

alter table dbbardata add turnover float default 0;

即可添加turnover列。dbtickdata表也可用类似方式添加

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

malone wrote:

因为升级到2.5后,bar行情数据要求多一个turnover字段。需要对数据进行迁移升级,见升级公告数据库升级迁移部分。

或者用简单办法:

直接在数据库中加turnover字段默认0,比如对于关系型数据库sqlite,mysql这种,用任一数据库连接工具执行如下sql语句

alter table dbbardata add turnover float default 0;

即可添加turnover列。dbtickdata表也可用类似方式添加

感谢!

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

沪公网安备 31011502017034号