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

使用tushare数据源,代码如果写IF2112.CFX,则提示下载0条,
如果代码写IF2112,则抛出异常。
我用pro.fut_daily是可以正常下载的。
请问如何解决?

description

Traceback (most recent call last):
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\peewee.py", line 3144, in execute_sql
    cursor.execute(sql, params or ())
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'turnover' in 'field list'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\vnpy_datamanager\ui\widget.py", line 606, in download
    count = self.engine.download_bar_data(symbol, exchange, interval, start)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\vnpy_datamanager\engine.py", line 215, in download_bar_data
    self.database.save_bar_data(data)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\vnpy_mysql\mysql_database.py", line 164, in save_bar_data
    DbBarData.insert_many(c).on_conflict_replace().execute()
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\peewee.py", line 1907, in inner
    return method(self, database, *args, **kwargs)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\peewee.py", line 1978, in execute
    return self._execute(database)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\peewee.py", line 2745, in _execute
    return super(Insert, self)._execute(database)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\peewee.py", line 2474, in _execute
    cursor = database.execute(self)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\peewee.py", line 3157, in execute
    return self.execute_sql(sql, params, commit=commit)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\peewee.py", line 3151, in execute_sql
    self.commit()
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\peewee.py", line 2917, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\peewee.py", line 190, in reraise
    raise value.with_traceback(tb)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\peewee.py", line 3144, in execute_sql
    cursor.execute(sql, params or ())
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "D:\Anaconda3\envs\vnpy_envs\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
peewee.OperationalError: (1054, "Unknown column 'turnover' in 'field list'")
Member
avatar
加入于:
帖子: 716
声望: 59

2.5版本在数据的存储字段中加了turnover字段,本地的数据库应该没有更新,可以把本地数据库删了试试,如果有数据需要先备份出来

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

本地数据库删了以后,使用IF2112可以正常下载,但是 turnover列和open_interest列为空,是什么原因呢?

description

Member
avatar
加入于:
帖子: 4548
声望: 276

因为数据供应商没提过吧

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

xiaohe wrote:

因为数据供应商没提过吧

数据提供商是tushare pro,金额和持仓数据都有的

description

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

description
在这个目录下修改一下这两行内容

description
或者可以等一下更新

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

郭易燔 wrote:

在这个目录下修改一下这两行内容
或者可以等一下更新

修改这两行后能正常运行,谢谢

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

沪公网安备 31011502017034号

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