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

2022-09-09 11:33:58.322268 开始加载历史数据

Output exceeds the size limit. Open the full output data in a text editor

OperationalError Traceback (most recent call last)
File c:\veighna_studio\lib\site-packages\peewee.py:3133, in Database.connect(self, reuse_if_open)
3132 with exception_wrapper:
-> 3133 self._state.set_connection(self._connect())
3134 if self.server_version is None:

File c:\veighna_studio\lib\site-packages\peewee.py:3866, in PostgresqlDatabase._connect(self)
3864 params.setdefault('dbname', self.database)
-> 3866 conn = psycopg2.connect(**params)
3867 if self._register_unicode:

File c:\veighna_studio\lib\site-packages\psycopg2__init__.py:122, in connect(dsn, connection_factory, cursor_factory, kwargs)
121 dsn = _ext.make_dsn(dsn,
kwargs)
--> 122 conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
123 if cursor_factory is not None:

OperationalError:

During handling of the above exception, another exception occurred:

OperationalError Traceback (most recent call last)
c:\Users\JasonZhao\strategies\PortfolioBasisBacktest.ipynb Cell 6 in <cell line: 2>()
1 #加载历史数据
----> 2 engine.load_data()
...
--> 122 conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
123 if cursor_factory is not None:
124 conn.cursor_factory = cursor_factory

OperationalError:

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

先用图形界面打开vn.py,检查里面的数据库数据是否是正常的。你看engine.load_data()的源代码会发现里面嵌套了一个函数,可以从数据库里面读取数据,然后弄成BarData的形式存到一个叫self.history_data的属性当中,你检查这些过程,看看是哪里出错了,是数据库里面的数据出错,还是读取数据出错(理论上不会,因为函数是封装好的)?

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

沪公网安备 31011502017034号

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