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

错误信息:
Traceback (most recent call last):
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\vnpy\app\csv_loader\ui\widget.py", line 124, in load_data
datetime_format
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\vnpy\app\csv_loader\engine.py", line 137, in load
datetime_format=datetime_format,
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\vnpy\app\csv_loader\engine.py", line 105, in load_by_handle
database_manager.save_bar_data(bars)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\vnpy\trader\database\database_sql.py", line 373, in save_bar_data
self.class_bar.save_all(ds)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\vnpy\trader\database\database_sql.py", line 148, in save_all
c).on_conflict_replace().execute()
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 1785, in inner
return method(self, database, *args, kwargs)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 1856, in execute
return self._execute(database)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 2572, in _execute
return super(Insert, self)._execute(database)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 2320, in _execute
cursor = database.execute(self)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 2961, in execute
sql, params = ctx.sql(query).query()
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 601, in sql
return obj.sql(self)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 2557, in sql
self._generate_insert(self._insert, ctx)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 2521, in _generate_insert
return ctx.sql(CommaNodeList(all_values))
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 601, in sql
return obj.sql(self)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 1649, in sql
ctx.sql(self.nodes[i])
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 601, in sql
return obj.sql(self)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 1649, in sql
ctx.sql(self.nodes[i])
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 601, in sql
return obj.sql(self)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 1308, in sql
return ctx.value(self.value, self.converter)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 613, in value
value = converter(value)
File "E:\mkygogo\vnpy\vnstudio2.0.4\lib\site-packages\peewee.py", line 4290, in db_value
return value if value is None else self.adapt(value)
ValueError: could not convert string to float:**

加载的数据是陈老师在群里分享的cryptocompare里的csv数据
好像发帖不能发csv文件,我把数据接个图,就是按照火币群里分享的下载代码下载的

description

加载时配置是这样的:

description

Administrator
avatar
加入于:
帖子: 1441
声望: 64

你的CSV数据有问题,有价格字段是空字符串"",检查下吧,最简单的替换为0应该就行了

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

用Python的交易员 wrote:

你的CSV数据有问题,有价格字段是空字符串"",检查下吧,最简单的替换为0应该就行了
是的,查出来在18年的数据里有一天的volume是空的,,,坑爹。。。
然后用那个notebook下载下来的数据只有18年1月18日以后的

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